Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

flash-context

CI PyPI version Python versions License

A lightweight, model-agnostic repository search tool for AI agents. Find relevant code, documentation, and configuration through exact lookups or model-guided search, and retrieve compact snippets with validated file-line citations. Available as a Python CLI and Model Context Protocol (MCP) server.

CLI and MCP share a read-only core with path safety and resource limits. Exact lookups can resolve locally; broader queries delegate search and reading to a utility model through an OpenAI-compatible endpoint. Validation checks paths and source ranges; semantic relevance remains the model's judgment. 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.

Quickstart

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 search --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 N to override the 12-turn default. 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.

Use --query 'httpx/_client.py#BaseClient._redirect_method' to resolve a parsed definition locally. A leaf name such as httpx/_client.py#_redirect_method works when unique in that file. Unresolved anchors fall back to model-guided search.

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.

MCP

uvx --from 'flash-context[mcp]' flash-context mcp --transport stdio

Exposes search_repository(query, repo_root?, max_turns?, citation?). See MCP integration for editor configuration and source launches.

Documentation

License

Apache License 2.0.

Metadata

Release files for flash-context 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flash-context 0.5.0
File Size Uploaded Provenance Actions
flash_context-0.5.0.tar.gz 41.7 kB With provenance Details for flash_context-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flash-context 0.5.0
File Interpreter ABI Platform Actions
flash_context-0.5.0-py3-none-any.whl Python 3 none any Details for flash_context-0.5.0-py3-none-any.whl

Total release size: 85.1 kB

Release files / flash_context-0.5.0.tar.gz

Download URL flash_context-0.5.0.tar.gz
Size 41.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3f48a0a6b1a21a37cf2a055c85ae8e1357ea8905eaf8ea5cfe10e667eff5deee
BLAKE2b-256 checksum
How to use checksums
e9aaf2b86520380c1d35e329dfcfb4ef2a1f4998094cf5cf80bb1ff35cbd223f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

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 Publish Attestation

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.

Transparency log

Release files / flash_context-0.5.0-py3-none-any.whl

Download URL flash_context-0.5.0-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0991a1425dea187118af54b7f6f25c3fbe79827dc09e8f1fa6efcf074b65099b
BLAKE2b-256 checksum
How to use checksums
bfba4e6d35b6e3a87ea35c29056375066506b93096d201b64cf5405784e6c697
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

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 Publish Attestation

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.

Transparency log

Security for flash-context 0.5.0

Provenance

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flash_context-0.5.0.tar.gz

PyPI Publish Attestation

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.

Transparency log

A note on package security

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page