Claude Code

Claude Code

Anthropic's official agentic CLI. Not a code completion plugin — it's an autonomous agent that reads, edits, runs, and debugs code in your terminal. Runs claude-sonnet-4-6 by default; configurable to claude-opus-4-6 for complex tasks.

What It Actually Does

You describe a task. Claude Code reads your codebase, plans edits, executes shell commands, runs tests, and iterates until the task is done or it's stuck. The loop is: understand → plan → edit → run → evaluate → repeat.

Key behaviors:

  • Reads files to understand context before touching anything
  • Runs tests after edits to verify changes didn't break things
  • Asks clarifying questions when ambiguous, doesn't just guess
  • Stops and reports when genuinely blocked (rather than hallucinating a fix)

Hook System

Claude Code has a hook system that lets you intercept the agent loop at defined points:

  • PreToolUse: Run before any tool call (file read, shell exec, etc.)
  • PostToolUse: Run after any tool call completes successfully
  • PostToolUseFailure: Run after a tool call fails
  • Stop: Run when the agent is about to exit
  • SessionStart: Run when a new session begins
  • SessionEnd: Run when a session ends
  • UserPromptSubmit: Run when the user submits a prompt
  • FileChanged: Run when a file is modified
  • CwdChanged: Run when the working directory changes
  • ConfigChange: Run when configuration changes
  • InstructionsLoaded: Run when instructions are loaded

Hooks enable: auto-formatting on file saves, logging all shell commands, blocking dangerous operations, sending notifications when runs complete. This is the mechanism for overnight-runs monitoring.

Context Compaction

Long sessions accumulate context. Claude Code automatically compacts old context when approaching the model's limit — summarizing earlier conversation history to preserve room for current work. You can also trigger compaction manually with /compact [optional focus]. The project-root CLAUDE.md is re-injected after compaction so project instructions are always in context. This enables multi-hour sessions without manual context management.

Permissionless Execution

By default, Claude Code asks before running shell commands. You can configure it to run specific commands without asking — useful for trusted operations like npm test, git diff, build commands. Configured per-project via .claude/settings.json.

Pricing

No separate subscription — costs are API token costs at standard Anthropic rates. A typical agentic session (30-60 min of active edits) costs $2-15 depending on codebase size and model choice.

Strengths

  • Best-in-class for autonomous multi-file editing
  • Hook system enables robust agentic-workflows customization
  • Works well for overnight-runs on exe-dev or similar remote VMs
  • Context compaction enables genuinely long sessions
  • Integrates with mcp for extending tool access

Weaknesses

  • Terminal-only — no GUI (this is a feature for some, limitation for others)
  • Cost can add up on very large codebases where every task requires extensive reads
  • Less useful for non-code tasks compared to chat interfaces

Related

claude-sonnet-4-6 · claude-opus-4-6 · mcp · agentic-workflows · overnight-runs · exe-dev

Sources