Skip to content
Back to the catalog
Project coding-agentToolingBeginnerComing soon

Build your own coding agent

Build a coding agent from scratch. Connect models through OpenRouter, secure API keys, define tools and implement the autonomous ReAct loop.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

Tools like Claude Code, Codex, Pi, and OpenCode are reshaping software engineering. For junior developers and beginners, they might feel like magic black boxes. In reality, their architecture rests on clean, approachable software principles: communicating with model APIs through a universal router like OpenRouter, defining tools with JSON schemas, and safely inspecting and editing code within an iterative loop.

In this project, you will build a coding agent runtime from the absolute fundamentals. You will understand what an API key is and how to protect it with environment variables, why model routers prevent vendor lock-in, how to structure tools with line context and surgical patching, and how to orchestrate the autonomous Reason-Act (ReAct) loop.

Roadmap

7 stages across 3 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Model Foundations, API Keys, and Routers

    Understand language models, API key authentication, why to use OpenRouter as a universal model router, and how to declare standard tool schemas.

  2. Phase 23 stages

    Workspace Tools

    Implement the tools the agent uses to inspect and modify code: line-numbered reading, file creation, and surgical patching.

  3. Phase 32 stages

    Execution Protocol and ReAct Loop

    Unify tools in a dispatcher that isolates recoverable errors and orchestrate the autonomous ReAct reasoning and acting loop.

Before you start

A CLI coding agent engine that declares OpenRouter/OpenAI-compatible tool schemas, inspects and edits code via surgical patching, dispatches structured tool calls, and drives the ReAct execution loop to completion.

  • grep
    Coming soon

    Build your own grep

    Build your own grep from scratch. Read stdin, filter text by pattern and handle exit codes while learning the foundations of Unix tools.

    Beginner7 stages~6 hTooling
    regexCLIstdin

    Go · Python · Zig

  • git
    Coming soon

    Build your own Git

    Build your own Git from scratch. Store blobs, trees and commits to understand content-addressed objects and how version control works.

    Advanced12 stages~18 hTooling
    hashingzlibDAG+1

    Go · Python · Rust

  • mcp-server
    Beta

    Build your own MCP server

    Build an MCP server from scratch. Implement Model Context Protocol with JSON-RPC, tools and resources to connect AI clients to your programs.

    Intermediate5 stages~12 hNetworking
    MCPJSON-RPCagents+1

    TypeScript · Python · Go