Context Pilot
October 18, 2025 ยท View on GitHub
Just the tool that answers following questions for you:
- "What all commits ever touched this piece of code?"
- "What are the files related to this piece of code?"
- "Who all touched this piece of code?"
Eventually answering following questions for you: (via your own brain or LLMs)
- "What could have caused the bug?"
- "Why was this changed in the last month? What's the reason?"
- "Where can I find the tests written for this code?"
- "Where should I make the change while working on this code?"
Gist: Whether you want to find:
- Who wrote a particular line (author search ๐งโ๐ป),
- Which files are most related to a given section (context search ๐),
- Or index your whole workspace efficiently with Git history ๐ฅ,
Context Pilot gives you fast, powerful, and local-first code intelligence.
Installation
Context Pilot is available via homebrew:
brew install krshrimali/context-pilot/context-pilot
And via AUR: https://aur.archlinux.org/packages/contextpilot and git package here: https://aur.archlinux.org/packages/contextpilot-git.
If you're not using homebrew or AUR, please build this project from source for now (we are working on adding this to other package managers):
git clone https://github.com/krshrimali/context-pilot-rs.git
cd context-pilot-rs
cargo build --release
This will generate the binary at ./target/release/contextpilot.
Move it to a path that's in your $PATH to run it globally:
cp ./target/release/contextpilot /usr/local/bin/contextpilot
Once done, you should be able to do: contextpilot --help
โจ Features
- ๐ History Analysis: Understand who contributed to every line.
- ๐ Context Extraction: Find related files automatically based on commit histories.
- ๐๏ธ Smart Indexing: Index your project into a fast sharded database for quick queries.
- ๐ Rust-Powered: Extremely fast and lightweight โ no servers needed.
- ๐ง Multi-level tracing: Traverses multiple previous commits to capture richer history.
- โก Editor Integrations: Works with Neovim and VSCode extensions.
- ๐ Local-first: Never sends your code outside your machine.
๐ Usage
Index your workspace
contextpilot /path/to/workspace -t index
This will index your project and store smartly sharded JSON database files at:
~/.context_pilot_db/<workspace>/
Selectively Index your Workspace
contextpilot /path/to/workspace -t index "subdir1,subdir2"
Pass relative paths to the argument as above, and it will only index those folders for you.
Query for Top Context Files
contextpilot /path/to/workspace -t query path/to/file.rs -s <start-line> -e <end-line>
Fetch top related files for the selected line range.
Get relevant commits
contextpilot /path/to/workspace -t desc path/to/file.rs -s <start-line> -e <end-line>
Gives you the relevant commits to the selected piece of code.
๐ฅ๏ธ Editor Integrations
Neovim
- Plugin available: https://github.com/krshrimali/context-pilot.nvim (details available on the link).
VSCode
- Just search available on VSCode Marketplace with name
contextpilotunder the name of Kushashwa Ravi Shrimali as the publisher :) - Extension available here: https://github.com/krshrimali/context-pilot-vscode.
๐จโ๐ป Development
Setting Up Development Environment
-
Clone the repository
git clone https://github.com/krshrimali/context-pilot-rs.git cd context-pilot-rs -
Install dependencies
rustup component add rustfmt clippy -
Install git hooks (recommended)
./.git-hooks/install-hooks.shThis installs a pre-commit hook that:
- Automatically checks code formatting before commits
- Runs clippy to catch common issues
- Prevents commits with formatting errors
Running Tests
# Run all tests (with single thread for git-dependent tests)
cargo test -- --test-threads=1
# Run specific test suite
cargo test --test rename_detection -- --test-threads=1
# Run with output
cargo test -- --test-threads=1 --nocapture
Code Quality
# Format code
cargo fmt
# Check formatting without modifying files
cargo fmt --check
# Run clippy
cargo clippy --all-targets --all-features
# Run clippy with warnings as errors
cargo clippy --all-targets --all-features -- -D warnings
Git Hooks
The pre-commit hook ensures code quality before commits. See .git-hooks/README.md for details.
To bypass the hook (not recommended):
git commit --no-verify
Continuous Integration
We use GitHub Actions for CI/CD:
- Tests workflow: Runs on every PR and push to main
- Build workflow: Builds on Linux, macOS, and Windows
See .github/workflows/README.md for details.