Mnemos

From jeremylongshore/claude-code-plugins-plus-skills · View interactive version

Mnemos is an AI agent skill from the GitHub repository jeremylongshore/claude-code-plugins-plus-skills. Persistent memory and learning-loop skills for AI coding agents using mnemos MCP tools. Use whenever mnemos_* MCP tools are available and you are doing work worth remembering. Cross-session memory, conventions, corrections, and architectural decisions surface back into context automatically. Trigger

How to use this skill

Skill file

mnemos

Overview

You have a persistent memory layer available via the mnemos_* MCP tools. By default you will skip these tools on plain editing tasks. Don't. Mnemos is the learning-loop primitive for the project you are working on: corrections, decisions, and conventions compound across sessions if you record them. Silently editing leaves the store empty and the next session blind.

There is a known correction already stored about this exact failure mode: _"agent skipped mnemos_session_start on editing tasks — LLMs skip optional tool calls when the task looks like plain reading/editing; the agent needs an external nudge."_ This skill is that nudge.

Prerequisites

Instructions

Session lifecycle

Start. The Claude Code SessionStart hook runs mnemos prewarm, which opens a mnemos session by default and injects a mnemos_session_id: line into context. If that ID is present, reuse it for session_id fields and do not call mnemos_session_start again. If no ID is present (manual MCP setup, non-Claude client, or hook disabled) and you are about to do real work, open one:

mnemos_session_start(
	project="<repo name from git or cwd>",
	goal="<one short line — what you are trying to do this session>"
)

Without a goal, the UserPromptSubmit hook backfills the first real prompt when available. With a goal, the session becomes a durable record that mnemos replay and future prewarms can use.

End. When the user signals done ("ship it", "that's it", "commit and close", "we're done"), close the session:

mnemos_session_end(
  session_id="<id>",
  summary="<one or two sentence recap of what shipped>",
  status="ok"
)

Status values: ok | failed | blocked | abandoned. An open session with no summary is dead weight in the next session's prewarm.

Which tool for which signal

| Signal from the user or the work | Tool to call |

| --- | --- |

| About to execute a non-trivial plan (after deciding approach, before first edit) | mnemos_premortem(plan, project) — returns how similar attempts failed; read it before proceeding |

| A non-obvious decision, pattern, or architectural call worth preserving | mnemos_save with type=decision / architecture / pattern |

| User corrects an approach: "actually no, do X because Y" | mnemos_correct(tried, wrong_because, fix) |

| A rule that should apply to the project forever: "always wrap errors with %w" | mnemos_convention(title, rule, rationale, project) |

| A file you are editing heavily and will revisit | mnemos_touch(path, project) |

| Reloading state mid-session after a context compaction | mnemos_context(session_id=..., mode="recovery") |

| Checking history before doing something you might already have figured out | mnemos_search(query, project) |

| Quick state check ("is mnemos actually recording?") | mnemos_stats |

| Linking two observations so they surface together | mnemos_link(from_id, to_id, relation) |

| At the top of a long session, or when the user questions a stored rule | mnemos_ruminate_list → pick one → mnemos_ruminate_pack |

| Replacing a weak skill or stale rule after hostile review | mnemos_ruminate_resolve(id, resolved_by, why_better) |

| Leaving a rule intact because the evidence was noise | mnemos_ruminate_dismiss(id, reason) |

What not to do

Rumination: when a stored rule looks wrong

Mnemos flags stored knowledge whose effectiveness has fallen below the threshold. These are rumination candidates and they want a hostile review, not a rubber stamp.

Trigger situations where you should check the queue:

Workflow:

  1. mnemos_ruminate_list → returns {candidates: [...], counts: {...}}. Pick one by ID.
  2. mnemos_ruminate_pack(id) → returns a review block with Hypothesis, Disconfirming evidence, Falsifiable restatement, Hostile review prompts, and an Action section. Read the block. Answer the hostile prompts honestly. The prompts are ordered: steel-man the opposite → find the fatal flaw → decide falsification vs noise → check whether context shifted → state the new prediction.
  3. Decide one of two outcomes:

Never close a candidate silently or with filler. A rumination that resolves to "no change" is either a dismissal with a real reason or a bug in the monitor — both belong in the provenance trail, not in the void.

Quick self-check

Before wrapping any multi-step session, run through this:

  1. Do I have a mnemos_session_id from the prewarm hook or mnemos_session_start? If not, call mnemos_session_start now and cite what the goal was retroactively.
  2. Is there a correction from this session? If the user said "no, do X instead", record it before they have to ask.
  3. Is there a decision worth preserving? If the answer took thinking to arrive at, save it.
  4. Did I check mnemos_ruminate_list at least once this session? If the queue had pending candidates on a topic I touched, I should have resolved or dismissed them.
  5. Did I close the session with a summary that future-me can read in a prewarm?

Output

Error Handling

Examples

Correction shape

Corrections are the atomic unit of the mnemos learning loop. Fill the fields honestly:

{
  "title": "oauth retry without backoff",
  "tried": "retry on 401",
  "wrong_because": "401 is auth failure, not transient",
  "fix": "refresh token, then retry once",
  "trigger_context": "implementing token refresh for the apollo integration",
  "project": "<repo>"
}

trigger_context is optional but valuable: it populates the ## When this applies section of the auto-promoted skill if three corrections cluster on the same label.

Save shape

{
  "title": "use modernc.org/sqlite, not mattn/go-sqlite3",
  "content": "pure-Go driver keeps the binary CGO-free and cross-compilable to linux/darwin/windows without a toolchain on the install path",
  "type": "decision",
  "rationale": "zero-CGO is a hard invariant",
  "project": "mnemos",
  "tags": ["sqlite", "build", "dependencies"],
  "importance": 8
}

Valid type values: decision | bugfix | pattern | preference | context | architecture | episodic | semantic | procedural | correction | convention.

Correction-to-skill loop

Record the same class of mistake three times across sessions:

mnemos_correct(tried="retry on 401", wrong_because="401 is auth, not transient", fix="refresh token then retry once", project="api", tags=["oauth"])
# ...two more oauth corrections in later sessions...

The next dream pass clusters the three oauth corrections and promotes a skill with ## When this applies / ## Avoid / ## Do sections. From then on it surfaces in prewarm before you touch that code path again.

Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.