tarek.kharsa

home / lessons

Series3 codebases · 24 lessons

Lessons from great codebases

I read one open-source codebase cover to cover, then write up eight things it does better than most. Every claim links to the code.

Every round, I read one open-source codebase cover to cover: the server, the clients, the lint rules, the CI, the PR templates, even the bot configs. Then I write up eight things it does better than most projects. Every repo I pick is one I'd hold up as an example of good engineering.

How each lesson works

  1. In short: the problem and the idea, in two sentences, at the top.
  2. The engineering: how the repo actually does it, with real code, numbers and quotes from its docs. Some lessons have a live demo you can poke at.
  3. Steal this: the idea in one paragraph you can take to your own code.
  4. Use it in your code: a prompt you paste into your coding agent. It checks whether the idea fits your repo before it changes anything.
  5. Read the source: links to the exact files the lesson is based on, so you can check my work.

Each codebase ends with power-user tips for actually using the tool.

OpenCode (new)

anomalyco/opencode, the open-source coding agent (these lessons are from its upcoming v2). A durable prompt inbox, a system prompt that never gets rewritten, bounded tool output, compaction before overflow, and more, from a rewrite still in progress.

Pi

earendil-works/pi, the minimal, extensible agent harness. A core that lets you replace its own features, import budgets, append-only session trees, an edit tool built for sloppy models, and more.

T3 Code

pingdotgg/t3code, the open-source GUI for coding agents. Architecture, performance budgets as tests, testing without sleeps, a PR process for the AI era, lint rules as taste, and more.

share Post on X