ContextSniper: AntTrail's Token-Efficient Code Memory for Repository-Level Program Repair
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large language model agents can repair real repository issues, but they often spend large context budgets on whole-file reads, broad searches, and long terminal outputs where useful evidence is mixed with irrelevant code and logs. This paper presents ContextSniper, AntTrail's code-repair module for precision evidence selection in repository-level program repair, as part of AntTrail's broader agent-memory engine. AntTrail is available at https://gitcode.com/datagallery/AntTrail. ContextSniper indexes code and action memory at three levels of abstraction, retrieves candidates with a hybrid ranker, filters long tool output through an intention-aware context gate, and returns compact evidence packets while keeping full source recoverable on demand. In matched 50-task-per-condition comparisons, ContextSniper reduces total token use by 51.5% and logged cost by 36.4% for OpenClaw on SWE-bench Lite, and reduces total token use by 40.0% and average interaction rounds by 28.1% for OpenCode on SWE-bench Pro. Submitted-resolution rates differ by one task out of 50 in each host-agent setting. In a separate five-task comparison, ContextSniper outperforms existing memory- and retrieval-augmented generation (RAG)-style integrations in token efficiency. These results suggest that ContextSniper can substantially reduce token and interaction overhead for repository-level repair agents without a measurable loss in repair quality. The evaluation harness is available at https://gitcode.com/lukchiwang/ContextSniper.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 20 of its 39 references that are in the map. First posted on arXiv 2 Jul 2026.
Builds on
20 of 39 references.
Closest ancestors · 5
Same direction, newest first
- 2026Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP28 Mar
- 2026Learning to Commit: Generating Organic Pull Requests via Online Repository Memory27 Mar
- 2026Structurally Aligned Subtask-Level Memory for Software Engineering Agents25 Feb
- 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
Other references · 15
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 279
- 2024AutoCodeRover: Autonomous Program Improvementcited by 272
- 2023RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentationcited by 253
- 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 185
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 126
- 2024RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graphcited by 88
- 2024CompAct: Compressing Retrieved Documents Actively for Question Answeringcited by 64
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 64
- 2025EXPEREPAIR: Dual-Memory Enhanced LLM-based Repository-Level Program Repaircited by 34
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2026AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair
- 2025REFINE: Enhancing Program Repair Agents through Context-Aware Patch Refinement
- 2026MemRepair: Hierarchical Memory for Agentic Repository-Level Vulnerability Repair
- 2026EviACT: An Evidence-to-Action Framework for Agentic Program Repair
- 2025HAFixAgent: History-Aware Program Repair Agent
- 2026ARISE: A Repository-level Graph Representation and Toolset for Agentic Program Repair and Fault Localization
- 2026MemTrace: State-Consistent Memory for Long-Horizon Coding Agents
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation