gitmyhub

100cc

TypeScript ★ 25 updated 17d ago

Roll up your own claude code with 100 lines

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.

TypeScriptBunOpenAI APIsetup: easycomplexity 2/5

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.

Where it fits