Model or dataset
he-yufeng/CoreCoder avatar
he-yufeng/CoreCoder

CoreCoder: a 1,161-line coding agent you can read in an afternoon

Minimal AI coding agent (~1,000 lines of Python) inspired by Claude Code. Works with any LLM. Think NanoGPT for coding agents. Formerly NanoCoder.

1,778 stars436 forksPythonMIT

At a glance

What is it?
CoreCoder is a minimal Python coding agent that runs a real read-edit-run loop against any OpenAI-compatible LLM. Its value is as a readable reference for how these agents work, not as a replacement for your daily driver.
Who is it for?
Adopt CoreCoder if you want to understand or fork a coding agent and you are comfortable reading Python. Do not adopt it as a production assistant: it is beta, the README says the gaps are intentional, and the engine is about 1,161 lines.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 7 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 26, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem CoreCoder solves is not the one Claude Code solves

Most coding agents are closed or large. Claude Code is described in the README as hundreds of thousands of lines and closed; aider is tens of thousands of lines of Python. If you want to know how a coding agent actually works, the loop, the context handling, the tool dispatch, you either read a diagram or you read a lot of code. CoreCoder takes the opposite route. The engine, meaning the loop, the model interface, the context handling, the tools and the sessions, is 1,161 lines once blank lines and comments are dropped. The whole package is 24 files, 2,384 physical lines, 1,931 net.

That number is the product. The README frames the project as "the nanoGPT of coding agents": a minimal, readable implementation whose purpose is to teach the subject and to be forked. The audience is engineers who want to understand one of these tools from the inside, set a breakpoint on any line, change it, and rerun. It is not aimed at people who want a better autocomplete. The README says this plainly: sitting CoreCoder next to Claude Code and aider "isn't about competing for their users."

How the loop and the tools fit together

The architecture is deliberately flat. The README's code map points at `corecoder/agent.py` as the starting point, describing it as the agent loop plus parallel tool execution at 213 lines. `llm.py` handles streaming. Everything else is context, tools, sessions and the CLI wrapper.

The loop itself is the familiar shape: a while loop around a large model, plus seven or eight tools that let the model act on the filesystem and the shell. What the README stresses is that the loop was never the hard part. The hard part is everything the loop has to cope with once it meets a real repository, and CoreCoder handles a specific subset of that: it reads and writes files, executes shell commands, spawns sub-agents, and compacts context in three tiers. It also reports the tokens and dollars a run consumed when asked.

Two mechanisms are worth naming because they are the parts most likely to bite you. First, anything that would mutate the disk or run a command stops for consent. Second, context compaction is tiered rather than a single summarisation pass, which matters because a one-shot agent that never compacts will simply hit the context limit on a long task. The README does not document how the tiers are chosen, so if compaction behaviour is the reason you are reading the code, that is a question for the source rather than the documentation.

Installing CoreCoder and running your first task

The README recommends cloning and installing editable, because the intended workflow is reading and changing the code as you go. Python 3.10 or later is required according to `pyproject.toml`.

bash
git clone https://github.com/he-yufeng/CoreCoder
cd CoreCoder
pip install -e .

If you only want to try it, the package is on PyPI, so `pip install corecoder` works as well. That installs the `corecoder` console script declared in `pyproject.toml`.

CoreCoder speaks the OpenAI-compatible API by default. Switching providers is usually two environment variables. The README gives this DeepSeek example:

bash
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.deepseek.com
export CORECODER_MODEL=deepseek-chat

For a local Ollama instance the same pattern applies, with `OPENAI_BASE_URL=http://localhost:11434/v1` and `CORECODER_MODEL=qwen2.5-coder`. The key can be exported directly or placed in a `.env` at the project root, which is loaded on startup. Providers without an OpenAI-compatible endpoint need the optional LiteLLM backend:

bash
pip install "corecoder[litellm]"

Then run it. The interactive REPL is the bare command; one-shot mode takes a prompt and exits when done:

bash
corecoder
corecoder -p "add error handling to parse_config()"

The README notes one behaviour to expect from the one-shot path: `-p` refuses mutating tools unless you pass `--yes`. That is by design, not a bug, but it means a first `-p` run will read and propose rather than edit. The README also states the loop was smoke-tested end to end, meaning read the file, edit it, run it, report back, against DeepSeek, Qwen3 and Kimi K2 through a single OpenRouter-compatible endpoint.

The permission layer is a gate you will hit early

The v0.5.0 release added a permission layer, and it is the feature most likely to interrupt a first session. Mutating tools stop for consent. That is the correct default for an agent that can run shell commands, and it is also the reason a scripted workflow will appear to hang or refuse. The `-p` flag compounds this: without `--yes`, mutating tools are refused outright.

