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.

Claude Code plugin

In Claude Code, the plugin gives the agent the MIMRY skill, the hooks and the MCP server in one step. It needs uv on your PATH and nothing else.

/plugin marketplace add jbacalso24/mimry
/plugin install mimry@mimry

It replaces mimry install --platform claude-code, so use one or the other.

Other agents: npx skills

It installs the skill only; for the MCP server and hooks, run mimry install --platform <name> (see Supported agents).

npx skills add jbacalso24/mimry

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 14 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 languages

MIMRY parses these languages with tree-sitter for symbols, imports, calls and inheritance.

Language Extensions
Python .py
JavaScript .cjs, .js, .jsx, .mjs
TypeScript .cts, .mts, .ts, .tsx
Go .go
Rust .rs
C# .cs
Java .java
PHP .php
C .c, .h
C++ .cc, .cpp, .cxx, .hh, .hpp, .hxx
Ruby .rb
Kotlin .kt, .kts
Scala .sc, .scala
Swift .swift

MIMRY also indexes Markdown (headings, links, frontmatter), plain text, PDF, Word and Excel files.

Other extensions can be mapped to a supported language in mimry.toml, see Configuration.

Planned

We're adding these next; progress is tracked in #47, where you can ask for yours.

  • Web and markup: HTML, CSS, SCSS, Vue, Svelte
  • Scripting and shells: Bash, PowerShell, Lua, Perl
  • Data and config: SQL, JSON, YAML, TOML, XML, Terraform (HCL)
  • Apps and systems: Dart, Objective-C, Zig, Groovy
  • Functional and scientific: Elixir, Haskell, OCaml, R, Julia
  • Other: Solidity, Fortran, Pascal

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.2

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.2
File Size Uploaded
mimry-0.3.2.tar.gz 552.5 kB Details

Built distribution (wheel)

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

Total release size: 826.3 kB

Release files / mimry-0.3.2.tar.gz

Download URL mimry-0.3.2.tar.gz
Size 552.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0bf57f46d9dfa7dfada05c9c86110b2e76a322209477bf5f786986c17c308c4d
BLAKE2b-256 checksum
How to use checksums
2833f8c88a30891bff8a09fa102fc46cae4c720863d91c7bcdd8f66b61908704
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.2-py3-none-any.whl

Download URL mimry-0.3.2-py3-none-any.whl
Size 273.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48da6cfcb323d3b2c0db417716d67ca8a9970b3600c70e6d8a314ea2224c61d1
BLAKE2b-256 checksum
How to use checksums
3e8d928bb37bf02f34ed253872148b57174f81560e72931e923c7c2736b8940a
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

This release

0.3.2 This release

2 release files

0.3.1

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