A small coding agent I built from scratch in one night.
It talks to an LLM, calls tools in a loop, and can explore the repo, edit files, and run shell commands. The todo/ app in this repo was generated by the agent as a quick test.
demo.mp4
Local copy of the demo:
demo.mp4
- Streams model output to the terminal
- Lets the model call tools:
readandbash(run commands, write/edit files) - Reloads tools mid-session if you add a new one under
src/tools/ - Supports Groq and Anthropic via a thin provider layer
This is a learning / weekend harness, not a polished product.
pnpm installPut your key in .env:
Groq_API_Key=...
# optional
# ANTHROPIC_API_KEY=...Run with a prompt:
pnpm run dev -- -t "List the files in this repo and summarize what each folder is for."Or after linking the bin:
pnpm link --global
cc -t "Add a dark mode toggle to the todo app."Provider / model flags:
pnpm run dev -- -t "..." --provider groq
pnpm run dev -- -t "..." --provider anthropic --model claude-sonnet-4-5src/
main.ts # CLI entry, system prompt, event logging
agent/loop.ts # tool-calling agent loop
providers/ # Anthropic + OpenAI-compatible (Groq)
tools/
read.ts # read a file
bash.ts # shell + write/edit helpers
registry.ts # discover / reload tools
todo/ # tiny HTML/CSS/JS todo app the agent built
bin/cc.js # `cc` CLI wrapper
- Send the user prompt + system instructions to the provider
- If the model returns tool calls, run them and append results
- Repeat until the model stops calling tools (or hits the turn limit)
That’s it — no fancy planner, just a streaming tool loop.
npx --yes serve todoThen open the URL it prints.
- Built overnight as a from-scratch exercise
- Default Groq model is whatever is set in
src/providers/index.ts - Paths used by tools are constrained to the project root
ISC