The .env.example for Your AI Coding Sessions
2026-03-13
Every developer knows .env.example. It’s not configuration — it’s orientation. It tells the next person (or future you) what variables matter, what shape they take, and where to start. It’s the minimum viable context for getting up and running.
I’ve been thinking about that pattern a lot lately as I spend more time working with AI coding agents like Claude Code and OpenAI Codex. And I’ve noticed a gap that nobody seems to be talking about directly.
The Cold Start Problem
When you open a new agent session, the agent knows nothing about you. It doesn’t know which projects you’re juggling, how they relate to each other, what conventions you’ve adopted, or where the important docs live. Every session starts cold.
The common workarounds are unsatisfying. You either spend the first few minutes re-orienting the agent through conversation — burning tokens and attention on setup instead of the actual work — or you paste in context manually, which is tedious and inconsistent. Some people write elaborate CLAUDE.md files by hand and keep them updated, which works but doesn’t scale across a multi-repo workspace.
The deeper issue is that the context you need at session start is almost never the same as the context you need to actually do the work. You need just enough to orient — not everything.
What Good Context Actually Looks Like
Think about how you’d brief a skilled contractor joining your team for a day. You wouldn’t hand them the entire codebase. You’d give them a quick rundown of the active projects, point them at the relevant docs, and tell them where to look if they need to go deeper. Maybe two minutes of orientation, then they’re unblocked.
That’s the shape of useful agent context:
- A one-paragraph summary of each relevant project
- Key facts: language, entry points, what it does
- A map to deeper docs if needed
- Nothing else
The agent can read a file when it needs more. What it can’t do is manufacture knowledge it was never given.
Three Layers, One File
The approach I’ve landed on structures context into three layers, all in a single CONTEXT.md file:
The seed layer is a short block per project — description, language, main entry points. Two to four hundred tokens per project. Always read, always worth it.
The pointer layer is a file map: here’s what deeper docs exist and roughly what each one covers. Also cheap to include, but gives the agent somewhere to go when it needs more than the seed provides.
The on-demand layer is optional extracted docstrings and module-level documentation, appended only for projects where you want that depth. The agent reads this when it decides it’s relevant — not automatically.
The whole thing reads like a .env.example. Here’s what exists, here’s the shape of it, here’s where to look for more.
Introducing cctx
Code Context (cctx) is a small Python CLI that automates the harvest. You define a list of repos — local paths or GitHub URLs — with a depth setting for each, and cctx harvest assembles a fresh CONTEXT.md in seconds. No embedding models. No vector databases. No LLM calls to generate the output. Just fast, deterministic text extraction from the docs you already have.
A cctx.yaml looks like this:
output: CONTEXT.md
global_context: |
These are the active projects in this workspace.
repos:
- name: my-api
path: ~/code/my-api
depth: standard # README + docs/
- name: shared-lib
path: ~/code/shared-lib
depth: full # README + docs/ + docstrings
- name: some-dependency
github: owner/repo
depth: readme
Run cctx harvest, and you get a structured CONTEXT.md that any agent can consume. Wire it into CLAUDE.md for Claude Code, AGENTS.md for Codex — both pointing at the same file. One harvest, every agent in your workspace gets oriented.
Why Not Just Use a Semantic Search Tool?
There are excellent tools for indexing your entire knowledge base and searching it semantically. That’s a genuinely useful capability — but it’s solving a different problem.
Search assumes you don’t know what you’re looking for. Context bootstrap assumes you do know what’s relevant — you just need it already in the window. For a developer who knows their own projects, the latter is almost always the right frame. You don’t need to search for your own codebase. You need the agent to already know it’s there.
cctx is also intentionally simple. The entire dependency chain is click, httpx, pyyaml, watchfiles, and rich. It runs anywhere Python runs, completes in under five seconds, and produces deterministic output. There’s nothing to configure beyond the repos you already know you care about.
The Broader Pattern
What I find interesting about this approach is that it’s less about tooling and more about a discipline: curating the minimum viable context for your agent sessions the same way you’d curate a good README or a clear CLAUDE.md. The tool just automates the curation.
As agents get better at using context efficiently — reading pointers, fetching docs on demand, crawling codebases when they need to — the value of having a well-structured bootstrap file goes up, not down. The agent doesn’t need you to paste everything in. It needs to know where everything lives.
That’s what cctx is for.
Code Context is open source and available now. Install it with pip install cctx or check out the source on GitHub.