memory

memory is a skill for Claude Code from nicknisi/sessions. It costs 87 tokens per session (2,985 once invoked), scanned A, original, MIT.

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 Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Part of the sessions plugin — 8 skills, 1 MCP server shipped together

Good fit Use it to mine session history, review possible durable facts, compare similar memory entries, and approve or merge the facts worth retaining.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nicknisi/sessions/memory
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.

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.

Or install sessions, the plugin that ships this one along with the rest of its 8 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicknisi/sessions/memory/github.svg)](https://agentmods.dev/skills/nicknisi/sessions/memory)
Your own site
<a href="https://agentmods.dev/skills/nicknisi/sessions/memory"><img src="https://agentmods.dev/badge/skills/nicknisi/sessions/memory/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/nicknisi/sessions/memory"><img src="https://agentmods.dev/badge/skills/nicknisi/sessions/memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 39
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.1 $0.00087 $0.02985
Opus 5.5 $0.00035 $0.01194
Sonnet 5.5 $0.00017 $0.00597
Haiku 4.5 $0.00009 $0.00298

Measured 1mo ago against content hash 707eb1aaf995, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

    • Confirm → sessions 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.
    • Deny → sessions 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. 1mo 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 (39 stars, last pushed 10d ago), licensed MIT. It adds 87 tokens to every session and 2,985 once invoked, about $0.0003 per session on Opus 5.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.