The harness
Think of Claude Code as a local Claude. The model still runs at Anthropic, but the harness (the loop that holds context, calls tools, and orchestrates work) runs on your machine.
The harness/agent distinction
A model is the LLM itself: something that takes a prompt and returns text. A harness is everything that wraps the model to turn it into an agent: context management, tool dispatch, permissions, session state, MCP connections, the REPL.
The harness is as important as the model. On CORE-Bench (an academic agent benchmark from Princeton’s HAL group) the same model, Opus 4.5, scored 42% with the benchmark’s standard scaffold and 78% inside Claude Code’s harness on the same tasks. A capability that looks like “what the model can do” is often “what the model plus a good harness can do.”
This is also why staying close to the primitives matters: the harness is the primitive layer for agent work.
The local-first execution model
Implications of running the harness on your machine:
- All conversations are logged locally for future introspection, work tracking, reflection, and handoff.
- Only LLM requests go back to Anthropic. Everything else (file reads, bash, git, local scripts) stays on your machine.
- Your files are manipulated locally. Claude can write and run scripts to operate on your data without ever sending that data upstream. If the task can be solved by a local script, no data leaves.
- Sandboxing is in your hands. You decide what directories Claude can touch, what network access it has, what credentials it can reach.
This is meaningfully different from a cloud-hosted agent that reaches into your systems via APIs. The trust model is: Claude sees what you let it see.
The REPL workflow
Claude Code runs as a REPL in your terminal. Familiar to engineers, learnable for anyone:
- You type or dictate a request.
- Claude thinks, calls tools, writes files, runs commands.
- You see everything it does in the transcript.
- You respond; the loop continues.
The transcript isn’t just a log: it’s the medium of the conversation. You’re co-working in a visible record.
bash as the universal API
Claude can call any command-line tool you have installed. git, npm, curl, psql, jq, your own scripts: anything that runs in a shell runs for Claude. This is the most underrated feature of the harness.
Practical consequence: if you can do it with a command, Claude can do it. Building, testing, deploying, querying databases, processing files, calling APIs that don’t have an MCP yet. The harness doesn’t need a specific integration for each task; bash covers all of them.
Session logs
Every session is stored as a local transcript (on macOS, under ~/.claude/projects/). The logs are markdown-parseable and include everything: your prompts, Claude’s responses, tool calls, tool results.
This is the foundation for:
- Work tracking: deterministic hour extraction from timestamps (see Everything through Claude)
- Reflection: reviewing what a session actually did vs. what you remember
- Self-learning loops: mining logs for patterns that should become Skills or
AGENTS.mdentries - Onboarding: handing a teammate the actual path you took, not a sanitized retrospective
The logs compound. Treat them as a resource.
Plain files you can read
Claude Code itself is not open source, but everything it writes is plain files on your machine: transcripts under ~/.claude/projects/, configuration, skills. You can read them, script against them, and build on them. Reading your own transcripts and configs is a faster education than any blog post about “how agents work.”
Resources
- Anthropic: How Claude Code works
- Anthropic: Effective harnesses for long-running agents
- Anthropic: Building agents with the Claude Agent SDK