This page provides definitions for codebase-specific terms, abbreviations, and domain concepts used throughout the claw-code Rust implementation. It serves as a technical reference for onboarding engineers to understand the mapping between high-level agent concepts and their concrete implementation in the Rust workspace.
The primary execution cycle managed by the ConversationRuntime. It drives the "turn" logic where the system sends a prompt to an LLM, processes streaming events (text or tool calls), executes requested tools, and feeds results back until a terminal state is reached.
ConversationRuntime::run_turn() rust/crates/runtime/src/conversation.rs75-150A design philosophy where the agent harness is optimized for machine interaction rather than just human TUI usage. This includes deterministic startup, machine-readable failure modes, and automated recovery loops ROADMAP.md16-26
A conceptual unit of work or a "worker instance" that tracks the progress of a specific task. Lanes have lifecycle states and emit structured events ROADMAP.md116-128
A security setting that gates what tools the agent can execute.
ResolvedPermissionMode rust/crates/runtime/src/config.rs22-26| Term | Definition | Code Pointer |
|---|---|---|
| ConversationRuntime | The engine coordinating the API client, tool executor, and session persistence. | rust/crates/runtime/src/conversation.rs75 |
| ToolExecutor | Trait responsible for taking a tool call from the LLM and producing a result. | rust/crates/runtime/src/conversation.rs73 |
| McpServerManager | Orchestrates the lifecycle of Model Context Protocol (MCP) servers (spawn, init, call). | rust/crates/runtime/src/mcp_stdio.rs107 |
| Session | An append-only log of messages (User, Assistant, Tool) that can be persisted to JSONL. | rust/crates/runtime/src/session.rs149 |
| GlobalToolRegistry | A container for all available tools: built-in (MVP), plugins, and runtime-defined tools. | rust/crates/tools/src/lib.rs109 |
| PromptCache | Logic for managing Anthropic prompt caching headers to reduce latency and cost. | rust/crates/api/src/providers/anthropic.rs17 |
| WorkerRegistry | Manages the state machine of background coding workers (Spawning, Ready, Running). | rust/crates/runtime/src/worker_boot.rs50 |
| ConfigLoader | Discovers and merges configuration from User, Project, and Local scopes. | rust/crates/runtime/src/config.rs215 |
The following diagrams illustrate the relationship between high-level concepts (Natural Language Space) and their concrete implementation in the code (Code Entity Space).
This diagram shows how a user prompt moves from the LiveCli REPL through the ConversationRuntime to an external API.
Sources: rust/crates/rusty-claude-cli/src/main.rs104-160 rust/crates/runtime/src/conversation.rs71-75 rust/crates/api/src/providers/anthropic.rs115-128
This diagram tracks how a tool_use block from the LLM is validated and executed.
Sources: rust/crates/tools/src/lib.rs57-60 rust/crates/runtime/src/permission_enforcer.rs29 rust/crates/runtime/src/conversation.rs71-75
The Worker lifecycle defines the strict sequence of states for background agents:
Sources: ROADMAP.md77-87 rust/crates/runtime/src/worker_boot.rs168-171
Common error classifications used for automated recovery and telemetry:
ApiError::safe_failure_class() rust/crates/api/src/error.rs128-149