International Journal of Scientific Research and Engineering Development

International Journal of Scientific Research and Engineering Development


( International Peer Reviewed Open Access Journal ) ISSN [ Online ] : 2581 - 7175
Submit Your Manuscript OnlineIJSRED

CG-CLI: Graph-Guided Context Optimization for AI Coding Agents


πŸ“‘ Paper Information
πŸ“‘ Paper Title CG-CLI: Graph-Guided Context Optimization for AI Coding Agents
πŸ‘€ Authors Husna Ansari, Maya Nair
πŸ“˜ Published Issue Volume 9 Issue 5
πŸ“… Year of Publication 2026
πŸ†” Unique Identification Number IJSRED-V9I5P212
πŸ“ Abstract
Large language models used for software engineering often require repository context distributed across files, functions, tests, configuration, and dependency paths. Supplying broad code context can increase input overhead, whereas aggressive reduction can omit relevant evidence. This paper presents CG-CLI, a local and model-agnostic command-line framework for graph-guided context optimization in JavaScript and TypeScript repositories. The system constructs a lightweight structural code graph, identifies seed nodes from a developer question, expands through statically detected relationships, and extracts compact source slices. A controlled benchmark of 150 cases across 10 locally maintained fixture projects and 15 task categories evaluates retrieval recall and context reduction against a controlled whole-file baseline. The primary one-hop configuration achieved 66.4% average retrieval recall with 16.2% average context reduction. Two-hop expansion improved recall to 75.1% but exceeded the baseline context by 2.8%, demonstrating a recall–context trade-off. CG-CLI also includes a local visualization dashboard and an optional structured response protocol for manual response-length comparison. The work is a retrieval and context-selection layer; it does not control external AI-agent tool loops or guarantee answer correctness.
πŸ“ How to Cite
Husna Ansari, Maya Nair, "CG-CLI: Graph-Guided Context Optimization for AI Coding Agents" International Journal of Scientific Research and Engineering Development, V9(5): Page(1556-1561) September - October 2026. ISSN: 2581-7175. www.ijsred.com. Published by Scientific and Academic Research Publishing.