MIMRY

How MIMRY retrieves repository context

MIMRY does not paste a repository into an agent prompt. It maintains a local index, ranks a bounded set of files for a specific task, explains the evidence, and writes a short reading map.

The preflight path

  1. Check repository and index state

    mimry preflight "<task>" sets up a repo when needed and refreshes the index when files changed or MIMRY was upgraded. Generated state lives under .mimry/ and the user cache; it is not source code to edit.

  2. Extract searchable evidence

    MIMRY records files and language-aware symbols, then adds relationships such as imports, calls, definitions, inheritance, and references. Adapters add bounded facts for surfaces including Next.js routes, FastAPI endpoints, SQL schemas, manifests, and Markdown headings.

  3. Rank against the task

    The query is matched against paths, names, content hints, symbols, graph-near files, and prior explicit feedback. Results state why they ranked. Optional local semantic search uses a deterministic local method; it does not send code to a remote embedding service.

  4. Write the context pack

    The result is saved to .mimry/mimry-out/context/latest.md. It contains a status summary, ranked files, relevant symbols, graph relationships, suggested reading order, likely edit surfaces, risks, and verification commands.

  5. Inspect and verify

    The agent opens selected source and repository rules, makes a bounded change, and runs real tests or builds. MIMRY is navigation; source files and execution remain the truth.

Commands for different questions

QuestionCommand
What should I read for this task?mimry preflight "<specific task>"
Which files best match this concept?mimry find "<query>"
Where is this class, function, or heading?mimry symbol "<name>"
What nearby files are connected in the graph?mimry related "<query>"
Why did this file rank?mimry why path/to/file --query "<task>"
Is there a relationship path between two surfaces?mimry path "<source>" "<target>"
What is vaguely similar to this description?mimry semantic "<query>"

For an exact identifier or error message you already know, use rg or git grep directly. MIMRY is for choosing the right context, not replacing every exact-text lookup.

What the context pack does not claim

It is not source truth

A high score does not prove a file needs changing. Read the file and its callers, then test.

No invented graph edges

When a relationship cannot be resolved unambiguously, MIMRY omits the edge rather than guessing.

No remote code upload

Indexing and semantic retrieval run locally. Secret-looking files and generated dependency directories are excluded by policy.

Feedback is explicit

mimry feedback records opened, changed, missed, or ignored files after work; it does not infer success from an agent's confidence.

A complete agent loop

mimry preflight "add expiry validation to API sessions"
# read .mimry/mimry-out/context/latest.md
mimry why backend/api/auth.py --query "add expiry validation to API sessions"
mimry path backend/api/auth.py db/schema.sql
# inspect source, make the change, run the repo's tests
mimry feedback --query "add expiry validation to API sessions" \
  --opened backend/api/auth.py,backend/services/session_service.py \
  --changed backend/services/session_service.py \
  --verification "targeted tests passed" --outcome passed
mimry refresh

Connect this workflow to Claude Code or Codex. The context pack contract documents every section in the generated file.