28/28 TESTS PASSING

AI Coding Agent
in Rust

A 2.8MB binary that runs Claude as a full coding agent on your Max subscription. Zero API costs. 7 tools. MCP integration. Ships as a single binary.

2.8MB
Binary Size
28/28
Tests Passing
3,454
Lines of Rust
$0
API Cost
claude-agent
$ ./claude-agent
  claude-agent v0.1.0 (Rust)
  claude-opus-4-6 · effort: High · backend: cli (Claude Max)
  7 tools · 11 MCP servers · 11 skills · 5 hooks
 
agent> write a fizzbuzz in Rust, compile it, run it
  [write] /tmp/fizzbuzz.rs
  [bash] rustc /tmp/fizzbuzz.rs -o /tmp/fizzbuzz && /tmp/fizzbuzz
  1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz...
  Done in 21s · 0 API tokens billed

11 Layers, 21 Source Files

A complete agent architecture in Rust — from authentication to tool execution, with MCP server integration and hook dispatch.

01
Inference Engine
Pipes prompts to claude -p via stdin. Strips API key to force Max subscription auth.
src/inference.rs
02
Tool System
7 built-in tools: bash, read, write, edit, glob, grep, web_fetch. Trait-based dispatch.
src/tools/
03
MCP Integration
Discovers and connects to MCP servers from Claude config. Extends tool surface dynamically.
src/mcp/
04
Skills & Hooks
Loads skill definitions and hook configs from ~/.claude/. Dispatches /commands to skills.
src/skills.rs, src/hooks.rs
05
Permissions
Controls which tools and paths the agent can access. Sandboxing for safe execution.
src/permissions.rs
06
Context Manager
Tracks conversation history, manages context window, handles /compact.
src/context.rs
07
Memory System
Persistent memory backed by file system. Reads/writes memory across sessions.
src/memory.rs
08
Auth Layer
Handles authentication. Strips ANTHROPIC_API_KEY to use subscription auth.
src/auth.rs
09
Type System
Message types, tool schemas, API response structs. serde-powered (de)serialization.
src/types.rs
10
Telemetry
Tracks token usage, response times, tool call counts. Session metrics.
src/telemetry.rs
11
CLI & REPL
Interactive REPL with rustyline. Flag parsing, colored output, status display.
src/main.rs, src/flags.rs

7 Native Tools

Each tool is a separate Rust module with async execution, error handling, and structured output.

$_
bash
Execute shell commands
📄
read
Read file contents
✏️
edit
String replacements
📝
write
Create/overwrite files
🔍
glob
Pattern file search
🔎
grep
Content search (regex)
🌐
web_fetch
HTTP requests

28/28 Tests Passing

Every tool, edge case, and error path tested live against Claude Opus 4.6 on Max subscription.

Simple math (2+2)PASS11s
Bash tool (ls)PASS13s
Read tool (Cargo.toml)PASS17s
Grep tool (async fn)PASS20s
Write + Read chainPASS16s
Multi-step (Python)PASS18s
Built-in commandsPASS<1s
Edit toolPASS39s
Glob tool (*.toml)PASS13s
Empty promptPASS<1s
Error: missing filePASS27s
Special charactersPASS13s
Complex bash (find+wc)PASS25s
3-step tool chainPASS107s
Deep analysisPASS160s
Error propagationPASS12s
Security: rm -rf /REFUSED13s
WebFetch (httpbin)PASS15s
Unicode + emojiPASS31s
Non-zero exit codePASS18s
Read missing filePASS11s
Grep zero matchesPASS17s
Write+compile RustPASS21s
Skill dispatchPASS<1s
Glob + line countPASS22s
Read-edit-verify-undoPASS48s
Bash with sleepPASS17s
Large stdout (500 lines)PASS41s

Claude Code, But Yours

The first open-source Rust agent that rides your Claude Max subscription for free.

$0 / month

Zero API Cost

Calls claude -p under the hood, which uses your Max subscription's OAuth token. No per-token billing. Run it all day — same flat rate.

FULLY MODIFIABLE

You Own the Code

Unlike Claude Code (closed-source Node.js), this is 3,454 lines of Rust you can read, modify, extend. Add tools, change behavior, strip telemetry — it's yours.

2.8MB BINARY

Single Binary Deploy

No Node.js runtime, no npm install, no dependency tree. One cargo build --release and you have a self-contained binary that starts instantly.

EXTENSIBLE

MCP + Skills + Hooks

Automatically discovers your MCP servers, skills, and hooks from Claude config. Extends the tool surface without modifying the agent.

Feature Claude Code claude-agent-rs
Source Code Closed Open (Rust)
Binary Size ~200MB (Node.js) 2.8MB
API Cost Subscription or API Subscription only ($0 extra)
Custom Tools MCP only Native Rust + MCP
Modify Behavior Config only Full source access
Startup Time ~2s <100ms
Embeddable No Library or binary

v0.1 → v1.0

5 milestones, 17 tracked issues. View on GitHub

v0.1.0 SHIPPED
Foundation
11 layers, 7 tools, CLI + API backends, MCP discovery, 28/28 tests, crates.io published.
v0.2.0
Streaming & Persistence
SSE streaming, conversation persistence (SQLite), session resume, token tracking.
v0.3.0
Sub-Agents & Parallelism
Agent tool, worktree isolation, task queue, agent-to-agent messaging, concurrency control.
v0.4.0
MCP Client
Full JSON-RPC 2.0 client, stdio transport, tool/resource discovery, health monitoring.
v0.5.0
Cross-Platform
Windows support, Homebrew formula, Docker (scratch), GitHub Actions release pipeline.
v1.0.0
Production Ready
Stable API, plugin system, security audit, OpenTelemetry, docs.rs, semver guarantee.

Install in 30 Seconds

install
# From source
$ git clone https://github.com/ExpertVagabond/claude-agent-rs
$ cd claude-agent-rs && cargo build --release
$ ./target/release/claude-agent
 
# From crates.io
$ cargo install claude-agent-rs
 
# As a library
$ cargo add claude-agent-rs