Glossary
Agentic Loop
Section titled “Agentic Loop”The core execution cycle of Claude Code: call the LLM → process response → execute tools → feed results back → repeat. Implemented as an async generator function that yields events at each step, enabling observation, pausing, and cancellation. See The Loop.
Auto Compact
Section titled “Auto Compact”The third layer of context compression. When the conversation reaches ~80% of the context window capacity, Auto Compact summarizes the oldest N messages into a single summary message using a lightweight model call. This buys significant headroom (often 30-50% reduction) while preserving key decisions and context. See Four-Layer Compression.
Bridge
Section titled “Bridge”The abstraction layer that connects Claude Code’s internal message format with the external API format. The Bridge translates between internal Message objects and the API’s content_block structure, handling format conversion, streaming events, and error mapping. This decoupling allows the rest of the codebase to work with a clean internal format without being coupled to API specifics.
CLAUDE.md
Section titled “CLAUDE.md”A special Markdown file placed in a project’s root directory (or user’s home directory) that provides persistent instructions to Claude Code. Functions as a “project memory” — the model reads it at the start of every session to understand project conventions, tooling preferences, and behavioral guidelines. Supports hierarchical merging: enterprise → user → project → subdirectory.
Context Collapse
Section titled “Context Collapse”The failure mode when accumulated conversation history exceeds the model’s context window. Without proactive compression, context collapse typically occurs after 15-20 minutes of active agent usage. The term emphasizes that it’s not a graceful degradation — the agent simply stops functioning. See Context Window Management.
Coordinator
Section titled “Coordinator”A multi-agent pattern where a central “coordinator” agent manages a workflow by assigning tasks to worker agents, monitoring progress, and dynamically replanning based on intermediate results. More complex than Fork but supports dependent tasks and adaptive execution. See Coordinator Pattern.
DreamTask
Section titled “DreamTask”An internal concept for speculative background work. When the agent is idle (e.g., waiting for user input), DreamTask runs low-priority operations like caching frequently-used files, pre-computing likely next steps, or warming the prompt cache. Named by analogy to how the brain consolidates information during sleep.
The simplest multi-agent pattern. A parent agent spawns independent child agents, each handling a separate subtask in parallel. Children return results to the parent for synthesis. Forks are “fire-and-forget” — the parent doesn’t manage the child’s execution. Key advantage: excellent prompt cache reuse since all forks share the parent’s prefix. See Fork Mechanism.
A user-configurable interception point in the tool execution lifecycle. Hooks allow users to run custom scripts or logic when specific events occur (e.g., onToolStart, onToolEnd, onError). Defined in .claude/hooks.json with matchers that filter which tools/events trigger the hook. More lightweight than plugins. See Hook System.
In-Process Teammate
Section titled “In-Process Teammate”The conceptual framing for Claude Code’s interaction model. Rather than a request-response chatbot or an autonomous agent, Claude Code operates as an “in-process teammate” — it works alongside the developer in their terminal, asks for permission when needed, and shares the developer’s working context (files, git state, running processes).
Mailbox
Section titled “Mailbox”The communication mechanism used in the Team/Swarm multi-agent pattern. A shared message queue where agents post messages addressed to specific peers or broadcast to all. Each agent reads unread messages from the mailbox, processes them according to its role, and posts responses. Provides loose coupling between peer agents.
MCP (Model Context Protocol)
Section titled “MCP (Model Context Protocol)”An open standard protocol for connecting LLM applications to external data sources and tools. In Claude Code, MCP integration allows connecting to external MCP servers that provide additional tools, data sources, and capabilities beyond the built-in 46 tools. Follows a client-server architecture where Claude Code is the MCP client. See MCP Integration.
Microcompact
Section titled “Microcompact”The second layer of context compression. Individual tool results that are no longer immediately relevant are summarized into one-line descriptions (e.g., a 500-line file read becomes "[ReadFile /src/index.ts: 245 lines, 12 exports]"). More targeted than Auto Compact — it compresses specific messages rather than summarizing conversation segments. See Four-Layer Compression.
Permission Mode
Section titled “Permission Mode”The runtime configuration that determines how Claude Code handles tool execution permissions. Three modes: always allow (auto-approve, for trusted environments), require approval (ask the user for each sensitive operation), and never allow (hard deny regardless of context). Can be set globally, per-project, or per-tool.
Plugin
Section titled “Plugin”A deep extension mechanism that allows third parties to add entirely new tools, modify existing tool behavior, or extend the agent’s capabilities. More powerful than hooks but requires understanding the tool system’s internal API. Plugins are loaded at startup and registered in the tool registry.
Prompt Cache
Section titled “Prompt Cache”Anthropic’s API feature that caches the prefix of a request. Subsequent requests with the same prefix reuse cached tokens at 90% reduced cost. Claude Code’s entire system prompt architecture is optimized for maximum cache prefix length — static content first, dynamic content last. The cornerstone of cost optimization for multi-turn and multi-agent sessions. See Prompt Cache Strategy.
A predefined workflow template that encapsulates a common multi-step operation (e.g., /commit, /review-pr, /fix-tests). Skills are invoked by slash commands and provide structured guidance for specific tasks. Unlike plugins, skills are user-facing workflows rather than system-level extensions.
The first and lightest layer of context compression. When a single tool result exceeds a size threshold (~10K characters), the middle portion is replaced with a [... N characters snipped ...] marker, preserving the head (imports, declarations) and tail (exports, recent content). See Four-Layer Compression.
StreamingToolExecutor
Section titled “StreamingToolExecutor”The component responsible for executing tools while the API is still streaming. It parses partial JSON incrementally and begins tool execution as soon as a tool call’s input is fully parseable — often seconds before the API response completes. This overlap can reduce perceived latency by 40-60%. See Streaming Executor.
SubAgent
Section titled “SubAgent”A child agent spawned by the main agent to handle a specific subtask. SubAgents share the parent’s system prompt prefix (for cache reuse) and return results to the parent upon completion. Can be spawned via Fork (parallel, independent) or Coordinator (managed, potentially dependent) patterns.
An alternative name for the Team multi-agent pattern, emphasizing the emergent behavior that arises from multiple autonomous agents interacting through a shared mailbox. The term comes from swarm intelligence — simple individual rules producing complex collective behavior. See Team & Swarm.
A multi-agent pattern where multiple agents operate as peers with no central authority. Communication happens through a shared Mailbox. Each agent has a specialized role (e.g., “security reviewer”, “performance optimizer”) and contributes its domain expertise to collaborative problem-solving. Most complex coordination pattern. See Team & Swarm.
An executable capability exposed to the Claude model. Each tool has a name, description, input schema (Zod), and execution function. Claude Code includes 46 built-in tools across categories: file operations, shell execution, search, version control, MCP, and agent management. The model decides which tools to call based on the task. See Built-in Tools.
Worktree
Section titled “Worktree”Git’s worktree feature used for agent isolation. When a sub-agent (Fork or Coordinator worker) needs to modify files, it operates in a separate git worktree — a linked working directory that shares the same repository but has an independent checkout. This prevents concurrent agents from creating file conflicts. See Isolation & Worktree.