memory

A review workflow for deciding which facts from past AI coding sessions are useful enough to keep as long-term project memory. It mines session records, groups similar candidates, and asks for confirmation.

In plain words
What is it for?
Use it to mine session history, review possible durable facts, compare similar memory entries, and approve or merge the facts worth retaining.
Why use it?
It reduces repeated context gathering while avoiding the automatic storage of facts that only applied to one old session.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nicknisi/sessions/memory
Any agent
npx skills add nicknisi/sessions --skill memory
Clone the repo
git clone --depth 1 https://github.com/nicknisi/sessions

Made for: Claude Code, Codex.

Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,985 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00087 $0.02985
Opus 5 $0.00044 $0.01492
Sonnet 5 $0.00017 $0.00597
Haiku 4.5 $0.00009 $0.00298

Measured 2d ago against content hash 707eb1aaf995, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/memory/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Turn mined candidate turns into a small set of durable facts worth remembering.

Steps

  1. Run the mine. sessions memory mine --repo <path> --json (omit --repo for the current repo; --all mines every repo in the index; add --since-last to mine only transcripts that changed since the previous mine, which is what the weekly summary uses). stdout is a JSON array of candidate records; progress goes to stderr. If the command is not found, say so and stop — do not substitute a search. If the array is empty, say there is nothing to triage and stop; never invent candidates.

  2. Confirm fuzzy paraphrase pairs. sessions memory report --repo <path> --json (same scoping flags as the mine) returns a fuzzy array: freshly mined clusters that look like paraphrases of an APPROVED memory but scored below the binary's assert threshold. The binary deliberately does not make this judgment — you do. Present each pair (cluster.text ~ memory.text, with its similarity and session count) and ask confirm/deny, batched with the triage questions in step 7 rather than as a separate interrogation. If the array is empty, move on.

    • Confirmsessions memory merge <memory-id> <cluster-id> — the approved memory is the canonical, the new phrasing folds into it. This is the same write-back as step 8's clustering merge: future mines recognize the phrasing as accounted for, and the pair stops appearing in the report. If merge exits non-zero on an unknown id, run sessions memory mine --repo <path> first and retry — report reads fresh evidence without persisting it, and merge only knows ids the store holds.
    • Denysessions memory snooze <cluster-id>. Reject would kill the fact itself, which is terminal and wrong when the fact is real; snooze is the suppression that persists the dismissal without a verdict. The report's pipeline drops suppressed clusters before classifying, so the denied pair goes quiet on later runs instead of being re-asked every triage. If snooze exits non-zero on an unknown id, run sessions memory mine --repo <path> first and retry, exactly as with merge. A denied pair resurfaces only the way any snooze does — a later merge folding in a new phrasing after the 30 days pass, which the current mine never produces, so in practice the denial holds until the clustering evidence changes.
  3. Cluster paraphrases. Group candidates whose texts assert the same fact in different words — "use canary as the base branch" and "we branch off canary" are one memory in two phrasings. A cluster's distinctPhrasings is the number of distinct member texts. Keep the clearest phrasing as the cluster's text; the rest are evidence, not separate memory. Byte-identical repeats were already collapsed upstream, so every member you see is genuinely a different wording.

  4. Read what is already binding. sessions memory documented --json lists every statement an agent working here is already told — the global CLAUDE.md, a repo CLAUDE.md or AGENTS.md, and Claude Code's own per-project memory store. Read it before the rubric, because it decides the rubric's first question.

    These are read, never written. This store complements those surfaces; it does not replace, edit, or override them.

    Other agents' stores are candidates, not gospel. If the user asks to pull in what another agent remembers — pi-hermes-memory's store, Claude's CLAUDE.md files — run sessions memory import --from pi-hermes (or claude, or all) FIRST, before mining: those facts land in the candidate batch you are about to triage, marked by their lack of session evidence. Triage them through the same rubric below; the review_agent_memories MCP tool previews what would import and flags entries that overlap memories already in the store (similarTo), and get_memory_sources inventories what stores exist. A pi-hermes fact scoped to a bare project name arrives unbound — bind it with --scope repo:. when you approve it, or reject it if the project is gone.

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 80 lines · 87 tokens per session scan A 707eb1aaf995

Subscribe to this mod's changes

memory is a skill published in the GitHub repository nicknisi/sessions (28 stars, last pushed 7d ago), licensed MIT. It adds 87 tokens to every session and 2,985 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

code-review

Review seekdb pull requests and diffs for high-signal correctness, resource-lifetime, concurrency, current-version state-consistency, credential-exposure, workflow-security, performance, and test-evidence defects. Use when reviewing changes to seekdb C++, Rust, build, CI, or test code; report only actionable Blocker…

oceanbase/seekdb · 82 tokens

ygrep

IMPORTANT: Try ygrep FIRST for all code and file searches before using Grep, Glob, or Task explore. ygrep uses a pre-built full-text index and returns results in milliseconds. Fall back to built-in tools only if ygrep returns no results.

yetidevworks/ygrep · 55 tokens

mikke

ノートフォルダ (Markdown KB) を mikke CLI で検索する。「○○について調べて」「過去のメモは?」「以前どう解決したか」等、過去の知見・記録を引き出す時に起動。最新仕様・時事・バージョン依存の質問では起動しない (Web が真)。.

kimushun1101/mikke · 87 tokens

dowse

Search the user's local files with dowse, a Windows full-text search index (Chinese + English, PDF/txt/md/code). Use this when the user asks you to find something on their disk — a note, a doc, a config, "that file about X" — instead of grepping the whole filesystem.

ltspace/dowse · 67 tokens

docingest-docs

Find, search, and read approved documentation snapshots through DocIngest.

Amal-David/docingest · 20 tokens

session-recall

Recall past AI coding sessions as long-term memory. Use at the START of any non-trivial task, and whenever the user references earlier work ("like we did before", "the X we set up", "last time", "that bug fix"), asks who/when a file was changed, or you need context that predates this conversation. Runs the local…

youdie006/sessionwiki · 103 tokens