Description
Repomix already does something structural that I love: --compress uses Tree-sitter to shrink files down to their signatures. This issue is about the natural next step beyond shrinking content, which is selecting the right content.
The problem: when I'm working on fileA.ts, the context an LLM actually needs is fileA plus the things it calls and imports (its dependency cone), not the whole repo, and not just compressed signatures of unrelated files. Today there's no way to say "pack this file and everything it depends on within N hops."
The idea: graph-aware context selection.
repomix --include "src/auth.ts" --graph --hops 2
# β packs auth.ts + every entity it calls/imports within 2 hops,
# across files, and nothing irrelevant
This needs a cross-file call graph + import graph at the entity (function/class/method) level, then a bounded BFS from the seed files. It composes perfectly with the existing --compress (select the cone, then compress it). Together that's genuinely minimal, maximally relevant context.
On the engine: I work on sem, an open-source Rust tool that builds exactly this, entity extraction + a deterministic cross-file call/import graph across 32 languages via Tree-sitter, with hop-bounded queries already implemented (sem context --hops N). It could potentially power this for Repomix (as a library or a subprocess), so you wouldn't have to build/maintain the graph layer yourselves. Happy to prototype it if the direction is interesting.
Mostly I wanted to float the idea. Graph-aware selection feels like the logical evolution of what --compress started, and it's the number-one thing I'd want when packing context for a model. Curious whether it fits your roadmap.
Also just on a side note: can't help but compliment that your dog is cute.
Description
Repomix already does something structural that I love:
--compressuses Tree-sitter to shrink files down to their signatures. This issue is about the natural next step beyond shrinking content, which is selecting the right content.The problem: when I'm working on
fileA.ts, the context an LLM actually needs isfileAplus the things it calls and imports (its dependency cone), not the whole repo, and not just compressed signatures of unrelated files. Today there's no way to say "pack this file and everything it depends on within N hops."The idea: graph-aware context selection.
This needs a cross-file call graph + import graph at the entity (function/class/method) level, then a bounded BFS from the seed files. It composes perfectly with the existing
--compress(select the cone, then compress it). Together that's genuinely minimal, maximally relevant context.On the engine: I work on sem, an open-source Rust tool that builds exactly this, entity extraction + a deterministic cross-file call/import graph across 32 languages via Tree-sitter, with hop-bounded queries already implemented (
sem context --hops N). It could potentially power this for Repomix (as a library or a subprocess), so you wouldn't have to build/maintain the graph layer yourselves. Happy to prototype it if the direction is interesting.Mostly I wanted to float the idea. Graph-aware selection feels like the logical evolution of what
--compressstarted, and it's the number-one thing I'd want when packing context for a model. Curious whether it fits your roadmap.Also just on a side note: can't help but compliment that your dog is cute.