Contexter is a universal documentation packer for software repositories.
It creates a single Markdown file (contexter/pack/CONTEXTPACK.md) that contains:
- Front-matter: commit, branch, token budget, generation time.
- Summary: file count, tokens, truncation.
- Dependency Graph: clean edges like
fileA.py -> fileB.py (import|http|db|queue). - Files: per-file anchors (
# Lx–Ly) with code fences. - Metrics/Notes: token usage, freshness, missing deps (warn), next steps.
This gives Codex or any LLM agent a compact, navigable, safe context of your repo — without ever editing source code.
- Context bloat: pasting entire repos into an LLM blows token budgets.
- Hallucinations: models guess repo-specific facts and get them wrong.
- Unsafe edits: without guardrails, agents might touch code they shouldn’t.
Contexter fixes this by:
- Packing the repo into a single LLM-friendly Markdown file.
- Guarding against edits outside
/contexter/,.contexter/,PLAN.md,CONTEXTER.yaml. - Using abstention > guessing: when Codex is unsure, it stops and writes QUESTIONS to
PLAN.md.
The easiest way is to start your Codex session with this message:
Plan mode. Read https://raw.githubusercontent.com/agora/contexter/refs/heads/main/getting-started.md
and follow its steps to bootstrap Contexter in this repo.
Never edit source code; only write to PLAN.md and contexter/.
When unsure, prepend QUESTIONS to PLAN.md and stop.
Codex will:
- Fetch the getting-started.md instructions.
- Plan safe bootstrap steps in
PLAN.md(downloadctx.py,CONTEXTER.yaml, etc.). - Ask QUESTIONS if anything is unclear.
- Leave your repo source untouched.
-
After code changes:
python3 ctx.py run
-
Codex kickoff message (no IDE required):
Plan mode. Use contexter/pack/CONTEXTPACK.md as the context of truth. Never edit source code; only write to PLAN.md and contexter/. Propose the next 3–5 atomic, verifiable steps with acceptance checks. If unsure, add QUESTIONS to PLAN.md and stop. -
Codex appends PROGRESS/DECISIONS/NEXT to
PLAN.md. -
If blocked, Codex writes QUESTIONS to
PLAN.mdand pauses.
-
Add links in
CONTEXTER.yaml:links: repos: - name: frontend pack_uri: ../frontend/contexter/pack/CONTEXTPACK.md
-
Build the hub graph:
python3 ctx.py hub build
→ Writes
contexter/hub/graph.mdwith cross-repo edges.
- No-code-edits guard: any attempt to change source code is blocked.
- Secret scrub: common keys/tokens redacted in packs.
- Dep sanity: “warn” mode by default — issues logged in METRICS but won’t block you.
MIT © Gudjon Mar Gudjonsson