Stop guessing
which files matter.
ContextForge scans your repository, scores every file by relevance to your task, and outputs a token-efficient context bundle. One command. No API keys. Runs locally.
Roadmap
Shipping fast. Staying focused.
Four phases over one month. Community feedback shapes every milestone.
Core
- Repo scanner with gitignore
- Keyword relevance scoring
- Token budget enforcement
- Output to stdout / clipboard / file
Intelligence
- Import graph analysis
- Git-aware context
- AST-aware compression
- Interactive terminal UI
Extensibility
- Profile system
- Plugin architecture
- Multi-language AST
- Config file support
Polish
- VitePress docs site
- VS Code extension
- GitHub Actions integration
- v1.0.0 release
The problem
Every AI coding session starts with the same friction.
You need AI help with a task. So you start copying files. One by one. Guessing which ones are relevant. Hoping you stay within the token limit.
Manual file hunting
Digging through your repo, guessing which files matter, copy-pasting them one by one into your prompt.
Wasted tokens
Sending irrelevant code that blows past limits, costing money and degrading your AI assistant's response quality.
No standardization
Every developer builds context differently. No shared process for how teams structure context for AI tools.
The solution
One command. Done.
Describe your task in plain English. ContextForge indexes your repo, scores every file, compresses to fit your token budget, and outputs a ready-to-use context bundle.
Your Task
Plain English description
Index
Scan repo & build graph
Rank
Score files by relevance
Compress
AST-aware trimming
Output
Clipboard, file, or pipe
How it works
Three commands to try it out.
No accounts. No API keys. No cloud. Everything runs on your machine.
Install globally
Install the beta version to start building locally.
Index your repo
Scans your codebase, builds a dependency graph, and caches the index.
Build context
Describe your task. Get a token-optimized bundle, ready to paste.
Core features
Everything you need. Nothing you don't.
Built for developers who use AI assistants daily.
Relevance Engine
Ranks every file using keyword matching, import graph proximity, git recency, and file type heuristics.
Token Budget
Auto-compresses context with AST-aware trimming. Strips comments, extracts signatures, or summarizes — always within your limit.
Output Modes
Print to stdout, copy to clipboard, save to file, output as JSON, or pipe to another command.
Interactive Mode
Preview included files, toggle them on or off, and watch the token counter update in real time.
Git-Aware
Build context from your current diff, staged files, or a specific commit hash.
Plugin System
Extend with custom relevance scorers, output formatters, and file parsers.
CLI examples
Built for the terminal.
Composable commands for any workflow.
Architecture
Built with proven tools. No unnecessary abstractions.
TypeScript from top to bottom. Every module is focused, testable, and replaceable.
- Recursive scanner that respects .gitignore
- In-memory dependency graph from imports
- AST-aware compression via tree-sitter
- Cached index for sub-second rebuilds
- Plugin loader with sandboxed execution
Tech stack
Open source
Open source. Forever free.
ContextForge is MIT licensed. No telemetry, no accounts, no data collection. Read the code, contribute features, or fork it for your own workflow.
FAQ
Common questions.
No. ContextForge prepares context for you to use with any AI assistant — Claude, GPT-4, Gemini, or anything else. It never makes API calls. All processing runs locally.
No. Everything runs locally on your machine. No telemetry, no accounts, no cloud, no data collection. Your code never leaves your machine.
JavaScript, TypeScript, and Python are supported out of the box with full AST-aware compression. Go, Rust, and Java support is planned for Phase 3. Basic keyword relevance works with any text file.
It combines five signals: keyword matching, import graph proximity, git recency, file type weighting, and directory heuristics. Each signal contributes to a composite relevance score per file.
Yes. Commit .contextforge.config.json to your repository. Team members run cf scan after cloning, and everyone shares the same profiles, ignore rules, and settings.
Coming soon
Ready to build better context?
Install ContextForge and go from task to token-optimized context in seconds.