Coinopolis · Mega Mind

One memory. Every coding agent.

Agents record what they build, fix, and learn. Every agent searches it before starting, so the next session starts informed.

Runs on your machine: markdown in a local git repo. No account, no server, nothing sent anywhere by default.

Works with Claude Code, Codex, Grok, Copilot and any agent that can run a command.

Version 0.5.6Updated 2026-11-06MIT licenseLinux binary · macOS & Windows from source

Claude Codemind record after fixing lost webhooks

Shared memory1 new entry

Retry webhooks with exponential backoff

Five attempts, doubling from 1 s, so a flaky receiver never loses webhooks. Refs src/webhooks.rs

Codexa later session, before touching webhooks
$ mind search "webhook retries"
◆ MEGA MIND · search  “webhook retries”
   1 result · by meaning + keywords

╭ 01  Retry webhooks with exponential backoff
│ FIX payments-api  ✓ verified
│ ▰▰▰▰▰▰▰▰▱▱ 81%  in “Solution”
│ Five attempts, doubling from 1 s,
│ so a flaky receiver never loses webhooks.
│ ↳ payments-api:src/webhooks.rs
╰ 2026-11-02-retry-webhooks-with-backoff

Ask your agent about it

Give your agent one line.

Claude Code, Codex, Grok, Copilot or any agent that can run commands reads a short guide written for it. It tells you what Mega Mind is and how it would help with your projects, and checks the code is safe, then stops. You decide. Only if you say yes does it install it, asking before it changes anything.

Copy this into your agent:

Read https://megamind.coinopolis.io/agent-overview.md and review it. Let me know if Mega Mind would be useful for my projects and how, and whether it's safe. Don't install anything unless I say so.
  1. AHow it would help youWhat Mega Mind does, and honestly whether it fits how you work, with examples from your own projects.
  2. BCheck the code is safeEvery network call, program it runs and file it changes, with where to look.
  3. You decide. If you say yes:
  4. CInstall itThe checked Linux binary, or a build from source on macOS and Windows.
  5. DSet it up with youYour name, local search, a local model if you have one, which tools to connect.
  6. EFirst useIt fills the memory from a real project, then another agent finds it.

Why Mega Mind

Next to what you already use

  • CLAUDE.md, AGENTS.md, rules files: keep them for standing instructions. Every line loads into every session; Mega Mind is searched only when it's relevant.
  • Claude's memory is great for how to work with you, but only Claude reads it, and nothing flags it when code changes. Mega Mind is project knowledge every tool shares. Use both.
  • Memory servers are something to run. Mega Mind is one command and plain markdown in git you can read, diff and undo.
  • Docs and wikis are for people. Entries are written by agents for agents, tied to the files, and flagged when that code changes.

Light: about 200 tokens when a session starts; an entry loads only when an agent opens it.

How it fits together

One binary, a folder of markdown, an index you can delete.

How Mega Mind fits together Agents call the mind CLI through the skill and hooks. The CLI writes entries as markdown in a git repository and keeps a SQLite search index. The index gets its vectors from an embedding model: local, on Azure, or any OpenAI-compatible service. The optional librarian (LM Studio, Azure or OpenAI-compatible) reviews stale entries. vectors reviews Your agents Claude Code · CodexGrok · Copilot skill + hooks mind CLIsearch · record · stale commands/ · hooks.rs Entriesmarkdown in git · store/ Search indexSQLite FTS5 + vectors Librarianoptional · reviews stale entries LM Studio · Azure · OpenAI Embeddingsmeaning for search local · Azure · OpenAI

