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):

ToolRole
Readread files (line ranges)
Writecreate/overwrite
Editexact string replace
Bashshell
Globfilename patterns
Grepcontent regex
WebFetchfetch URLs
Taskspawn 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

DimensionClaude CodeCursor
InteractionCLI, long autonomyIDE, collaborative
Contextcompress + sub-agentsindex + @ refs
Project memoryCLAUDE.mdRules + Skills
Toolsbuilt-ins + MCPMCP-centric
Safetyper-command bash gateper-operation gate
Best forwell-scoped big tasksexploratory coding

Takeaways

  1. CLAUDE.md pattern—worth it on any agent stack
  2. Sub-agents—split work, protect context
  3. Compression—mandatory for 30+ steps
  4. 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.