Optional entity-level packing (functions/classes) to cut tokens
Repomix is great for feeding a codebase to an LLM. One cost center is packing full file contents: for many tasks the model mostly needs a structured map of the code's entities (functions, classes, methods) plus only the relevant bodies, which is far cheaper in tokens.
Proposal: an optional entity-map mode that emits a compact, language-aware outline of each file's entities (optionally only the entities relevant to a diff or query), alongside or instead of raw file dumps.
This could be powered by sem, an open-source (MIT/Apache) entity-level code tool. It parses functions/classes/methods across 26 languages via tree-sitter and outputs JSON: sem entities <path> --json, sem diff --patch --format json, sem graph --json. Another tool, plannotator, already integrates this exact CLI/JSON contract.
I maintain sem and would be glad to prototype this as a PR if it's of interest. Would an entity-level mode fit the roadmap?
Source: yamadashy/repomix