explaingit

yujqiao/100cc

24TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A 100-line TypeScript coding agent you run with Bun and an OpenAI key, a minimal self-extending starter so you can learn how AI coding agents work by letting the agent build on itself.

Mindmap

mindmap
  root((100cc))
    What it does
      Reads your code
      Executes tasks from prompt
      Continues prior sessions
    Design goals
      100 lines of TypeScript
      Self-extending
      Minimal and readable
    How to use
      Pass prompt with flag
      Resume with continue flag
      Point at any OpenAI API
    Tech stack
      TypeScript
      Bun runtime
      OpenAI API
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Use the agent to add features to a small codebase by passing a prompt like 'implement a search function in this file'

USE CASE 2

Study the 100-line source to understand the core loop of an AI coding agent before building your own

USE CASE 3

Point the agent at a local Ollama or LM Studio endpoint to run tasks without spending on the OpenAI API

USE CASE 4

Start from the minimal harness and use the agent to extend itself into a more capable coding assistant

Tech stack

TypeScriptBunOpenAI API

Getting it running

Difficulty · easy Time to first run · 5min

Requires Bun runtime and an OpenAI API key, works with any OpenAI-compatible endpoint via base URL config.

No license information was provided in the explanation.

In plain English

This is a small experiment in building a coding agent from scratch using about 100 lines of TypeScript. The premise: write the smallest possible harness by hand, then let the agent extend itself from there. The repository is as much a learning artifact as it is a working tool. To run it, you need Bun (a JavaScript runtime) installed along with an OpenAI API key. You can also point it at any API endpoint that speaks the OpenAI protocol by setting the base URL in a configuration file. Once set up, you start the agent with a prompt and it reads your code and executes tasks accordingly. The only mode currently implemented is non-interactive: you pass a prompt with a flag and the agent works through it without waiting for further input. A separate flag lets you continue from a previous session, which is useful for multi-step tasks where you want to build on earlier work. The README shows examples like asking the agent to add jokes to a file, implement a new feature, or make the project look nicer visually. The broader idea is that once the core loop exists, you can use the agent to expand itself. The repository includes a list of additional features to add, and the author's intent is that you implement those features through the agent itself. It is a self-extending starting point rather than a finished product. The project is lightweight by design and avoids unnecessary output. If you want to understand how AI coding agents work at their most basic level, or if you want a minimal base to build your own, this gives you a concise starting point with the full implementation visible in a single file.

Copy-paste prompts

Prompt 1
I want to run 100cc to automatically add a new feature to my TypeScript project. How do I install Bun, set my OpenAI API key, and pass the right flags to start the agent?
Prompt 2
How does 100cc's core loop work? Walk me through the ~100 lines of TypeScript so I understand how it reads files, calls the OpenAI API, and executes the result.
Prompt 3
I want to point 100cc at a local OpenAI-compatible endpoint like LM Studio instead of the real OpenAI API. How do I set the base URL in the config file?
Prompt 4
I ran 100cc on a task yesterday and want to continue from where it left off. How do I use the continue flag to resume the previous session and build on earlier work?
Open on GitHub → Explain another repo

← yujqiao on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.