Skip to main content

MIMRY - Local repo memory for coding agents

MIMRY

Local repo memory for AI coding agents.

PyPI GitHub stars CI Python 3.11+ License MIT Website

If MIMRY saves your agent tokens, please star it.

MIMRY is a command-line tool that tells AI coding agents which files, and which lines in them, to read for a task. It parses a repository into symbols and a dependency graph, keeps the index on your machine, and ranks the files that matter for a task described in plain words. Agents call it from the shell or through its MCP server.

mimry preflight in a terminal: it ranks the Flask files for a session cookie bug and names the lines to read first

Installation

uv tool install mimry

Requires Python 3.11 or newer on Windows, Linux or macOS. pipx install mimry and pip install mimry also work.

Quick start

Run mimry preflight in your repository with a task description. The first run builds the index.

mimry preflight "Fix session cookie not refreshed when SESSION_REFRESH_EACH_REQUEST is set"

Output on the Flask repository:

Start with
   1  src/flask/sessions.py
      name matches · path matches · connected to other matches
      read first: lines 202-206 (get_cookie_secure), 233-247 (should_set_cookie)
   2  src/flask/ctx.py
      name matches · connected to other matches
      read first: lines 154-206 (copy_current_request_context), 395-403 (session)
   3  src/flask/testing.py
      name matches · connected to other matches
      read first: lines 135-183 (session_transaction), 193-202 (_request_from_builder_args)

The same result is written to .mimry/mimry-out/context/latest.md as a context pack for the agent, with the matched symbols, related files and the project's test commands.

To have your agent use MIMRY on its own, install it for that agent:

mimry install --platform claude-code

Features

Feature Description
Ranked lookup Ranks files by name, path, content, symbol and graph matches, and shows why each one ranked
Line ranges Names the functions, classes or sections to read first in each file
Code graph Maps imports, calls and inheritance across 16 languages with tree-sitter
Documents Indexes Markdown, text, PDF, Word and Excel files alongside code
Incremental indexing Re-reads only changed files, and refreshes the index before the main lookups answer
Feedback Ranks files recorded as useful higher for similar tasks
MCP server Exposes every lookup as an MCP tool
Local Runs without an LLM, API key or telemetry, and keeps your code on your machine

Supported agents

mimry install --platform <name> installs a skill that teaches the agent when to use MIMRY, and registers the MCP server where the agent supports it.

Agent Platform name Skill MCP server
Claude Code claude-code ✅ ✅
Codex codex ✅ ✅
GitHub Copilot CLI copilot ✅ ✅
GitHub Copilot in VS Code vscode ✅ ✅
Gemini CLI gemini ✅ ✅
OpenCode opencode ✅ ✅
Kiro kiro ✅ ✅
Cursor cursor ✅ ✅
Amp amp ✅ ✅
Devin devin ✅ ✅
Factory Droid droid ✅ ✅
Kimi kimi ✅ ✅
Kilo Code kilo ✅ manual
Aider, Antigravity, CodeBuddy, Hermes, OpenClaw, Pi Agent, Trae see mimry install --list-platforms ✅ manual
Windsurf, Cline, Roo Code, Zed, JetBrains #80 🚧 🚧
Grok #93 🚧 🚧

✅ means mimry install sets it up, manual means you add the MCP server by hand, and 🚧 means support is in progress.

See docs/agents.md for where each agent's files go and how its MCP server is registered.

Option Description
--project Install into the current repository only, instead of for every repository
--always-on Add a short rules block to the agent's always-read file, such as AGENTS.md
--hooks Suggest mimry find when the agent starts a broad grep, and refresh the index in the background when a session starts and after each file edit. For Codex, project hooks run after you trust them with /hooks.
--no-mcp Install the skill without registering the MCP server

Manual MCP setup
claude mcp add --scope user mimry -- mimry-mcp   # Claude Code
codex mcp add mimry -- mimry-mcp                 # Codex

Other MCP clients:

