How ultraworkers/claw-code works
Claw Code is the canonical Rust implementation of the claw CLI agent harness; the Python tree is described as a companion/reference workspace, not the primary runtime. The documented user path is to launch the CLI, run doctor to check setup, then submit a prompt or start an interactive session. The graph includes provider routing and the separate RAG indexing capability visible in the source index. Several Rust runtime subsystems are unsampled, so their relationships are shown only as unverified links or omitted.
Main entry points: worker_boot.rs Worker boot · ingest.rs Workspace ingestion · client.rs Provider client · main.rs Claw CLI
Components 21
CLI and setup
- Claw CLI
rust/crates/rusty-claude-cli/src/main.rs - Health checks
rust/crates/claw-analog/src/doctor.rs - Configuration
rust/crates/runtime/src/config.rs
Agent runtime
- Command handling
rust/crates/commands/src/lib.rs - Session control
rust/crates/runtime/src/session_control.rs - Worker boot
rust/crates/runtime/src/worker_boot.rs - Policy enforcement
rust/crates/runtime/src/policy_engine.rs - Tool execution
rust/crates/tools/src/lib.rs - Plugin lifecycle
rust/crates/plugins/src/lib.rs
Model API
- Provider client
rust/crates/api/src/client.rs - Anthropic provider
rust/crates/api/src/providers/anthropic.rs - OpenAI-compatible
rust/crates/api/src/providers/openai_compat.rs - HTTP transport
rust/crates/api/src/http_client.rs - Prompt cache
rust/crates/api/src/prompt_cache.rs
Knowledge indexing
- Workspace ingestion
rust/crates/claw-rag-service/src/ingest.rs - Text chunking
rust/crates/claw-rag-service/src/chunk.rs - Embedding service
rust/crates/claw-rag-service/src/embed.rs - Vector index
rust/crates/claw-rag-service/src/qdrant_index.rs - SQLite store
rust/crates/claw-rag-service/src/db.rs
Other components
- CLI user
- Model API service
Connections 21
- CLI user → Claw CLI: runs
README.md - Claw CLI → Health checks: runs health check
README.md - CLI user → Claw CLI: submits prompt
README.md - Claw CLI → Session control: starts session
- Session control → Worker boot: starts worker
- Worker boot → Command handling: dispatches commands
- Worker boot → Policy enforcement: checks policy
- Worker boot → Tool execution: invokes tools
- Worker boot → Provider client: requests completion
- Worker boot → Plugin lifecycle: runs plugins
- Provider client → Anthropic provider: routes requests
rust/crates/api/src/client.rs - Provider client → OpenAI-compatible: routes requests
rust/crates/api/src/client.rs - Provider client → Prompt cache: configures cache
rust/crates/api/src/client.rs - Anthropic provider → HTTP transport: uses transport
rust/crates/api/src/providers/anthropic.rs - OpenAI-compatible → HTTP transport: uses transport
rust/crates/api/src/providers/openai_compat.rs - Anthropic provider → Model API service: sends requests
- OpenAI-compatible → Model API service: sends requests
- Workspace ingestion → Text chunking: chunks files
rust/crates/claw-rag-service/src/ingest.rs - Workspace ingestion → Embedding service: embeds batches
rust/crates/claw-rag-service/src/ingest.rs - Workspace ingestion → SQLite store: writes records
rust/crates/claw-rag-service/src/ingest.rs - Workspace ingestion → Vector index: updates index
rust/crates/claw-rag-service/src/ingest.rs