agent-memory

agent-memory is a skill for Claude Code, Codex from JKHeadley/instar. It costs 0 tokens per session (1,878 once invoked), scanned B, original, MIT.

A set of instructions for giving Claude Code persistent project memory through a MEMORY.md file and optional topic files. Claude Code normally starts each session without knowledge of earlier conversations.

In plain words
What is it for?
It helps record project conventions, tools, scripts, user preferences, debugging notes, deployment details, and other information the agent should reuse later.
Why use it?
It prevents useful project facts, learned commands, preferences, and debugging discoveries from being forgotten when a session ends.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions Claude Code.

Good fit It helps record project conventions, tools, scripts, user preferences, debugging notes, deployment details, and other information the agent should reuse later.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jkheadley/instar/agent-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 JKHeadley/instar --skill agent-memory
Clone the repo
git clone --depth 1 https://github.com/JKHeadley/instar

Made for: Claude Code, Codex.

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 agent-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/jkheadley/instar/agent-memory/github.svg)](https://agentmods.dev/skills/jkheadley/instar/agent-memory)
Your own site
<a href="https://agentmods.dev/skills/jkheadley/instar/agent-memory"><img src="https://agentmods.dev/badge/skills/jkheadley/instar/agent-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 agent-memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/jkheadley/instar/agent-memory"><img src="https://agentmods.dev/badge/skills/jkheadley/instar/agent-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,878 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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: 3 findings, up to high

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 →

  • high Agent Snooping · line 159
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 172
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • medium MCP Rug Pull · line 258
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00000 $0.01878
Opus 5.5 $0.00000 $0.00751
Sonnet 5.5 $0.00000 $0.00376
Haiku 4.5 $0.00000 $0.00188

Measured 1mo ago against content hash 35d6b194efbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

agent-memory scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat >> .claude/MEMORY.md << 'EOF'
skills/agent-memory/SKILL.md · 262 lines

How it starts

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

agent-memory — Cross-Session Memory Patterns for Claude Code

Claude Code has no memory between sessions by default. Every conversation starts blank. But a project's knowledge accumulates — commands discovered, patterns debugged, preferences revealed, mistakes made and corrected. Without persistence, that knowledge is lost every time the window closes.

This skill establishes a simple, durable memory pattern using a single file: MEMORY.md.


The Core Pattern

One file. Written by the agent. Read at session start.

.claude/
  MEMORY.md          # The agent's persistent knowledge base
  identity/          # Optional: separate identity files (see agent-identity skill)
  memory/            # Optional: topic files as memory grows
    debugging.md
    deployment.md
    user-preferences.md

Setting Up MEMORY.md

Create .claude/MEMORY.md with this structure:

# [Project/Agent] Memory

> This file persists across sessions. Write here when you learn something
> worth remembering. Remove entries that become outdated. Keep it useful,
> not comprehensive.

## Project Patterns

[Commands, scripts, conventions specific to this project]

## Tools & Scripts

[Purpose-built scripts and how to invoke them]

## Lessons Learned

[Mistakes made and corrections. Dated entries.]

## User Preferences

[Communication style, workflow preferences, discovered through interaction]

## Open Questions

[Unresolved things to investigate — remove when resolved]

Then add this to your CLAUDE.md:

## Memory

At the start of every session, read `.claude/MEMORY.md` before doing any work.
After context compaction, re-read it immediately.

When you learn something worth keeping, write it to MEMORY.md before the session ends.

What to Write vs. What to Skip

The most common mistake: writing everything, making the file so long it stops being read carefully.

Write to MEMORY.md:

  • Project-specific commands, especially non-obvious ones
    • "Run npm run build:prod not npm run build — the latter overwrites staging"
  • Scripts you built and their locations
    • ".claude/scripts/check-email.py — reads Gmail unread, takes --limit flag"
  • Mistakes made once that shouldn't happen again
    • "2025-03-12: Pushed to main while on detached HEAD. Always verify branch before committing."
  • User preferences discovered through interaction, not assumed
    • "Prefers Telegram summaries over file links"
  • Patterns that took time to figure out
    • "Prisma requires explicit include for relations — no auto-eager-loading"

Read the full file on GitHub · 262 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 · 262 lines · 0 tokens per session scan B 35d6b194efbc

Subscribe to this mod's changes

agent-memory is a skill published in the GitHub repository JKHeadley/instar (84 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,878 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.