The-Agency/CLAUDE.md

2.3 KiB

clawd_code

  • Claude Code source code is at /Users/imbenji/StudioProjects/clawd_code/old_repo
  • "Claude Code" refers to the original TypeScript source in /old_repo
  • "the Agency" refers to the Dart/Flutter project (lib/, pubspec.yaml, etc.)
  • lib/src/ → Core logic that must have parity with Claude Code
  • lib/ui/ → Flutter UI layer with creative freedom

Parity rule

lib/src/ must always have parity with Claude Code. Before implementing any feature or behaviour in lib/src/, check how Claude Code does it in /old_repo first. If something in lib/src/ diverges from how Claude Code works, treat that as a bug and fix it to match.

Always assume any implementation should achieve full parity with Claude Code — never a simplified version. If the Claude Code implementation is complex, implement it with the same complexity. Do not simplify unless the user explicitly says to.

lib/ui/ should have some parity with the Claude Code UI (ink components), but not full 1:1 parity — creative freedom is allowed for the Flutter implementation.

  • After writing Flutter code, always run flutter analyze 2>&1 | grep -E "^\s*(error)" before wrapping up.

Known parity gaps in lib/src/

When a file in lib/src/ strays from Claude Code behaviour, mark it with a // PARITY GAP: comment at the diverging code. Also list it here:

  • lib/src/chat/tool_loop_service.dart — Skips image resize/downsample (maybeResizeAndDownsampleImageBlock) and does not store pasted images to disk (storeImages). Claude Code does both in processUserInput.ts.
  • lib/src/tools/file_read_tool.dart — PDF reading returns a helpful error instead of actual content. Claude Code uses the Anthropic API's native PDF support + poppler for page extraction; Dart has no equivalent without native binaries. All other gaps (images, notebooks, dedup, binary detection, token limits, ENOENT suggestions, cyber risk reminder, macOS thin-space paths) are implemented.
  • lib/ui/providers/chat_provider.dart (UI layer) — Images sent as OpenAI-format image_url data URLs (OpenRouter requirement) instead of Anthropic-format base64 blocks. Uses a flat attachment list instead of Claude Code's PastedContent ID-ref system. Non-image files embedded as plain text rather than document blocks. See handlePromptSubmit.ts + processUserInput.ts.