A lightweight context-economy tooling hub for AI-assisted software development. This repository serves as a canonical distribution center and shared configuration point for context compression, code reuse guidance, and token optimization tools.
-
headroom— Compresses large tool outputs, build logs, and git diffs before they enter model context (typically yielding 60–90% token savings). -
ponytail-mcp— A structured code-reuse guidance tool (evaluates YAGNI$\rightarrow$ existing repo code$\rightarrow$ standard library$\rightarrow$ dependencies$\rightarrow$ one-liner$\rightarrow$ custom code). -
rtk(Rust Token Killer) — A high-performance CLI utility that prefixes and compresses verbose shell command output for token-efficient agent interactions.
This repository operates as a central tooling hub across multiple projects:
- Shared Disk Installation: Hosts
.data/as a central, gitignored staging area for tool binaries and dependencies, avoiding gigabytes of duplicate local installs. - Canonical
.mcp.json: Offers a ready-to-use Model Context Protocol configuration that sister projects or IDEs can copy or reference directly.
Note
There is no runnable web app in this repository. It is a configuration, installation, and coordination hub for agent context-economy tooling.
- Node.js (v18.0.0 or higher)
- Git
- An MCP-compatible agent or IDE (Claude Code, Claude Desktop, Cursor, Windsurf, VS Code with Continue or Roo Code)
# 1. Clone the repository
git clone https://github.com/atifkhan-583/Repo-Intelligence.git
cd Repo-Intelligence
# 2. Run the automated setup script
npm run setupThe npm run setup script automatically:
- Creates required directory structures in
.data/ - Validates
.mcp.jsonconfiguration - Clones and builds
ponytail-mcpif missing - Checks availability of
headroomandrtkexecutables
# Copy canonical configuration into your workspace
cp .mcp.json /path/to/your/project/For detailed setup instructions across Claude Desktop, Cursor, Windsurf, Claude Code CLI, and VS Code, see the Friends & Team Onboarding Guide (SHARING_GUIDE.md).
Invoke Ponytail to evaluate whether writing new code is truly necessary:
- MCP Prompt:
ponytail - MCP Tool:
ponytail_instructions
Question Hierarchy:
- Does this need to exist? (YAGNI principle)
- Can we reuse existing code in this codebase?
- Is this available in the language standard library?
- Should this be an established third-party dependency?
- Can this be implemented cleanly in a single line?
- Only then: Write custom code.
Compress large CLI outputs or diffs before feeding them to an AI model:
# One-off command compression
headroom wrap claude -- git diff
headroom wrap claude -- grep pattern .
# Start local proxy server (optional, manual start)
headroom proxy --port 8787Prefix shell commands to strip noise and compress output:
# Wraps common CLI commands for reduced token footprint
rtk git status
rtk pytest --verbose
rtk grep "function" src/
# Analytics & Diagnostics
rtk gain # Display total token savings analytics
rtk gain --history # View historical command usage breakdown
rtk discover # Analyze agent history for optimization opportunitiesrepo-intelligence/
├── .data/ # Central tool installation & caches (gitignored)
│ ├── headroom/ # Headroom binaries & workspace cache
│ ├── ponytail-tool/ # ponytail-mcp source & modules
│ └── rtk/ # rtk binary & configuration rules
├── .mcp.json # Canonical MCP server configuration
├── setup.js # Cross-platform automated setup script
├── package.json # Node dependencies & npm scripts
├── START_HERE.txt # Quick documentation navigation index
├── README.md # Project overview & quick start
├── SHARING_GUIDE.md # Onboarding & IDE integration guide
├── CLAUDE.md # Developer & agent integration notes
├── ARCHITECTURE.md # In-depth system design & data flows
├── TECHNICAL_DEBT.md # Known limitations & improvement backlog
├── CHANGELOG.md # Release notes & migration guides
└── ADR/ # Architecture Decision Records
├── README.md # ADR process & index
├── 0001-retire-graphify-mcp.md
└── 0002-canonical-mcp-distribution.md
The following environment variables control local tool behavior (configured in .mcp.json):
| Variable | Description | Default Path / Value |
|---|---|---|
HEADROOM_WORKSPACE_DIR |
Directory for Headroom cached output | ./.data/headroom/workspace |
HF_HOME |
Hugging Face cache location | ./.data/headroom/hf-cache |
XDG_CONFIG_HOME |
Ponytail configuration path | ./.data/ponytail-tool/config |
PONYTAIL_DEFAULT_MODE |
Ponytail analysis intensity (full or lite) |
full |
- Verify RTK installation:
where rtk(Windows) orwhich rtk(Linux/macOS). - Ensure
.data/rtk/bin/is included in your systemPATH.
- Headroom proxy does not autostart in background. Start manually when desired:
headroom proxy --port 8787. - MCP stdio integration works independently of proxy mode.
- Verify Node.js version (
$\ge 18.0.0$ ):node --version. - Confirm
.data/ponytail-tool/repo/ponytail-mcp/index.jsexists. - Re-run setup:
npm run setup.
- 🚀 Sharing & Onboarding Guide
- 📘 System Architecture
- 📋 Technical Debt & Backlog
- 📜 Changelog
- 📑 Architecture Decision Records
This repository is licensed under the MIT License.