Documentation
Complete reference for all ContextDigger features
π Latest features
Multi-strategy sub-area creation
π― Governance
Budget system
π§© Architecture
CLI, API, MCP & VS Code
π¦ Installation
Get started quickly
β‘ Features
5 core feature categories
π» Commands
80 commands
What is ContextDigger?
ContextDigger is context governance infrastructure for AI assisted development. It discovers focus areas in your repo, enforces Context Aperture and Attention Budgets, and maintains governed context bundles that developers and AI tools can reuse across sessions.
It is intentionally designed from the perspective of Autistic Intelligence: we assume that both humans and models are brilliant under the right constraints and fragile under overload. In practice, this means ContextDigger treats context as a scarce resource to be curated and governed, not an infinite window to be filled.
β Works with Your AI Stack
ContextDigger is a CLI first tool that exports governed context bundles for modern assistants like
ChatGPT,
Claude,
Gemini,
Copilot,
Cursor,
Windsurf,
Aider,
Cody,
Codeium,
and others. Run commands in your terminal to create context files, then instruct your AI tool to use
.cdg/context/<area>.txt as the primary source of truth (for example:
βRead .cdg/context/backend-api.txt and apply these changes inside this scope only.β).
Key Capabilities:
- β Auto-Discovery: Automatically finds and organizes code areas
- β Context Preservation: Never lose your place while coding
- β Team Collaboration: Share knowledge and track activity
- β Analytics: Understand your codebase deeply
High-Level Architecture
ContextDigger is designed as a context governance layer that sits between your codebase and your AI tools. The core idea is simple: discover focus areas, enforce budgets and policies, build governed context bundles, and let everything else consume those bundles.
Surfaces
- contextdigger CLI - primary interface. Creates and manages focus areas, continuation contracts, and governed context bundles under
.cdg/. - ContextDigger Native Core - a high-performance Rust library that implements all governance logic, discovery algorithms, and MCP protocols. Built for extreme speed and safety.
- MCP Server - exposes ContextDigger capabilities (areas, context, contracts, governance, insights, provenance) as MCP tools and resources for coding assistants that speak the Model Context Protocol.
- VS Code Extension - a graphical front end that visualizes focus areas, budget status, contracts, insights, and metrics on top of the same governed context model.
Data Flow (Simplified)
- You run a CLI command (or an MCP tool / VS Code command).
- The internal API loads state from your
.cdg/directory. - Budgets, policies, and authz are applied (Autistic Intelligence lens: respect limits).
- A governed context bundle is assembled (files + provenance + budget status).
- Your AI tools read from that bundle instead of scanning the repo directly.
This architecture keeps the governance logic in one place and lets different surfaces (CLI, MCP, VS Code, skills) share the same understanding of what the AI is allowed to know. All of them call the same internal API and pass through the same budget and refusal checks. For surface specific details, see the pages on the VS Code extension, the MCP server, and local models.
π Multi-Strategy Sub-Area Creation
Transform Attention Budget Constraints into Guided Workflows
When an area exceeds the attention budget, ContextDigger analyzes your files with 4 parallel strategies and suggests focused sub-areas. Create the perfect sub-area in 30 seconds - no manual pattern writing required!
π€ Multi-Strategy Analysis (NO AI)
When you hit an attention budget limit, ContextDigger analyzes your files using 4 parallel strategies - all using regex and pattern matching, no LLM calls:
1. Directory Strategy
Groups files by parent directory at depths 1-3
src/models/*, src/controllers/* 2. Naming Pattern Strategy
Finds common CamelCase/snake_case components
AccountTest*, OpportunityTest* 3. Role-Based Strategy
Groups by file role (test, model, controller, view, util, config)
All test files, All models 4. Import Relationship Strategy
Clusters files by import patterns and dependencies
Files importing 'auth' β‘ Interactive Refusal Workflow
When an area exceeds budget, the refusal becomes interactive:
Result: From attention budget constraint to focused exploration in 30 seconds!
ποΈ Dual Verbosity System
Control the level of detail with verbosity flags:
Compact (default)
/dig-split area Shows top 4 suggestions with basic info
Horizontal -v
/dig-split area -v File previews, patterns, metadata
Vertical Tree -vv
/dig-split area -vv Hierarchical tree with nested splits
-vvπ Three Creation Methods
1. Auto-Suggest on Constraint (Recommended)
Context aperture exceeded β Interactive workflow β Focused sub-area in 30 seconds
/dig large-area 2. Manual Split Command
Proactively split large areas with multi-select
/dig-split area [-v|-vv] 3. Quick Create with Pattern
Create sub-area with exact glob pattern
/create-subarea parent name "pattern" π File Intelligence Extraction
ContextDigger extracts rich metadata from your files without reading content or using AI:
- β Purpose: Extracted from docstrings and top comments
- β Role Detection: test, model, controller, view, util, config
- β Import Analysis: Regex extraction of import statements
- β Naming Components: CamelCase/snake_case splitting
- β Framework Hints: Language-specific pattern detection
π Privacy First: All analysis runs locally using pattern matching. Zero LLM calls, zero tokens consumed, zero external API requests.
π― AI Context Governance
Transform from navigation to governance
ContextDigger enforces budget limits, refuses oversized contexts, and generates machine readable scope definitions. These features work with modern assistants like ChatGPT, Claude, Gemini, Copilot, Cursor, Aider, Cody, Codeium, and any other coding tool that can read text bundles.
π Attention Budget System
Every code area shows its Attention Budget usage to prevent context overflow:
- β Default limits: 15 files, 3,000 lines
- β Warning threshold at 80% usage
- β Configurable via .cdg/config.json
π« Context Aperture Control
ContextDigger refuses to load oversized areas and suggests focused alternatives. With the new Rust core, this analysis is near-instant, even on massive repos.
- β Enforces budget limits with exit code 1
- β Automatically suggests smaller sub-areas
- β Forces intentional decisions about scope
π Context File Export
Every dig command generates an AI-readable context file that works with any tool:
- β Works with assistants like ChatGPT, Claude, Gemini, Copilot, Cursor, Aider, Cody, Codeium
- β Plain text format, no special protocols
- β Includes budget status and bookmarks
Supported AI Assistants & Integration Patterns
ContextDigger is CLI first and tool agnostic. It prepares governed context bundles that work with modern assistants like ChatGPT, Claude, Gemini, Copilot, Cursor, Aider, Cody, Codeium, and others. The assistant you use becomes a client of the governed context you export.
Chat Assistants (ChatGPT, Claude, Gemini)
- Generate a bundle with
contextdigger dig <area>and open.cdg/context/<area>.txt. - Paste the bundle into a chat session, or upload it as a text file if the UI supports uploads.
- Give a clear instruction like: βUse only this context file when making changes; do not reach outside this scope.β
IDE Assistants (Copilot, Cursor, Windsurf)
- Keep the context file open in a pinned tab so the assistant treats it as part of the active context.
- In tools like Cursor or Windsurf, reference the bundle file explicitly (for example by name or using their
@filenotation) when prompting. - Ask the assistant to explain and modify only the files listed in the bundle, not the entire workspace.
CLI/Terminal Tools (Aider)
- Run ContextDigger first to generate the governed bundle for your area.
- Start Aider in the same repo and add the bundle file (e.g. with a command like
/add .cdg/context/<area>.txt). - Use the bundle to guide Aiderβs edits and commits, keeping changes inside the governed slice.
Search Centric Tools (Cody, Codeium)
- Open the context file in the editor so Cody and Codeium see it as a first class file in the project.
- Reference the bundle in chat (βuse the governed bundle at
.cdg/context/<area>.txtas your primary sourceβ). - Use their search or graph features to cross check that changed files are limited to those listed in the bundle.
Future friendly integrations
Because ContextDigger exports plain text bundles with clear budgets and file lists, it works well today via copy and paste and open tabs, and it is also ready for deeper integrations (such as MCP style tools or custom plugins) without changing the bundle format.
Installation
β‘ Quick Install (Recommended)
Install or update ContextDigger (current documented version: vlocal-dev) with a single command:
This installs the native ContextDigger binary. Works for both fresh installs and upgrades. You can optionally install editor or chat integrations (such as Claude skills) on top.
π Manual Installation (Alternative)
Step 1: Install Binary
Step 2 (Optional): Install chat/IDE skills
Step 3: Verify Installation
Feature Areas
1. Discovery & Navigation
Auto-discover code areas, navigate with precision, bookmark locations
2. History & Context
Browser-like navigation, snapshots, breadcrumbs, suggestions
3. Team Collaboration
Team presence, knowledge sharing, wiki generation
4. Code Intelligence
Dependencies, impact analysis, hotspots, coverage
5. Analytics & Insights
Work tracking, productivity metrics, reporting
Supported Languages & Frameworks
Auto-Detected Languages:
Python
pytest, unittest frameworks
JavaScript / TypeScript
Jest, Vitest, Mocha test frameworks
Salesforce
Apex, Lightning Web Components
React Ecosystem
Next.js, Astro, React
Markdown & Scripts
Shell scripts, documentation
Any Language!
Works universally with pattern detection
Works with any language! Auto-detection provides enhanced features (better area names, framework-specific metadata), but ContextDigger functions with any codebase through pattern-based analysis.
Project Structure
After running /init-dig, ContextDigger creates a .cdg/ directory:
your-project/
βββ .cdg/ # ContextDigger data directory
βββ config.json # Project configuration
βββ .gitignore # Excludes user-specific data
βββ areas/ # Discovered code areas (commit these!)
β βββ backend-api.json
β βββ frontend-components.json
β βββ ...
βββ sessions/ # Exploration history (gitignored)
β βββ .json
βββ bookmarks/ # Marked locations (gitignored)
βββ bookmarks.json β Commit to Git
- β
.cdg/areas/- Share discoveries with team - β
.cdg/config.json- Project settings
β Don't Commit (Personal)
- β
.cdg/sessions/- Personal history - β
.cdg/bookmarks/- Personal bookmarks
Real-World Examples
Example 1: Large Monorepo Navigation
Working on a large monorepo with multiple services and shared utilities:
Example 2: Bug Investigation Workflow
Tracking down a bug that spans frontend and backend:
Example 3: Onboarding New Team Member
Help new developers understand the codebase quickly:
Troubleshooting
"ContextDigger not initialized" error
Solution: Run /init-dig in your project directory first.
This creates the .cdg/ directory and discovers your code areas.
"ModuleNotFoundError: No module named 'contextdigger'"
Solution: Install the Python package:
"/init-dig command not found"
Solution: Install Claude Code skills:
Or use the one-line installer:
"Discovery finds 0 areas"
Possible causes:
- Very small project (< 5 files)
- All files in gitignore
- Unusual project structure
Solution: Manually create areas or adjust exclude patterns in .cdg/config.json
"contextdigger: command not found" (CLI)
Solution: Add Python user bin to PATH:
Quick Start
- 1. Install package & skills
- 2. Run /init-dig in project
- 3. Use /dig to navigate
- 4. Mark spots with /mark-spot
Stats
Product Roadmap
From context management to context-free code intelligence
Multi-Strategy Sub-Area Creation
Released December 2025 - Transform attention budget constraints into guided workflows
- β Multi-Strategy Analysis - 4 parallel strategies (directory, naming, role, imports) using regex/patterns (NO AI)
- β Interactive Constraints - Context aperture exceeded β 5 interactive options β Focused sub-area in 30 seconds
- β Dual Verbosity System - Compact (default), horizontal (-v), vertical tree (-vv) with hierarchical splits
- β File Intelligence - Extract purpose, role, imports, naming components without AI (pattern matching only)
- β Three Creation Methods - Auto-suggest on constraint, manual split command, quick create with pattern
- β Impact: Transform "error" to "focused workflow", zero tokens consumed, <50ms analysis for 45 files
AI Context Governance
Released December 2025 - Transform from navigation to governance system
- β Attention Budget System - Track file/line counts, enforce limits (default: 15 files, 3,000 lines)
- β Context Aperture Control - Enforce constraints on oversized areas, suggest focused sub-areas
- β Context File Export - Generate AI-readable context files for Claude Code, Cursor, ChatGPT, Copilot
- β PyPI Release - Simple
pip install contextdiggerinstallation - β Impact: Universal AI tool compatibility, enforced context discipline, zero token overhead
AST Symbol Indexing
Goal: Eliminate context window limits with offline local indexing
π Symbol Indexing
- β’ Tree-sitter AST parsing
- β’ Index classes, functions, methods
- β’ Build call graphs automatically
- β’ Track imports & dependencies
- β’ SQLite local storage
β‘ Instant Queries
- β’
/find-symbol- Go to definition - β’
/find-references- Find all usages - β’
/show-callers- Call hierarchy - β’
/show-dependencies- Imports graph - β’ All queries <50ms, zero tokens
π― Impact: Context-Window Independence
Team Collaboration Features
Goal: Launch paid Team tier with cross-project intelligence
π Cross-Project Search
Search symbols across all team repos
π₯ Shared Indexes
Team members see same indexed code
π Team Analytics
Productivity metrics & insights
Vector DB Semantic Search
Goal: AI-powered semantic code search
π§ Semantic Queries
- β’ "Find code that handles JWT authentication"
- β’ "Show me similar authentication patterns"
- β’ Code similarity detection (find duplicates)
- β’ Smart documentation (usage examples)
βοΈ Technical Approach
- β’ Local embedding generation (CodeBERT)
- β’ FAISS vector database
- β’ Runs offline (privacy-first)
- β’ Incremental updates
Enterprise & Platform Expansion
π’ Enterprise Features (v3.5)
- β’ Security pattern detection
- β’ Compliance scanning (GDPR, HIPAA)
- β’ Self-hosted deployment
- β’ SOC 2 Type II certification
- β’ Audit logs & governance
π Platform Expansion (v4.0)
- β’ Cursor support (10x market size)
- β’ VS Code extension
- β’ Public API
- β’ Plugin marketplace
Technical Architecture
Local Storage (No Cloud)
- β’ SQLite for symbol index
- β’ FAISS for vector embeddings
- β’ All data stays on your machine
- β’ Optional team sync via PostgreSQL
Performance Targets
- β’ Index 100k lines in <30 seconds
- β’ Query response <50ms
- β’ Index size <50MB for 1M lines
- β’ Incremental updates <5 seconds