Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Build Your Own Claude Code

This repo contains solutions to CodeCrafters' "Build Your own Claude Code" challenge, implemented in two languages:

The challenge is to build a minimal, working clone of Claude Code — an LLM-powered coding assistant that can read files, write files, and run shell commands on request. Each solution sends prompts to an LLM (via the OpenRouter API, using an OpenAI-compatible chat.completions interface) and drives an agent loop:

  1. Send the conversation history + available tool specs to the model.
  2. If the model responds with tool_calls, execute the requested tool(s) locally (Read, Write, Bash) and feed the results back as tool messages.
  3. Repeat until the model replies with plain text instead of a tool call, then print that as the final answer.

Structure

Each solution directory is a self-contained CodeCrafters project with its own app/ entry point, codecrafters.yml config, and your_program.sh runner:

Directory Entry point Status
codecrafters-claude-code-go app/main.go Early stage — first-stage response handling only
codecrafters-claude-code-python app/main.py Further along — full agent loop with Read, Write, and Bash tools

See codecrafters-claude-code-python/NOTES.md for detailed notes on how tool calling and the agent loop are implemented.

Running

Each subdirectory has its own your_program.sh. For example, from codecrafters-claude-code-python:

export OPENROUTER_API_KEY=...
./your_program.sh -p "Summarize the README for me."

Both solutions require an OPENROUTER_API_KEY environment variable (and optionally OPENROUTER_BASE_URL, which defaults to OpenRouter's API).

Note: If you're viewing this on GitHub, head over to codecrafters.io to try the challenge yourself.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages