Read-only context exploration and retrieval for AI agents, starting with codebases and repositories.
pip install flash-context==0.4.1 Copy PIP instructions
A lightweight, model-agnostic repository explorer for AI agents, available as a Python CLI and Model Context Protocol (MCP) server. It combines deterministic lookup with search and reading delegated to a utility model through an OpenAI-compatible endpoint, returning compact, validated file-line citations and source snippets.
CLI and MCP share a read-only core for exploring code, documentation, configuration, and other local text files with path safety and resource limits. See safety and evidence validation for details and limitations.
Inspired by FastContext, a now-withdrawn paper on separating repository exploration from task solving, using specialized models to return focused file-line evidence while reducing the coding agent's context and token overhead.
Requires Python 3.13+, uv, and an OpenAI-compatible model endpoint with tool calling support.
uv tool install flash-context export FLASH_CONTEXT_BASE_URL=http://localhost:1234/v1 export FLASH_CONTEXT_MODEL=your-model flash-context explore --repo . --query "Find the request validation logic" Replace the endpoint and model with your settings. Set FLASH_CONTEXT_API_KEY if authentication is required. Installed commands use environment variables; source checkouts also support project-root config.yaml and .env.
Default output is repository-relative citations:
src/api/validation.py:42-88 Use --no-citation for prose, --format json for results with snippets, or --max-turns 6 to set the exploration limit. Exact path and unique symbol lookups can resolve locally without an endpoint. See the CLI contract for options, output schemas, and exit codes.
For example, --query 'httpx/_client.py' returns a bounded file preview, while --query 'BaseTransport' returns its definition if unique within a complete Python source/stub scan. Local successes report turns_used: 0 in JSON.
Warnings go to stderr in both output formats. An empty result after scan-budget exhaustion exits 6 while preserving stdout; a complete empty search exits 0. For large repositories, see scan-budget tuning.
Models select symbol or line anchors; the controller resolves bounded syntax regions and returns structural precision metadata. See the shared contract for evidence rules and limits.
uvx --from 'flash-context[mcp]' flash-context mcp --transport stdio Exposes explore_repository(query, repo_root?, max_turns?, citation?). See MCP integration for editor configuration and source launches.
All 2 files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




