Loading repository data…
Loading repository data…
yanzhi0922 / repository
Source-available Rust implementation of a Claude Code-style coding agent: CLI, TUI, headless runtime, MCP, permissions, sessions, plugins, and remote runner primitives.
rust-code is the focused Claude Code rewrite slice extracted from the larger remote-code-rust platform. It keeps the agent runtime, CLI, TUI, headless execution path, MCP integration, permissions, sessions, plugins, and remote runner primitives without carrying the desktop GUI, Codex, Roo, cloud deployment, or platform-only code.
This project is not affiliated with Anthropic. "Claude Code" is used only to describe compatibility goals and the style of developer workflow being reimplemented.
AI coding agents are becoming core developer infrastructure. The runtime should be inspectable, hackable, fast to ship, and conservative about local execution. This project explores that direction in Rust:
tokio, streaming providers, websocket transports, and non-blocking tool orchestration.git clone https://github.com/yanzhi0922/rust-code.git
cd rust-code
cargo run -p remote-code -- --help
Run an interactive terminal UI:
cargo run -p remote-code -- tui
Run a one-shot prompt in print mode:
cargo run -p remote-code -- --print "Explain this repository in 5 bullets"
Check local runtime health:
cargo run -p remote-code -- doctor
| Area | Included |
|---|---|
| Runtime | Conversation loop, streaming events, compaction, sessions, transcripts |
| Interfaces | CLI, headless print mode, TUI, resume/status/review/worktree/task commands |
| Tools | Bash, file operations, search, todos, web fetch/search hooks, delegated agents |
| Safety | Permission modes, shell classification, path checks, hooks, audit-oriented decisions |
| Extensibility | MCP servers, plugins, skills, settings layers, output styles |
| Providers | Anthropic-style API client, model config, retry/failover, usage and cost accounting |
| Remote primitives | Runner/control-plane protocol, websocket/QUIC transport building blocks |
flowchart LR
CLI["agents/claudecode<br/>remote-code CLI/TUI/headless"]
Runtime["claude-query-engine<br/>turn loop + observers"]
Provider["claude-provider<br/>streaming API client"]
Tools["claude-tools<br/>shell, files, search, MCP bridge"]
Safety["claude-permissions<br/>policy + path checks"]
State["claude-session<br/>transcripts + resume"]
Extensions["claude-mcp / claude-plugins / claude-skills"]
Remote["rc-agent-protocol<br/>rc-engine-events<br/>rc-remote-transport"]
CLI --> Runtime
Runtime --> Provider
Runtime --> Tools
Tools --> Safety
Runtime --> State
Runtime --> Extensions
CLI --> Remote
The workspace is intentionally narrow:
agents/claudecode # remote-code binary entry point
crates/claude/* # Claude Code-style runtime crates
crates/shared/rc-agent-protocol # shared agent protocol
crates/shared/rc-engine-events # runtime event stream types
crates/shared/rc-remote-transport # direct/relay/QUIC transport pieces
These commands are the current baseline:
cargo check --workspace --locked
cargo fmt --all -- --check
cargo test -p remote-code --locked
Latest local verification before this README refresh:
cargo check --workspace --locked PASS
cargo fmt --all -- --check PASS
cargo test -p remote-code --locked PASS (194 tests)
This repository is source-available and early-stage as a standalone public project. The implementation is substantial, but the public packaging, release process, examples, and contributor workflow are still being sharpened.
Good first areas for improvement:
This repository is deliberately not the full remote-code-rust platform. It excludes:
That boundary keeps this repository easy to understand as one thing: a Rust implementation of a Claude Code-style coding agent.
This repository is currently published under a source-available license. See LICENSE for details.