cx  by ind-igo

Semantic code navigation for AI agents

Created 2 months ago
259 stars

Top 97.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

cx addresses the inefficiency of AI agents consuming excessive context window tokens and execution time when navigating codebases. It provides semantic code navigation capabilities—including file overviews, symbol searching, definition lookups, and reference finding—without the overhead of traditional language servers. This enables AI agents to interact with code more efficiently, reducing token costs and improving response times for developers.

How It Works

cx leverages Tree-sitter for robust, language-aware parsing of source files, building an index of symbols, signatures, and code locations. Unlike Language Server Protocols (LSPs) designed for human editors, cx is optimized for agent access patterns, avoiding persistent daemons, high memory footprints, and complex project setup. It offers a tiered query system, starting with low-cost overview commands and escalating to more detailed definition or references queries only when necessary, significantly reducing token expenditure and read operations.

Quick Start & Requirements

  • Installation: Available via Homebrew (brew install cx), Cargo (cargo install cx-cli), a shell script (curl ... | sh), or PowerShell (irm ... | iex) on Windows.
  • Prerequisites: Requires installing language-specific grammars via cx lang add <language> (e.g., rust, typescript, python). Grammars are downloaded on demand.
  • Agent Integration: The cx skill command generates prompts to integrate cx into AI agent instruction files, teaching them to prefer cx over raw file reads.
  • Links: GitHub Repository (implied by name/path).

Highlighted Details

  • Agent Efficiency: Demonstrated 58% reduction in Read calls and 40-55% fewer tokens spent on code navigation in AI agent sessions.
  • Semantic Navigation: Provides precise, AST-based code understanding, differentiating it from text-based tools like ripgrep.
  • LSP Alternative: Offers core LSP features (go-to-definition, find references) without the associated daemon, compilation, or setup overhead.
  • On-Demand Grammars: Language support is added dynamically via Tree-sitter, minimizing build dependencies.
  • Structured Output: Utilizes a token-efficient format (TOON) for most outputs, with JSON support available.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or project roadmap were found in the provided text.

Licensing & Compatibility

The license type and compatibility for commercial or closed-source use are not specified in the provided text.

Limitations & Caveats

The project includes a disclaimer "Built with AI," suggesting potential quality variations or bugs inherent in AI-generated code. Users must explicitly install necessary language grammars. Indexing occurs on first invocation, which may incur an initial time cost. Operation in sandboxed environments may require configuration of the cache directory (CX_CACHE_DIR). Default pagination limits apply to certain commands, necessitating the use of offset or limit flags for full results.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
20 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.