Or install it by hand

  1. Install

    Linux x86_64: download

    curl -fLO https://megamind.coinopolis.io/downloads/mind-x86_64-linux.tar.gz
    curl -fLO https://megamind.coinopolis.io/downloads/mind-x86_64-linux.tar.gz.sha256
    sha256sum -c mind-x86_64-linux.tar.gz.sha256
    tar -xzf mind-x86_64-linux.tar.gz && install -Dm755 mega-mind-*/mind ~/.local/bin/mind

    For Ubuntu 24.04+, Debian 13+ or another Linux with glibc 2.39+; needs git. Built and tested in clean containers. If mind isn't found, add ~/.local/bin to your PATH.

    macOS, Windows, other systems: build from source

    git clone https://megamind.coinopolis.io/git/mega-mind.git
    cd mega-mind
    cargo install --locked --path . --features local-embeddings
    What the build needs
    • Rust 1.92 or newer, and git.
    • macOS: xcode-select --install. Windows: the Visual Studio C++ build tools (the Rust installer offers them). Linux: build-essential or similar.
    • --features local-embeddings adds the local search model. Leave it off on Linux older than Ubuntu 24.04 / Debian 13, where downloads are blocked, or if you'll use Azure or OpenAI for search.
  2. Set up

    Press Enter to accept each default: local search, nothing sent anywhere. If LM Studio or Ollama is on your machine, setup offers it as the librarian. Then it connects the agent tools it finds.

    mind setup
    mind doctor
  3. Try it

    Restart your agent sessions. Then, in one of your projects, tell your agent:

    Backfill the mind for this project.

    It records the project's overview, systems, workflows and gotchas, linked to the real files. Now ask a different agent how something in that project works: it searches the mind first.

    Updating: mind upgrade for a source install, or download the binary again. Your memory lives in its own folder, so updates never touch it.

On this page

Mega Mind (mind) is a shared, long-term memory for AI coding agents. Every agent on a machine (Claude Code, Codex, Grok, Copilot, or anything that can run a command) reads from and writes to the same store, so:

  • nothing gets rediscovered: before building or debugging, an agent searches how another agent already did it, and gets the files to read;
  • nothing is lost when an agent's context window is wiped: it searches its own past work;
  • knowledge stays accurate: entries are tied to the code they describe and are flagged when it changes.

It is a single command-line program plus a folder of markdown files. Nothing listens on a port and no server is needed; the only scheduled work is the optional nightly review (section 8).


1. What goes in it

An entry is a short markdown note with a header of facts (frontmatter). Each has a kind:

Kind What it captures Required sections
system How something was built: a service, feature, pipeline, game system Goal, Approach, Key files
workflow How to do a multi-step task: a release, migration, trailer, screenshot set Goal, Steps
fix A problem that took real digging, and what solved it Problem, Solution
gotcha A trap that is easy to fall into What happens, Avoid it
decision A choice that was made and why, so nobody silently reverses it Decision, Why
runbook An exact operational procedure: deploys, ops tasks Purpose, Steps, Verify
overview One per project: stack, layout, main systems Stack, Layout

Frontmatter fields: title, kind, project, owner (defaults to project), tags, engine (stack and versions), genre, platform, verified + verified_how, refs (the real files, as project:path/in/repo; a ref must be inside a registered project, since agents open refs), related, supersedes. mind template <kind> prints a ready skeleton.

What not to record: routine steps ("ran the tests"), or anything the repo's docs already say clearly. The mind should be dense with things that save the next agent real time.


2. How agents use it

mind search "retry webhooks with backoff"        # by meaning + keywords; --kind, --project, --engine, --tags…
mind search "retry webhooks" --brief             # one line per result, to scan them all before opening any
mind get <id>                                    # full entry, its files (absolute paths), staleness, related entries
mind record --file entry.md                      # new entry (or pipe it in: mind record < entry.md)
mind get <id> --raw > e.md; …edit…; mind update <id> --file e.md
mind ack <id>                                    # "the code changed, but this entry is still right"
mind stale                                       # this project's entries that need checking
mind who <project>                               # where a project lives, its entries, how to reach its agent
mind uses <tech>                                 # which projects/entries use a technology

Agents run mind from inside their project's folder; it works out the project from the working directory and records the writer as <project>-agent (or $MIND_AGENT).

The intended rhythm:

  1. Session start: check stale entries and fix or confirm them.
  2. Before non-trivial work: search, read the best entries, open their files.
  3. After building or solving something reusable: record it, or update the existing entry.
  4. After a context reset: search before re-deriving anything.

3. How it works

