ccc
ContextCodeCache generator for AI coding agents
TLDR
SYNOPSIS
ccc scan [PATH] [--tokens]ccc check [PATH] [--format json]ccc tokenize [PATH]ccc install [--dir DIR] [--force]
DESCRIPTION
ccc scans a source tree and produces a compact, machine-readable `.ccc/` directory containing per-file summaries: constants, functions (with types and doc summaries), call-graph edges inside the file, and marker comments (TODO, FIXME, etc.).The cache is designed to be committed and consumed by AI agents so they have a cheap, always-fresh structural index instead of repeatedly grepping or re-reading source.Supported languages: Rust, Python, JavaScript, TypeScript (+ TSX), and Go (via tree-sitter). Unsupported files are skipped; hidden dirs, common build/vendor dirs, and `.gitignore` rules are honored.
PARAMETERS
scan [PATH]
Regenerate the `.ccc` directory for the given path (defaults to current directory).--tokens
Also emit a pre-encoded token stream (`tokens.bin` + `tokens.json`) for models that can consume raw token IDs.check [PATH]
Exit non-zero if the on-disk cache is stale relative to current sources. Useful in CI.--format json
Machine-readable output listing changed files (`{ root, uptodate, files[], changes[] }`).tokenize [PATH]
Pre-encode an existing `.ccc` into `tokens.bin` + `tokens.json` without a full rescan.install [--dir DIR] [--force]
Copy the running binary onto your PATH (Linux). Default dir: `~/.local/bin`.
INSTALL
Requires Rust ≥ 1.77 and a recent cargo:
./target/release/ccc install
CAVEATS
The token stream uses approximate tiktoken IDs (OpenAI vocabulary, e.g. `o200k_base`) and is not compatible with Anthropic models. Use the Markdown form of the cache with Claude.Regenerate the cache whenever source files that affect the index change. A CI step of `ccc check .` fails the build if the cache is out of date.
