Most AI-generated documentation is a waste of space.
It tells you what the code does (e.g., "This function is a POST request"), which any competent agent can already see. It doesn't tell the agent why you made certain choices.
I was working in a massive Laravel monorepo (230+ fragmented doc files). Every time I asked Claude Code or Cursor to do a task, it burned thousands of tokens just trying to understand the basic architecture and legacy gotchas.
The Solution: code-wiki
I realized that to make agents efficient, they need Agent-Optimized Context—surgical, high-density rationale, not bloated summaries.
I built code-wiki. It’s an agentic workflow consisting of 3 skills that create and maintain a rationale-focused wiki:
/wiki-init: Scaffolds a zero-infra Markdown structure (2 mins).
/wiki-bootstrap: The agent reads your code and then interviews you for 15 minutes about architectural decisions, gotchas, and tech debt.
/wiki-lint: Ensures your docs never "rot" as the code evolves.
The Result: -90% Token Usage ⭐
By consolidating fragmented tribal knowledge into this structured wiki, I slashed my agent's doc-reading tokens by ~90% per task. The agent stopped "grepping" the entire repo and started "knowing" the answer immediately.
It’s zero infrastructure: no vector DB, no extra SaaS, no new API keys. Just Markdown files in your repo that your agent can read. It works with Claude Code, Cursor, Gemini CLI, or any agent with file access.
Show Your Support!
I’ve open-sourced code-wiki to help developers fight the "Context Tax." If this approach to documentation makes sense to you, please consider supporting the project by starring the repo. Your star helps other developers discover the tool.
Top comments (0)