ContextOS is a locally run command-line tool designed to reduce the amount of repository context that developers send to AI coding assistants such as Claude or ChatGPT. The tool scans an entire codebase, ranks files by relevance to a specific task, and generates a “context pack” in formats intended for different AI tools. According to the reports, it can automatically redact secrets and avoids cloud use or account requirements.
In a described test using the FastAPI repository (2,811 files), the author says the context size drops from about 284,000 tokens when sending the full repo to about 7,998 tokens using ContextOS (15 files), reporting an estimated 97% reduction. The ranking approach combines multiple signals, including keyword overlap with the task description, import graph centrality, AST-based symbol overlap (function/class names), and a git churn score that prioritizes recently modified files. The tool also supports an MCP server mode so Claude Desktop/Code can call it via tools such as scan/pack and file retrieval, using stdio. The project is described as Apache-2.0 licensed and includes an incremental scan cache to re-scan only changed files.