Mini Claw Code banner
odysa odysa

Mini Claw Code

Development community

Description

Build your own mini coding agent in Rust.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Mini Claw Code banner

Mini Claw Code

Build a coding agent from scratch in Rust — guided by Claude Code's architecture.

Read the Book (EN) · 中文版 (Book) · 中文 README · Quick Start · Chapters


You use coding agents every day. Ever wonder how they actually work?

mini-claw-code running in a terminal

It's simpler than you think. Strip away the UI, the streaming, the model routing — and every coding agent is just this loop:

loop:
    response = llm(messages, tools)
    if response.done:
        break
    for call in response.tool_calls:
        result = execute(call)
        messages.append(result)

The LLM never touches your filesystem. It *asks* your code to run tools — read a file, execute a command, edit code — and your code *does*. That loop is the entire idea.

This book builds that loop from scratch and then grows it into the full architecture of a real coding agent: streaming, permissions, hooks, plan mode, configuration, and more. **18 chapters. Test-driven. No magic.**

Mini Claw Code architecture: User ↔ Agent ↔ LLM + Tools

What you'll build

A working coding agent that can:

  • Run shell commandsls, grep, git, anything
  • Read, write, and edit files — full filesystem access with surgical find-and-replace
  • Talk to real LLMs — via OpenRouter (free tier available, no credit card)
  • Stream responses — SSE parsing, token-by-token output
  • Search a codebase — glob for files, grep f