There is no documented way around this in the README beyond the `--yes` flag, and the README does not describe how permissions are scoped, whether they can be remembered per tool, or whether a config file controls them. If you intend to run CoreCoder unattended, that gap matters. You are choosing between passing `--yes` and giving up the consent gate entirely, or staying interactive. The README presents the refusal as intentional; treat it as a design boundary rather than a rough edge.

A second constraint is scale. The README says the project deliberately keeps only the minimal core and that what is missing is where you branch off. That is an honest description of a reference implementation, but it also means you should not expect the failure recovery, retry logic or provider-specific quirks that a production agent accumulates. The 146 tests cover what the project chose to cover.

Where CoreCoder sits next to aider and Claude Code

The README's own comparison table puts CoreCoder at roughly 1,161 engine lines, aider at tens of thousands of Python lines, Claude Code at hundreds of thousands of closed lines, and nanoGPT at about 600 lines across two files. The nanoGPT column is the honest one: nanoGPT teaches you to train a GPT, and CoreCoder is after the same thing with an agent that edits code as the subject.

The difference from aider is approach, not capability. Aider is a terminal pair-programming tool you are meant to use; CoreCoder is a codebase you are meant to read and fork. That distinction shows up in the install instructions, which recommend an editable clone rather than a package install, and in the repository layout, which includes an `article/` directory with eight bilingual source-reading essays and an `examples/plan_hooks_demo.py` file.

The difference from Claude Code is that Claude Code is the thing being studied. The README states the code came out of a public teardown: open analyses have already exposed much of the load-bearing architecture inside production agents, and CoreCoder rewrites the most essential layer in as little code as possible. Reading it is closer to reading a runnable, annotated take on that architecture than to reading a competitor's source. If you need an agent to ship work this week, aider or Claude Code is the right tool and CoreCoder is not.

Licence, maintenance and what an upgrade costs you

CoreCoder is MIT licensed, and `pyproject.toml` declares `license = "MIT"`. For a project explicitly built to be forked, that is the permissive option you would want: you can take the code, modify it and redistribute it, subject to the licence terms. The repository also carries a `LICENSE` file at the root. This is a description of the licence identifier, not legal advice; read the file if the terms matter to your use.

The project is not archived, and the last push was on 2026-09-08. Recent releases are close together: v0.4.2 with `/undo` checkpoints on 2026-09-02, v0.5.0 with the permission layer on 2026-09-04, and v0.6.0 with MCP, hooks and plan mode on 2026-09-06. `pyproject.toml` classifies the project as "Development Status :: 4 - Beta".

That release cadence is the upgrade cost. Three feature releases in six days means the surface is still moving, and if you fork the engine, every upstream change is a merge you have to reason about. The dependency list is short, `openai>=1.0`, `rich>=13.0`, `prompt_toolkit>=3.0` and `python-dotenv>=1.0`, with LiteLLM optional, so the blast radius of a dependency bump is small. The risk is in the code you forked, not in the packages under it.

Editorial conclusion

Adopt CoreCoder if you want to understand or fork a coding agent and you are comfortable reading Python. Do not adopt it as a production assistant: it is beta, the README says the gaps are intentional, and the engine is about 1,161 lines. Before relying on it, verify the permission layer and the /undo checkpoints against your own workflow, and check that your provider works through the OPENAI_BASE_URL and CORECODER_MODEL variables.

Frequently asked questions

What is CoreCoder?

CoreCoder is a minimal AI coding agent in Python, described in its README as roughly 1,000 lines and inspired by Claude Code. The engine is 1,161 lines excluding blank lines and comments, and it works with any LLM that speaks the OpenAI-compatible API.

How do I install CoreCoder?

The README recommends cloning the repository and running pip install -e . so you can read and change the code as you go. A plain pip install corecoder from PyPI also works if you just want to run it.

Which models does CoreCoder work with?

It speaks the OpenAI-compatible API by default, and switching providers is usually two environment variables, OPENAI_BASE_URL and CORECODER_MODEL. Providers without an OpenAI-compatible endpoint are reachable through the optional LiteLLM backend installed with pip install "corecoder[litellm]".

Why does CoreCoder refuse to edit files in one-shot mode?

One-shot mode with the -p flag refuses mutating tools unless you pass --yes. The README states this is by design: anything that would mutate your disk or run a command stops for your consent first.

Is CoreCoder a replacement for Claude Code or aider?

No. The README says putting CoreCoder next to Claude Code and aider is not about competing for their users; it is a minimal reference implementation meant to be read and forked. If you need a production coding assistant, those tools are the ones to use.

Official sources

  1. he-yufeng/CoreCoder on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/he-yufeng-corecoder.svg)](https://hysenlabs.com/projects/he-yufeng-corecoder)