SuperAPI AI Directory

reflex

Local-first full-text code search engine with MCP server and JSON output built for AI coding agents.

Open website

About this tool

Reflex is a local-first, code-structure-aware instant full-text search tool, primarily aimed at developers, scripting, and AI coding agents. It does not rely on the cloud, is fully offline, and delivers highly deterministic results. It can be used in three ways: directly from the command line, piped into scripts, or connected to AI coding assistants (such as Claude Code, Cursor, and any other tool that supports MCP).

Main capabilities:

  • Full-text code search: based on a trigram inverted index, supports normal queries, regular expressions, count, and other modes.
  • Symbol awareness and dependency analysis: can find references, retrieve dependencies, and perform symbol queries, with complete symbol extraction for 15 languages (functions, classes, methods, types, etc.), including Rust, C, C++, Zig, Python, Go, Java, C#, PHP, Ruby, Kotlin, TypeScript, JavaScript, Vue, and Svelte. Swift is temporarily disabled due to syntax parser compatibility issues, but full-text search is still available.
  • MCP toolset: after connecting to an AI assistant via MCP, tools such as search_code, find_references, and get_dependencies can be called, and analysis features such as analyze are also supported. Some old tool names are deprecated, but can be replaced with new parameters.
  • Automatic index updates: before each command or MCP tool call, stale indexes are updated (only changed files are updated). You can also use --no-update to skip updates and use the existing index directly.
  • Smart filtering: by default, matching is by complete identifier (for example, verify_csrf will not match verify_csrf_form_field); substring matching or case-insensitive matching can be enabled. Lock files and generated files are indexed by default but do not appear in results unless explicitly included.
  • Natural language search: requires configuring an AI provider first via rfx llm config (supports OpenAI, Anthropic, OpenRouter, or any OpenAI-compatible endpoint).
  • Interactive TUI: running rfx query without a pattern starts real-time search with keyboard navigation.
  • Documentation site generation (Pulse): rfx pulse generate can generate a two-tab documentation site from the index, requires Node 22.12+ to build, and outputs pure HTML that can be deployed to any static host.

Usage:

  • Installation:Installing via NPM is recommended. You need to run the rfx command in the project root directory and add .reflex/ to .gitignore to exclude the index.
  • Integrating with AI agents (MCP): For Claude Code, you can use "alwaysLoad": true to have it load the tool schema at the start of a session, or use claude mcp add --scope user reflex -- rfx mcp. Other MCP clients need to register a stdio server, with the command rfx and the arguments ["mcp"].
  • Command line: rfx <command> --help to view all options.
  • Environment variables: A set of variables is provided for benchmarking and CI, such as REFLEX_INDEX_BATCH_FILES, REFLEX_SYMBOL_THREADS, REFLEX_FRESHNESS_TTL_MS, etc.

Use cases:

  • Symbol lookup, dependency analysis, and reference lookup in large codebases, especially in scenarios where linear scanning is slow.
  • Developers or scripts that need offline, deterministic code search.
  • Integration with AI coding assistants to improve the accuracy and capabilities of codebase exploration.

Limitations and caveats:

  • According to the A/B tests in the materials, Reflex did not save tokens compared with built-in search in AI agent runs; its value lies in capability improvements (symbol awareness, dependency analysis, finding all references in a single call, obtaining precise counts without loading content, etc.).
  • For one-off scans of medium-sized repositories, ripgrep is still a good choice.
  • By default it binds to 127.0.0.1:7878 without authentication and should not be exposed to the network.
  • Index coverage is consistent with ripgrep's defaults: non-binary files that are not gitignored and are not in dot directories (unless hidden indexing is enabled).
  • Files without a symbol parser (text-level, Swift) can be full-text searched, but will not produce --symbols results.
  • For detailed limitations and the complete methodology, see .context/EFFICACY-2.0.3.md and the threat model in CLAUDE.md.