
Memory
FreeEnhance context retention across coding sessions.
Free · Opens the source repo
What Memory does
Memory is a skill designed to improve the continuity of context in coding environments by storing and retrieving project-specific information across sessions. It allows developers to maintain a persistent record of decisions, user preferences, and coding conventions, which can be automatically accessed when starting a new session. This capability is particularly useful for teams or individuals working on long-term projects where consistency and adherence to established patterns are crucial.
The skill operates by reading from a local JSON file that stores memories. When a session begins, it automatically loads relevant memories, ensuring that previously established decisions and preferences are recognized without the need for re-explanation. This feature allows for a more fluid and efficient workflow, as developers can focus on their tasks rather than recalling past choices.
Memory also supports the manual addition and removal of entries, enabling users to maintain an accurate and relevant memory database. This can be done via specific commands like /remember for adding new memories and /forget for removing outdated or irrelevant ones. Additionally, it includes mechanisms for conflict resolution, ensuring that the most recent decisions take precedence while allowing users to clean up their memory entries to avoid clutter.
Overall, Memory is particularly beneficial for developers who frequently revisit projects or collaborate with teams, as it streamlines the coding process by retaining essential contextual information that would otherwise need to be re-discussed or re-established in each session.
When to use it
Use this skill when working on long-term projects or in collaborative environments where context retention is important.
When not to use it
This skill may not be suitable for short-lived projects or one-off tasks where context is not needed beyond a single session.
What you can build with it
Long-term project management
When working on a multi-phase project, Memory helps retain decisions on libraries and frameworks used, ensuring consistency.
Team collaboration
In a team setting, Memory allows all members to access shared preferences and decisions, reducing the need for repetitive discussions.
Preference tracking
Memory automatically recalls user preferences, such as coding styles or tool choices, enhancing the development experience.
How to install Memory
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/memory --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeremylongshoreMemory
Overview
Memory provides persistent context across Claude Code sessions by storing and retrieving project decisions, user preferences, and coding conventions from a local JSON file. When a new session starts, stored memories load automatically so previously established patterns carry forward without re-explanation.
Prerequisites
- Project memory file at
.claude/memories/project_memory.json(created automatically on first memory save) - Read and Write permissions for the
.claude/memories/directory - Claude Never Forgets plugin installed (
/plugin install yldrmahmet/claude-never-forgets)
Instructions
- Access stored memories. On session start, locate and read the memory file at
.claude/memories/project_memory.jsonusing the Read tool. Parse the JSON structure containing timestamped memory entries. See${CLAUDE_SKILL_DIR}/references/implementation.mdfor the full retrieval workflow. - Match memories to current context. Scan memory entries for keywords and topics relevant to the current task. Extract applicable decisions (e.g., "use pnpm instead of npm"), architectural patterns, library choices, and coding style preferences.
- Apply memories silently. Incorporate remembered preferences into responses and tool usage without announcing them. When a memory dictates a package manager, testing framework, or naming convention, follow it automatically.
- Store new memories. When significant decisions occur -- library selections, architectural choices, user-stated preferences, or tool rejections -- write them to the memory file with a timestamp. Add entries via the
/remembercommand or through automatic capture of conversation signals. - Resolve conflicts. When a stored memory contradicts a current explicit request, prioritize the current request. Flag the conflict if appropriate and update the memory entry to reflect the new decision. Remove outdated memories that no longer apply.
- Handle cleanup. When memory entries exceed 10, consolidate by removing noise (greetings, acknowledgments) and preserving high-value entries (preferences, decisions, corrections). The cleanup threshold is configurable in
hooks/stop_cleanup.py.
Output
- Automatic loading of stored memories at session start
- Silent application of remembered preferences to tool usage and responses
- New memory entries written with timestamps for significant decisions
- Consolidated memory file after cleanup (preserves important entries, removes noise)
- Explicit memory listing via
/memoriescommand
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Memory file not found | First session or file deleted | Initialize a new memory file at .claude/memories/project_memory.json with an empty JSON structure |
| Conflicting memories | Multiple entries contradict each other | Apply the most recent memory; suggest cleanup via /forget to remove outdated entries |
| Invalid memory format | File corrupted or manually edited with syntax errors | Back up the existing file, recreate with valid JSON structure, restore recoverable entries |
| Permission denied | File or directory lacks read/write permissions | Check file permissions on .claude/memories/; request necessary access or use an alternative storage location |
Examples
Automatic preference recall across sessions:
Session 1:
User: "Always use Vitest instead of Jest for this project"
→ Stored to project_memory.json
Session 2:
User: "Add tests for the auth module"
→ Memory loaded: "use Vitest instead of Jest"
→ Test files created with Vitest syntax automatically
Manual memory management:
/remember "This project uses Tailwind CSS v4 with the Vite plugin"
/remember "Deploy to Cloudflare Workers, not Vercel"
/memories # Lists all stored memories with timestamps
/forget "Vercel" # Removes the Vercel-related memory
Tool rejection captured as correction:
set -euo pipefail
User declines a suggested `npm install` action
→ Memory stored: "User prefers pnpm over npm"
→ Future sessions use pnpm automatically
Resources
${CLAUDE_SKILL_DIR}/references/implementation.md-- Step-by-step guide for accessing, applying, updating, and resolving memory conflicts${CLAUDE_SKILL_DIR}/references/errors.md-- Detailed error scenarios with recovery procedures/remember [text]-- Add a new memory entry manually/forget [text]-- Remove a matching memory from storage/memories-- Display all currently stored memories with timestamps
Frequently asked questions about Memory
Similar skills
Spring Boot Testing
Master testing techniques for Spring Boot 4 applications.
GitHub Issues
Manage GitHub issues efficiently with MCP tools.
Geofeed Tuner
Optimize your IP geolocation feeds in CSV format.
Batch Files
Master Windows batch scripting for automation and task management.
Adobe Illustrator Scripting
Automate your Illustrator workflows with ExtendScript.
Plugin Structure
Create and organize Claude Code plugins effectively.