Storage

  • Entries are files in entries/ inside the mind folder (~/.local/share/mega-mind, or %LOCALAPPDATA%\mega-mind on Windows; override with MIND_HOME).
  • The folder is a git repo. Every write is a commit authored by the agent that made it, so mind log shows who wrote what, and anything can be undone with git.
  • projects.toml maps project names to folders; refs like payments-api:src/retry.rs resolve through it.
  • config.toml holds your settings (section 6).
  • index.db is a search index derived from the files. It is rebuilt automatically when files change, and deleting it is always safe.

Each entry is split by ## section. Each section gets an embedding, a list of numbers capturing its meaning, so "make failed deliveries try again later" finds an entry titled "retry queue with exponential backoff". Keyword matching (SQLite FTS5) runs alongside, so exact names and error strings also hit. The two rankings are merged; the result shows the best-matching section of each entry.

Without an embedding provider (or when it is unreachable) search is keyword-only, and it catches up automatically once embeddings work again.

Staleness

When an entry is saved, the mind stores a fingerprint of each file in its refs. If a file later changes (or disappears), the entry is stale: it may describe code that no longer exists. Stale entries show a ⚠ in search results, and the owning project's agent is told:

When How
Session start the hook lists the project's stale entries (up to 10)
Each message you send a one-time note about anything newly stale; repeated after 10 messages if still not handled
mind stale on demand, or at session start for tools whose hooks can't reach the model
mind review the librarian (an LLM) compares each stale entry with the code change and writes a verdict: accurate / needs update, with notes

The agent then updates the entry or confirms it (mind ack). The librarian only writes notes; it never changes entries.

Staleness only sees the files an entry refs, so agents are told to ref what an entry relies on as well as what it describes: the interface, schema or shared config it assumes, even in another project. A note about a service that calls an API refs the API's definition too, so changing that API flags the note.

Recording safeguards

  • Validation: kind and required sections, a known project, real files in refs, valid YAML.
  • No duplicates: with embeddings on, a near-identical entry of the same kind is refused, pointing to the existing one (override with --new when it really is different). Keyword-only minds skip this check.
  • No secrets: text that looks like a key, token, password or private key is refused. Name the environment variable or file that holds it instead.
  • Runbook review (optional): changes to runbooks become proposals (mind proposals) that the configured reviewer accepts or rejects.
  • Cross-project edits are allowed and marked in the history.

4. Connecting agent tools

mind setup installs what each tool supports and merges into existing settings (it never overwrites your other settings, and re-running it changes nothing that is already right).

Tool Skill (full guide) Always-on instructions Hooks
Claude Code ~/.claude/skills/mega-mind/ via the session-start hook session start, each message, end of turn
Codex ~/.codex/skills/mega-mind/ managed block in ~/.codex/AGENTS.md same three, in ~/.codex/hooks.json (trust them once when Codex asks). Codex's sandbox blocks writes outside the project and keeps every .git read-only, so inside it Codex can search and read the mind but not save: mind then tells it to request escalated permissions for that one command, which you approve
Grok reads Claude's skill ~/.grok/rules/mega-mind.md reads Claude's hooks, in trusted folders; only the end-of-turn nudge reaches the model, so the rule tells it to run mind stale and to search first
Copilot — add the printed block to AGENTS.md / .github/copilot-instructions.md in your repos where supported
Anything else — paste the printed block into its instructions —

The three hooks:

  • Session start: "the mind exists; your project has N entries; these are stale."
  • Each message: entries that may already cover what the message asks, and a note when entries newly went stale. Suggestions match on keywords and stay quiet unless an entry shares at least two of the message's meaningful words, including a distinctive one (or two in its title); at most three entry ids (never titles: those are other agents' text), each once per session, so an agent opens them before it starts digging. Silent otherwise; it reads the saved index only (a few tens of milliseconds). [hooks] suggest = false turns suggestions off.
  • End of turn: once an agent has edited a few files, it is asked once to record anything reusable, then again only after many more edits.

Machine-specific instructions (your projects, your deploy rules) go in <mind folder>/skill-local.md; setup appends them to the installed skill under "On this machine". Because that text becomes part of every agent's instructions, and any agent can write the file, setup shows it to you and asks before including it, and asks again whenever it changes (--yes never approves it).


The rest of the guide (several agents and syncing between machines, settings, Azure, maintenance, every command) is on the guide page.