npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@1percentsync/flashlight

v0.6.10

Published

MCP Server that uses DeepSeek's 1M context window for whole-codebase code search

Readme

Flashlight

MCP Server that uses DeepSeek's 1M context window for whole-codebase code search.

How it works

Flashlight loads your entire codebase into DeepSeek's context, then uses LLM understanding to find relevant code — no embeddings, no keyword matching, just brute-force full-context search.

It relies on DeepSeek's prefix caching for repeat queries: as long as the same prefix (system instructions + base code) is sent, tokens are served from cache (¥0.02/million tokens vs ¥1/million tokens for miss).

For large projects exceeding the 1M token limit, Flashlight automatically shards the codebase by directory, queries all shards in parallel, and merges results.

Setup

1. Install

npm install -g @1percentsync/flashlight

2. Get a DeepSeek API key

Get one at platform.deepseek.com.

3. Configure MCP

Add to your MCP client config:

Claude Code (~/.claude.json under mcpServers):

{
  "flashlight": {
    "command": "flashlight",
    "env": {
      "DEEPSEEK_API_KEY": "sk-..."
    }
  }
}

Flashlight detects the workspace from MCP roots when the client provides them. If roots are unavailable, it falls back to the server process working directory.

Usage

The server exposes a single tool search with parameters:

| Parameter | Required | Description | |-----------|----------|-------------| | query | Yes | Natural language description of the code to find | | scope | No | Optional workspace-relative directory prefix (e.g. app or framework/src). Omit to search the entire workspace. Do not pass ., ./, absolute paths, or paths outside the current workspace. | | file_types | No | File extensions to filter (e.g. [".ts", ".py"]) |

Output

Results are returned as code snippets — the matched line ranges with line numbers.

Configuration

Environment variables

| Variable | Default | Description | |----------|---------|-------------| | DEEPSEEK_API_KEY | (required) | DeepSeek API key | | DEEPSEEK_BASE_URL | https://api.deepseek.com | DeepSeek API base URL | | FLASHLIGHT_MODEL | deepseek-v4-flash | Model (deepseek-v4-flash or deepseek-v4-pro) | | FLASHLIGHT_REASONING_EFFORT | max | Thinking effort (high or max) | | FLASHLIGHT_CHANGE_THRESHOLD | 0.1 | Ratio of changed tokens to trigger base rebuild | | FLASHLIGHT_MAX_CONTEXT_TOKENS | 900000 | Max tokens per shard (triggers auto-sharding when exceeded) |

Project-level config

Create .flashlight/config.json in the workspace root to customize file extensions per project:

{
  "ext_whitelist": [".mdx", ".astro"],
  "ext_whitelist_override": false
}

| Field | Default | Description | |-------|---------|-------------| | ext_whitelist | [] | File extensions to include | | ext_whitelist_override | false | true = only index listed extensions; false = merge with global defaults |

Priority: project config > FLASHLIGHT_EXT_WHITELIST env var > built-in defaults.

The config is read once at process start. Changes require restarting the agent environment.

How caching works

Flashlight relies on DeepSeek's prefix caching. On first query, it sends all code and saves a base snapshot. On subsequent queries:

  1. Detect file changes against the saved base
  2. If changed tokens exceed FLASHLIGHT_CHANGE_THRESHOLD (default 10%) — rebuild the base entirely
  3. Otherwise — reuse the stored base text and append only changed files as incremental context

This ensures the prompt prefix stays stable across queries, maximizing cache hit rate.

Sharding (large projects)

When a project exceeds FLASHLIGHT_MAX_CONTEXT_TOKENS, Flashlight automatically:

  1. Splits files by directory — tries the whole project first, then recursively splits by top-level directories until each group fits
  2. Queries all shards in parallel
  3. Merges and deduplicates results

Each shard maintains independent cache state. Shard boundaries only change when a shard overflows (split eagerly, merge lazily).

Logs

Logs are written to .flashlight/flashlight.log in the workspace root. Each query logs:

  • Snapshot size and shard plan
  • File change detection
  • Per-shard query cache hit ratio
  • Search results

Cost

With deepseek-v4-flash on a ~50K token codebase:

| Operation | Cost | |-----------|------| | First query (build cache) | ~¥0.05 | | Subsequent query (cache hit) | ~¥0.001 + output tokens |

License

ISC