Claude Code (Feb 2025) is Anthropic’s CLI coding agent. Unlike Cursor’s step-by-step collaboration, the philosophy is: give a goal, run to completion.
Positioning
Cursor Agent: "fix this bug" → edit → you review → continue
Claude Code: "refactor auth module" → 50 steps later → "done, tests pass"
Optimized for long autonomous tasks, not pair programming.
Core Architecture
CLAUDE.md: Project Memory
Auto-loaded from repo root:
# Project Instructions
## Stack
- Astro 5 + React + Tailwind 4
- Deploy: Cloudflare Pages
- Package manager: npm
## Conventions
- Trailing slashes on routes
- Components in src/components/
- Tests: vitest — npm test
## Commands
- npm run dev
- npm run build
- npm test
Like Cursor Rules + Skills combined—always in system context. Anthropic recommends documenting stack, commands, and conventions here.
Tool Set
10+ built-in tools (MCP support growing):
| Tool | Role |
|---|---|
| Read | read files (line ranges) |
| Write | create/overwrite |
| Edit | exact string replace |
| Bash | shell |
| Glob | filename patterns |
| Grep | content regex |
| WebFetch | fetch URLs |
| Task | spawn sub-agents |
Long-Task Context Management
1. Auto compression
Steps 1–10: full detail (explore repo)
Step 11: compress 1–5 to ~200 token summary
Step 20: compress 6–15
Step 50: context = summary chain + last 10 full steps + current task
2. Sub-agent parallelism
Main: "refactor auth module"
├── sub 1: analyze existing auth
├── sub 2: implement JWT
└── sub 3: update tests
Main merges results, continues
Avoids one sub-task consuming the entire window.
3. Error recovery
Step N: npm test → 3 failures
Step N+1: read failures, locate bug
Step N+2: edit fix
Step N+3: npm test → 1 failure
… until green
Harness retries and analyzes—not one-shot give up.
Permission Model
Read → automatic
Write/Edit → confirm first time; same session may auto-approve similar
Bash → confirm each command (unless --dangerously-skip-permissions)
WebFetch → automatic
npm install → confirm
More autonomous than Cursor on file writes; stricter on shell.
Reported Usage (Anthropic)
- Average task: 15–30 steps
- Top uses: bug fix (40%), features (30%), refactor (20%), tests (10%)
- Efficiency gains: 2–3× simple tasks, 5–10× complex
- Common failures: goal drift on long runs; over-editing unrelated files
Harness Comparison
| Dimension | Claude Code | Cursor |
|---|---|---|
| Interaction | CLI, long autonomy | IDE, collaborative |
| Context | compress + sub-agents | index + @ refs |
| Project memory | CLAUDE.md | Rules + Skills |
| Tools | built-ins + MCP | MCP-centric |
| Safety | per-command bash gate | per-operation gate |
| Best for | well-scoped big tasks | exploratory coding |
Takeaways
- CLAUDE.md pattern—worth it on any agent stack
- Sub-agents—split work, protect context
- Compression—mandatory for 30+ steps
- Bash is the danger zone—gate aggressively
References
Summary
Claude Code proves CLI long-horizon agents work. Keys: context compression + sub-agents + CLAUDE.md—so 50-step runs stay on goal.