Skip to content

claude-code

Inside Claude Code's agent loop

Claude News

Claude Code runs on a single-threaded loop. The model takes a prompt, executes tools, returns output, and repeats until the task ends. A typical session involves 5 to 50 iterations. Before starting, the system loads around 8700 tokens of overhead, including the system prompt, definitions for 18 tools, and the CLAUDE.md file.

When the context window hits 92% full, a three-level compression kicks in. First, old tool results get dropped. Then, chat history gets summarized. The CLAUDE.md file always stays up to date since it's read from disk.

For complex tasks, Claude Code spins up sub-agents. They work in isolated contexts and return concise summaries to the parent, keeping context usage in check.

Related stories

  1. In Claude Code, one CLAUDE.md silently kills your AGENTS.md
  2. Claude Code 2.1.259 hands MCP servers to the whole org
  3. AgentBridge links Claude Code, Codex and Antigravity skills
  4. Shopify's CEO floats banning Claude Code over AGENTS.md
  5. Webify: an open source MCP server for web search in Claude Code
  6. @ttsc/graph reduces token usage in Claude Code by approximately 10x

Comments

No comments yet. Be the first.

Join the conversation

Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.

We only use your name and avatar from Google. We never store your email address.