CaveCode is a source-understanding tool for C and C++ codebases. It parses real source files and produces compact, structured summaries of function behavior: guards, branches, returns, calls, scalar state, field reads/writes, loops, switches, and unresolved control-flow regions.
It is designed for both coders/engineers/developers and embedded systems engineers, as well as LLM coding agents. The idea is that the user can quickly and easily understand unfamiliar and large C or C++ code bases. CaveCode gives a first-read map of a file or project so you know where the important logic, exits, side effects, and uncertainty are before making changes.
Additionally, when used with LLM's,CaveCode gives an extremely compact, but legible & digestible, source-backed understanding layer for C/C++ code, which both drastically reduces token count and context window blow outs (common in C code reads). As an example, in a real (and extremely complicated) Buffer subsystem of one of my projects, `scan-project --brief` reduced ~124k estimated raw-source tokens to ~8.8k tokens, a ~93% reduction, while still surfacing the highest-risk functions, guards, calls, and outcomes.
CaveCode uses a generic Tree-sitter backend and a domain-neutral fact/regime pipeline. This makes it useful both as a standalone developer tool and as infrastructure for AI-assisted code archaeology, refactoring, and safety checks.
Core features:
- - Per-function summaries for C/C++ files
- - Guard and early-return detection
- - Scalar dataflow at return points
- - Struct field read/write auditing
- - Enum and struct inventory
- - Cross-file call indexing
- - Dead helper detection
- - Format-string audits
- - Compact explanation mode for large functions
- - JSON output for programmatic use
- Cavecode is released as open source on GitHub, with a permissive license for both personal and commercial use. Distributed as a CLI tool, the source code and documentation is available for anyone to explore, modify, and contribute to. Contributions for additional features, language support, or integrations are welcome on the GitHub repository.