EGN Labs

ContextSniper - Smart task-driven LLM context optimizer

byโ€ข
Contribute to egn-labs-dev/ContextSniper development by creating an account on GitStop dumping your entire codebase into Claude or ChatGPT. ContextSniper is a 100% local CLI tool that uses the BM25 algorithm and dependency graphs to extract ONLY the relevant files for your prompt. If the code exceeds your token budget, it automatically strips files down to class and method signatures. Save money, reduce API bills, and fix the "Lost in the Middle" effect in under 250ms.Hub.

Add a comment

Replies

Best
EGN Labs
Maker
๐Ÿ“Œ
Hey ProductHunt community! ๐Ÿ‘‹ As a developer working with LLMs daily, I noticed a huge issue: dumping an entire repository into Claude or ChatGPT Canvas ruins the model's accuracy due to the 'Lost in the Middle' effect, and it completely drains your token budget. Standard tools act like dumpsters โ€” they just pack everything. I wanted a scalpel. Thatโ€™s why I built ContextSniper. It runs 100% locally, parses your import chains to build a dependency graph, and uses BM25 scoring to extract only the files needed for your specific task (e.g., npx context-sniper "fix auth middleware"). If the code exceeds your budget, it automatically strips files down to class/method signatures so you never overflow your limits. It's fully open-source and ready to run via npm. Would love to hear your feedback!