Rohit Madas

Mar 15, 2026 • 1 min read

ctxpilot - how I built a universal context layer for AI coding tools

ctxpilot - how I built a universal context layer for AI coding tools

The problem I kept running into

Every AI coding session starts blank. You re-explain your stack,

your current goals, your conventions. Across every tool — Cursor,

Claude Code, Codex, Windsurf. Every single time.

I built ctxpilot to fix this.


What I shipped

ctxpilot is a CLI and MCP server that automatically builds a

Living Context Document from your codebase and injects it into

every AI tool you use. A background daemon keeps it fresh after

every git commit.

Three commands to set up:

npm install -g @ctxpilot/ctxpilot

ctx init

ctx setup

ctx watch


The build process

Built the entire thing in about a week using Claude Code and

Codex as coding assistants. Started with a detailed MASTERPLAN.md

before writing a single line of code — architecture, tech stack,

command spec, AI prompts, everything.

Key technical decisions:

- MCP protocol for distribution — works with any MCP-compatible

client without custom integrations

- AI rewrite instead of bullet append — Claude rewrites the entire

LCD on every update, not just stacks new information

- Daemon watches .git/refs/heads/ — detects commits without

requiring git hooks

- Archive-first policy — nothing ever deleted, only archived to

.ctxpilot/archive/


The result

Tested on a private React Native project. Fresh Codex session,

zero context pasted. Asked what the project was about.

Codex identified an exact bug — minimum cart quantity hardcoded

in multiple places with Math.max(quantity, 6) in cart.ts#L40.

That came from the LCD.


Links

GitHub: github.com/fewknowme/ctxpilot

Website: fewknowme.github.io/ctxpilot

npm: @ctxpilot/ctxpilot

Open source, MIT. Feedback and PRs welcome.

Join Rohit on Peerlist!

Join amazing folks like Rohit and thousands of other builders on Peerlist.

peerlist.io/

It’s available... this username is available! 😃

Claim your username before it's too late!

This username is already taken, you’re a little late.😐

1

4

0