SuperAPI AI Directory

repocontext

AST-based codebase map, token compression and context packaging for AI coding agents and IDEs.

Open website

About this tool

RepoContext is a next-generation AST codebase map, token compression, and context packaging engine for AI coding assistants and IDEs. Its goal is to solve three key bottlenecks developers face when feeding a codebase into modern AI coding assistants (such as Claude Code, Cursor, Windsurf, OpenAI Codex, Antigravity, Cline): token explosion and high API costs, a low signal-to-noise ratio, and security leaks.

In terms of use, RepoContext is used for intelligent AST outline pruning of a codebase, task-oriented semantic file ranking, automatic credential redaction, and native Model Context Protocol (MCP) integration. It helps AI coding assistants obtain more refined and more relevant code information within a limited context window, while reducing API costs and reducing the risk of sensitive information leakage.

Main capabilities include: AST codebase map and skeletonization, which can compress source files by 70% to 85% while retaining 100% of interfaces, types, functions, and JSDoc/docstrings; task-oriented relevance pruning, which automatically ranks and packages only the most critical files by passing in a prompt query (for example, repocontext pack -q "Fix JWT auth token expiry"); automatic secret scanning and redaction, with built-in entropy and regex scanners that can detect and mask OpenAI keys, GitHub tokens, AWS keys, JWTs, and database URIs; a native Model Context Protocol (MCP) server, which can be integrated directly with Claude Desktop, Cursor, Windsurf, and Antigravity through standard MCP tools; multi-format export, which can generate clean Markdown with a directory tree, Claude-optimized XML (<documents>), or structured JSON; multi-model token and cost analysis, providing a real-time token counter and estimating costs for GPT-4o, GPT-5, Claude 3.5 Sonnet, and Gemini 1.5 Pro.

In terms of usage, RepoContext supports installation-free running via npx, and also supports global installation. The CLI provides the pack command and corresponding options. For MCP integration,RepoContext can be added to claude_desktop_config.json or the MCP settings of Cursor/Windsurf. The MCP tools it exposes form a four-layer context pyramid: get_codebase_map extracts a token-efficient AST symbol outline map of the entire repository (saving about 80% of tokens); extract_relevant_context uses semantic ranking to prune the codebase and return files relevant to the task prompt; read_file_outline reads the compressed AST skeleton of a single file (signatures and docstrings); read_file_content performs precise source code reading, supports optional line-range slicing (startLine / endLine), and performs automatic credential masking.

Applicable scenarios include: when feeding a large codebase into an AI coding assistant or IDE, needing to control token usage and API costs; needing to make the AI focus on the semantic API surface such as interfaces, types, and function signatures rather than routine implementation details; needing to automatically detect and redact .env credentials, API keys, and database URIs when packaging context; and workflows that need to integrate with tools such as Claude Desktop, Cursor, Windsurf, and Antigravity through MCP.

Regarding limitations, the materials do not provide specific performance benchmark data, the range of supported programming languages, system requirements, or detailed descriptions of known limitations. The project uses the MIT license, and contributions, issues, and feature requests are welcome.