{
  "mcpServers": {
    "mimry": { "command": "mimry-mcp" }
  }
}

uvx mimry mcp runs the server without installing it.

By default the server lists 8 core tools: mimry_status, mimry_preflight, mimry_find, mimry_related, mimry_symbol, mimry_path, mimry_why and mimry_feedback. Their definitions cost 1,309 tokens per session (o200k_base), against 2,590 for all 22 tools, so the rest stay CLI commands unless you ask for them. Set MIMRY_MCP_TOOLS=all in the server's environment to list every command as a tool, or give a comma-separated list of tool names, such as MIMRY_MCP_TOOLS=mimry_find,mimry_path. An unknown name prints one line to stderr and falls back to the core tools.

MIMRY is listed in the MCP Registry as io.github.jbacalso24/mimry.

Usage

mimry preflight "<task>"            # list the files and lines to read first, and write a context pack
mimry find "<query>"                # rank files for a query
mimry symbol <name>                 # find where a function, class or heading is defined
mimry related "<query>"             # list files connected through imports and calls
mimry explain "<task>"              # show the key files and symbols, and how they connect
mimry why <file> --query "<task>"   # explain why a file ranked
mimry feedback ...                  # record which files helped
mimry status                        # check whether the index is current
mimry doctor                        # diagnose the install and the index

See docs/commands.md for every command and option.

Configuration

A mimry.toml at the repository root controls which files are indexed. Commit it so everyone on the team gets the same index.

[index]
include = ["src/**", "docs/**"]            # index only these paths
exclude = ["**/fixtures/**", "legacy/**"]  # never index these paths
max_file_bytes = 2_000_000                 # size limit per file (default 1 MB)

[index.languages]
".inc" = "php"                             # parse .inc files as PHP
".h" = "cpp"                               # parse .h headers as C++ instead of C

Benchmarks

Tokens an agent read before it found the code each pull request changed, measured on 92 merged pull requests from 12 open-source projects.

How the agent reads files Tokens saved with MIMRY
Whole files 50%
grep -n, then a few lines around each match 48%
The line ranges MIMRY names first 67%

See benchmarks/tokens for the method, per-project results and how to reproduce them.

How it works

  1. Index. MIMRY parses each file into symbols and edges for imports, calls and inheritance, and stores the index in your user cache directory, outside the repository.
  2. Rank. MIMRY matches a task against file names, paths, content, symbols and the graph, and drops imports it cannot resolve rather than guessing.
  3. Refresh. Like Git, MIMRY compares file metadata and re-reads only the files that changed.

See docs/how-it-works.md for details.

Privacy

Indexing and search run locally. Credential files are skipped, secret-looking values are redacted from feedback, and untracked files named in .gitignore are not indexed.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md for setup and checks. MIMRY is in public alpha, and its interfaces may change before 1.0.

License

MIT

Metadata

Release files for mimry 0.3.1

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

Source distribution (sdist)

Source distribution for mimry 0.3.1
File Size Uploaded
mimry-0.3.1.tar.gz 532.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mimry 0.3.1
File Interpreter ABI Platform
mimry-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 797.0 kB

Release files / mimry-0.3.1.tar.gz

Download URL mimry-0.3.1.tar.gz
Size 532.1 kB
Tags Source
SHA-256 checksum
How to use checksums
248497023d6c8d853c1f1be5224c81dad197d08e3eb29cab0931e03abd288d2b
BLAKE2b-256 checksum
How to use checksums
e5332baf9265419ed580daa04389067fb4da7addbf42691470c1161ef11332a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release files / mimry-0.3.1-py3-none-any.whl

Download URL mimry-0.3.1-py3-none-any.whl
Size 264.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed5f37ead9c76907912d42778a8a4d005b3c9a624641221f63e3a0dea1eda17a
BLAKE2b-256 checksum
How to use checksums
cef257a913b01be007b9df13424ad88f6289c4daeb207c6e1150d88b87e3bbd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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