Open source · Rust · 9 crates

Autonomous coding harness,
built for machines.

Rune Code is a CLI agent runtime where humans set direction and claws execute. Streaming API, native tools, session persistence, sub-agent orchestration — all in ~20K lines of Rust.

rune
$
~20K lines of Rust
9 workspace crates
16 built-in tools
3 permission modes

What's inside

Everything needed for autonomous coding agent workflows, from API streaming to sub-agent orchestration.

Core

Anthropic API with native streaming

SSE streaming against the Messages API. Real-time token delivery, backpressure handling, extended thinking blocks, and cost tracking per session. Supports API keys and OAuth.

Runtime

Interactive REPL

Rustyline-powered REPL with tab completion, slash commands, model aliases, session resume, and markdown rendering in the terminal.

Runtime

Session persistence

Every conversation is persisted to disk. Resume sessions exactly where you left off, with full history and context.

Tools

16 built-in tools — extensible

Bash, ReadFile, WriteFile, EditFile, GlobSearch, GrepSearch, WebSearch, WebFetch, Agent (sub-agent spawning), and more. Each tool is permission-aware with three enforcement modes: read-only, workspace-write, and full-access.

Orchestration

Sub-agent spawning

Spawn child agents for parallel work. Structured handoffs, disagreement resolution, and verification loops between agents.

Protocol

MCP server lifecycle

Full Model Context Protocol support. Config validation, startup healthcheck, degraded-mode reporting, structured failure classification.

Config

Layered configuration

Global → project-local config hierarchy with deep-merge, validation, and hook support. Includes PreToolUse and PostToolUse hooks.

VCS

Git-aware

Native diff rendering, branch detection, worktree support, and stale-branch detection baked into the runtime.

Architecture

Nine focused crates. Each with one job.

rusty-claude-cli binary

Main entry point. REPL, one-shot prompt, streaming display, argument parsing.

api lib

HTTP client, SSE stream parser, request/response types, auth.

runtime lib

Conversation loop, config loader, session store, permission policy, MCP client, system prompt assembly.

tools lib

Bash, ReadFile, WriteFile, EditFile, GlobSearch, GrepSearch, WebSearch, WebFetch, Agent.

commands lib

Slash command definitions and help text for the REPL.

plugins lib

Plugin metadata, registries, and hook surfaces.

telemetry lib

Session trace events and telemetry payloads.

compat-harness test

Extracts upstream TypeScript manifests for parity verification.

mock-anthropic-service test

Deterministic local mock for CLI parity tests.

"Humans set direction. Claws coordinate, build, test, recover, and push. The repository is the artifact. The system behind it is the product."

Rune Code is not just a tool for humans — it's an execution runtime designed to be driven by autonomous agents. The project was built in public, coordinated by claws, and continuously improved through structured planning, execution, and review loops. The bottleneck is no longer typing speed. When agent systems can rebuild a codebase in hours, the scarce resource becomes architectural clarity, task decomposition, and conviction about what is worth building.

Roadmap

Phase 1 Reliable worker boot — lifecycle handshake, trust prompt resolver, session control API.
Phase 2 Event-native integration — canonical lane events, failure taxonomy, summary compression.
Phase 3 Branch/test awareness — stale-branch detection, recovery recipes, green-ness contracts.
Phase 4 Claw-first task execution — typed task packets, policy engine, claw-native dashboards.
Phase 5 Plugin & MCP lifecycle — first-class lifecycle contracts, end-to-end parity.

Get started

1
git clone https://github.com/niklasmarderx/rune.git && cd rune/rust
2
cargo build --workspace
3
export ANTHROPIC_API_KEY="sk-ant-..."
4
./target/debug/rune

Or one-shot: rune prompt "explain this codebase"

Links

Ecosystem