Code-Reducer
Hierarchical Map-Reduce Wiki Generator for Local LLMs
Key Features
Hierarchical Map-Reduce Pipeline
Recursively breaks codebase synthesis into structured Map and Reduce phases to document arbitrary repo sizes within strict context limits.
Private & Local LLMs
Zero cloud dependencies or API costs. Leverages local Ollama instances (e.g. ornith:9b, gemma4:26b) to keep code private.
Fully Customizable Prompting
Tailor extraction steps, system prompts, module synthesis blueprints, and file fact consolidation rules directly via .code-reducer.yaml.
Enterprise Security Sandbox
Hardened filesystem guards featuring bottom-up symlink traversal checks, atomic process locking, and TOCTOU-safe atomic file writing.
Fast Incremental Updates
Uses SHA256 file hashing against .metadata.json to only re-process changed files and propagate updates bottom-up through the module tree.
Cache Invalidation
Automatically tracks extraction pipeline schema changes via steps_hash to safely force full documentation regeneration when prompts evolve.
Resource Efficiency & VRAM Footprint
Designed specifically for developer workstations and local GPU acceleration, Code-Reducer operates efficiently within consumer hardware constraints. Operating with a 15,000 token context window (15K) under Ollama, VRAM consumption remains stable at approximately 6.5 GB:

Documentation Index
Explore the documentation guides below to learn more about Code-Reducer's design, configuration, and workflows:
Architecture & Map-Reduce Engine
Deep dive into node prefix trees (DirNode), dynamic file chunking, sub-batch reduction, and global synthesis phases.
Incremental Updates & Caching
Learn how SHA256 state tracking, bottom-up change propagation, and steps_hash invalidation minimize LLM calls.
Security Sandbox & Concurrency
Understand SafeResolve traversal guards, atomic process locking with O_EXCL, and TOCTOU symlink protection.
Configuration & Prompts
Complete reference for .code-reducer.yaml, environment variable overrides, ignore filters, and extraction pipelines.
CLI Commands & Setup Wizard
Guide to setup, init, and update commands, interactive prompts, and terminal execution workflows.
Performance & VRAM Usage
VRAM benchmarking, context window budgeting metrics, multi-pass reduction throughput, and hardware recommendations.
Installation & Building
Step-by-step instructions for building Code-Reducer from source using Go 1.26+, binary installation, and Ollama integration.