CodeWiki Uses Recursive Agents to Generate Docs for Million-Line Codebases
Repository-level documentation has been a manual, neglected chore for decades. A system that can produce architecturally coherent docs for million-line codebases — and back its quality claims with a peer-reviewed benchmark — changes the calculus for teams deciding whether documentation is worth the effort.
CodeWiki, from FPT Software's AI4Code team, tackles repository-level documentation with a three-stage pipeline: Tree-sitter AST parsing builds a dependency graph, topological sorting determines processing order, and a recursive multi-agent system generates docs from the bottom up. When a module exceeds context limits, the system spawns child agents that document sub-modules independently before a parent agent aggregates the results. Output includes Markdown files with Mermaid architecture, data-flow, and sequence diagrams.
The project ships with CodeWikiBench, a benchmark that evaluates documentation quality using multiple judge models making binary pass/fail decisions on leaf-node criteria, avoiding the pitfalls of BLEU/ROUGE for this task. CodeWiki scores 68.79%, ahead of Cognition AI's closed-source DeepWiki (64.06%) and the open-source deepwiki-open (50.05%).
An incremental update mode regenerates only changed modules, and the CLI supports OpenAI, Anthropic, AWS Bedrock, and subscription-based providers like Claude Code that require no API key. The main limitation is weaker performance on C and C++ compared to Python, JavaScript, and TypeScript.
The gap between CodeWiki's benchmark score (68.79%) and its star count (1.5k) versus deepwiki-open's score (50.05%) and star count (17.1k) suggests that in developer tools, deployment ease and community momentum currently outweigh raw quality in adoption.
CodeWikiBench's design — binary leaf-node judgments from multiple models with weighted upward aggregation — sidesteps the well-known problem that BLEU/ROUGE reward verbosity over precision, and could serve as a template for evaluating other structured-generation tasks.
The recursive agent architecture is a practical answer to the context-window problem that doesn't require waiting for larger context windows; it trades latency and API cost for completeness, which is the right trade for a batch documentation task.
ACL 2026 acceptance gives the approach academic credibility, but the real signal for production use is the incremental update feature — documentation that rots slower than the codebase is what teams actually need.