memory-and-plans

memory-and-plans is a skill for Claude Code, Codex from w2ur/claude-code-setup. It costs 70 tokens per session (863 once invoked), scanned A, original, MIT.

A guide to the two places where this setup stores long-term knowledge: shared project memory and memory belonging to one coding agent. It also explains where work plans are stored and how memory settings choose a location.

In plain words
What is it for?
Use it when creating, moving, combining, excluding from Git, or proposing storage for memory and plans.
Why use it?
It prevents memory from being duplicated, put in the wrong project, committed to source control, or confused with a work plan.

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/w2ur/claude-code-setup/memory-and-plans
Any agent
npx skills add w2ur/claude-code-setup --skill memory-and-plans
Clone the repo
git clone --depth 1 https://github.com/w2ur/claude-code-setup

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 memory-and-plans

README.md
[![agentmods](https://agentmods.dev/badge/skills/w2ur/claude-code-setup/memory-and-plans.svg)](https://agentmods.dev/skills/w2ur/claude-code-setup/memory-and-plans)
Your own site
<a href="https://agentmods.dev/skills/w2ur/claude-code-setup/memory-and-plans"><img src="https://agentmods.dev/badge/skills/w2ur/claude-code-setup/memory-and-plans.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 863 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.00070 $0.00863
Opus 5 $0.00035 $0.00432
Sonnet 5 $0.00014 $0.00173
Haiku 4.5 $0.00007 $0.00086

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

Security

Grade A, and why

memory-and-plans 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 3d 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.

skills/memory-and-plans/SKILL.md · 85 lines

How it starts

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

Memory and plans — the reasons

The rules live in ~/.claude/CLAUDE.md. This skill holds the mechanics.

Two systems, one role each

system location holds
auto-memory ~/.claude/projects/-Users-{username}-Dev/memory/, indexed by MEMORY.md session handoffs, durable cross-session knowledge — user preferences, project state, feedback
per-agent memory <project root>/.claude/agent-memory/<agent>/ operational knowledge scoped to ONE agent: patterns, past corrections in that agent's domain

Do not duplicate across them.

Do not call auto-memory "agent memory". The bare phrase collides with the per-agent system's actual name and has caused real confusion.

Plans are not a memory system. They live in ~/.claude/plans/, never in a repo.

How the memory: frontmatter key resolves

An agent definition's memory: key resolves as:

value resolves to
user ~/.claude/agent-memory/<agent>/
project <project root>/.claude/agent-memory/<agent>/
local <project root>/.claude/agent-memory-local/<agent>/

Every agent that declares it declares project. None declares user.

Why per-agent stores are scattered, and why that is correct

Because the key resolves against the project root of the session that ran, a store appears wherever a session's project root happened to be:

  • one per repo
  • plus one per nested working directory a session was launched from (e.g. <repo>/client/)
  • plus one per worktree

Anything under ~/.claude/agent-memory/ is residue from sessions whose project root was ~/.claude — not a separate tier.

Do not "consolidate" them upward. That fights the resolver, and the agent will simply not find what you moved.

Per-agent memory must never be committed

The harness default-ignores only agent-memory-local/, not agent-memory/. So a repo trusting that default will happily stage its memory files.

Every repo with a store needs .claude/ — or at minimum .claude/agent-memory/ — in .gitignore.

Read the full file on GitHub · 85 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. 3d ago First seen · 85 lines · 70 tokens per session scan A 3355ebbefe16

Subscribe to this mod's changes

memory-and-plans is a skill published in the GitHub repository w2ur/claude-code-setup (2 stars, last pushed 10d ago), licensed MIT. It adds 70 tokens to every session and 863 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

spec-kitty-charter-doctrine

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…

Priivacy-ai/spec-kitty · 135 tokens

flow-next-tracker-sync

Project a flow-next spec to a tracker issue (Linear, GitHub, GitLab, Jira) and reconcile two-way. Use when asked to sync to a tracker. NOT plan-sync.

gmickel/flow-next · 44 tokens

flow-next-export-context

Export RepoPrompt context to a markdown file for review with an external LLM (ChatGPT, Claude web, etc.). Use when you want Carmack-level review but prefer an external model. Triggers on "export context", "export for external review", "export plan for ChatGPT", "export impl review context", "review with an external…

gmickel/flow-next · 81 tokens

spk-team-auth

Handle Spec Kitty team authentication, hosted credentials, account selection, and auth-related recovery.

Priivacy-ai/spec-kitty · 22 tokens

AI SDK Documentation

This skill should be used when working with Vercel AI SDK, AI Gateway, streamText, generateText, generateObject, streamObject, tool calling, or AI SDK providers. Also relevant for "ai-sdk", "@ai-sdk/" packages, or questions about AI SDK patterns, configuration, and best practices.

malob/nix-config · 68 tokens

trellis-brainstorm

Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex…

mindfold-ai/Trellis · 65 tokens