instructkr/claw-code

The fastest repo in history to surpass 50K stars ⭐, reaching the milestone in just 2 hours after publication. Better Harness Tools that make real things done. Now writing in Rust using oh-my-codex.

94,225 stars Rust 10 components 2 connections

Rust port of Claude Code providing an AI coding assistant harness

User prompts flow through CLI to runtime, which orchestrates Claude API calls and tool executions in a conversational loop with session persistence

Under the hood, the system uses 3 feedback loops, 3 data pools, 4 control points to manage its runtime behavior.

Structural Verdict

A 10-component cli tool with 2 connections. 102 files analyzed. Minimal connections — components operate mostly in isolation.

How Data Flows Through the System

User prompts flow through CLI to runtime, which orchestrates Claude API calls and tool executions in a conversational loop with session persistence

  1. Input Processing — CLI parses user input, slash commands, and session restoration requests
  2. Conversation Setup — Runtime initializes session state, loads configuration, and prepares system prompts
  3. API Communication — AnthropicClient streams requests to Claude API with authentication and retry logic
  4. Tool Execution — Runtime executes tool calls in sandboxed environments with permission checks
  5. Response Processing — SSE parser converts streaming responses to structured events for real-time display
  6. Session Management — Conversations are persisted and compacted when approaching context limits

System Behavior

How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

Session State (state-store)
Conversation history and message persistence
Configuration Store (file-store)
Merged settings from multiple config sources
OAuth Credentials (file-store)
Cached authentication tokens

Feedback Loops

Delays & Async Processing

Control Points

Technology Stack

Rust (framework)
Primary language for performance and memory safety
reqwest (library)
HTTP client for Anthropic API communication
tokio (framework)
Async runtime for concurrent operations
serde (library)
JSON serialization/deserialization
clap (library)
Command-line argument parsing
regex (library)
Pattern matching for text processing
glob (library)
File pattern matching
walkdir (library)
Recursive directory traversal

Key Components

Configuration

src/commands.py (python-dataclass)

src/context.py (python-dataclass)

src/cost_tracker.py (python-dataclass)

src/deferred_init.py (python-dataclass)

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Cli Tool Repositories

Frequently Asked Questions

What is claw-code used for?

Rust port of Claude Code providing an AI coding assistant harness instructkr/claw-code is a 10-component cli tool written in Rust. Minimal connections — components operate mostly in isolation. The codebase contains 102 files.

How is claw-code architected?

claw-code is organized into 5 architecture layers: CLI Entry, Runtime Core, API Client, Tool System, and 1 more. Minimal connections — components operate mostly in isolation. This layered structure keeps concerns separated and modules independent.

How does data flow through claw-code?

Data moves through 6 stages: Input Processing → Conversation Setup → API Communication → Tool Execution → Response Processing → .... User prompts flow through CLI to runtime, which orchestrates Claude API calls and tool executions in a conversational loop with session persistence This pipeline design reflects a complex multi-stage processing system.

What technologies does claw-code use?

The core stack includes Rust (Primary language for performance and memory safety), reqwest (HTTP client for Anthropic API communication), tokio (Async runtime for concurrent operations), serde (JSON serialization/deserialization), clap (Command-line argument parsing), regex (Pattern matching for text processing), and 2 more. A focused set of dependencies that keeps the build manageable.

What system dynamics does claw-code have?

claw-code exhibits 3 data pools (Session State, Configuration Store), 3 feedback loops, 4 control points, 3 delays. The feedback loops handle retry and auto-scale. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does claw-code use?

5 design patterns detected: Multi-crate Workspace, Error Chain Propagation, Trait-based Abstractions, Builder Pattern, Event-driven Streaming.

Analyzed on April 1, 2026 by CodeSea. Written by .