memory-management
Persistent memory management for Claude Code via AutoMem. Use this skill when: - Starting a session (recall project context, decisions, patterns) - Making architectural decisions or library choices - Fixing bugs (store root cause and solution) - Learning user preferences or code style - Completing significant work (store summary) - Debugging issues (search for similar past problems)
What this skill does
# Memory Management Skill
Use AutoMem to maintain persistent context across Claude Code sessions. This skill teaches the **3-Phase Memory Pattern**: Recall → Store → Summarize.
## Phase 1: SESSION START (Recall)
### Always Recall For
- Project context questions (architecture, tooling, deployment)
- Architecture discussions or decisions
- User preferences and code style
- Debugging issues (search for similar past problems)
- Refactoring (understand why current structure exists)
- Integration or API work (check past implementations)
- Performance optimization discussions
### Adaptive Recall Based on Context
- **Files open** → Recall memories tagged with those components
- **Error messages** → Search for similar error patterns
- **Multiple files** → Recall architectural decisions
- **PR/commit context** → Recall related feature implementations
### Skip Recall For
- Pure syntax questions ("How does Array.map work?")
- Trivial edits (typos, formatting, simple renames)
- Direct factual queries about current code
- File content requests that can be answered by reading
### Recall Examples
```javascript
// Basic project recall
mcp__memory__recall_memory({
query: "project architecture decisions",
tags: ["project-name"],
limit: 5
})
// Debug similar errors
mcp__memory__recall_memory({
query: "TypeError authentication timeout",
tags: ["bug-fix"],
time_query: "last 30 days",
limit: 5
})
// Multi-hop reasoning (find related context)
mcp__memory__recall_memory({
query: "Who worked on the auth system?",
expand_entities: true,
limit: 10
})
// Context-aware coding recall
mcp__memory__recall_memory({
query: "error handling patterns",
language: "typescript",
context: "coding-style",
context_types: ["Style", "Pattern"]
})
```
## Phase 2: DURING WORK (Store)
### What to Store with Importance Levels
| Type | Importance | When to Store |
|------|------------|---------------|
| **Decision** | 0.9 | Architecture, library choices, pattern decisions |
| **Insight** | 0.8 | Root cause discoveries, key learnings, bug fixes |
| **Pattern** | 0.7 | Reusable approaches, best practices |
| **Preference** | 0.6-0.8 | User config choices, style preferences |
| **Context** | 0.5-0.7 | Feature summaries, refactoring notes |
### Storage Format
```text
Content: "Brief title. Context and details. Impact/outcome."
Tags: [project-name, component, YYYY-MM, type]
Type: Decision | Pattern | Insight | Preference | Style | Habit | Context
```
### Storage Examples
**Decision:**
```javascript
mcp__memory__store_memory({
content: "Chose PostgreSQL over MongoDB. Need ACID guarantees for transactions. Impact: Ensures data consistency.",
type: "Decision",
tags: ["myapp", "database", "decision", "2025-12"],
importance: 0.9,
metadata: {
alternatives_considered: ["MongoDB", "DynamoDB"],
deciding_factors: ["ACID", "relationships", "team_expertise"]
}
})
```
**Bug Fix:**
```javascript
mcp__memory__store_memory({
content: "Auth timeout on slow connections. Root: Missing retry logic. Solution: Added exponential backoff with 3 retries.",
type: "Insight",
tags: ["myapp", "auth", "bug-fix", "2025-12"],
importance: 0.8,
metadata: {
error_signature: "TimeoutError: Authentication request timed out",
solution_pattern: "exponential-backoff-retry",
files_modified: ["src/auth/client.ts"]
}
})
```
**User Preference:**
```javascript
mcp__memory__store_memory({
content: "User prefers early returns over nested conditionals in validation code.",
type: "Preference",
tags: ["preferences", "code-style", "2025-12"],
importance: 0.8
})
```
### After Storing: Create Associations
Link related memories to build a knowledge graph:
```javascript
mcp__memory__associate_memories({
memory1_id: "new-memory-id",
memory2_id: "related-memory-id",
type: "DERIVED_FROM", // or LEADS_TO, EVOLVED_INTO, RELATES_TO
strength: 0.9
})
```
**Relationship Types:**
- `LEADS_TO` - Bug → Solution, Problem → Fix
- `EVOLVED_INTO` - Updated approaches or decisions
- `DERIVED_FROM` - Implementation from planning
- `EXEMPLIFIES` - Concrete examples of patterns
- `CONTRADICTS` - Conflicting approaches
- `REINFORCES` - Supporting evidence
- `INVALIDATED_BY` - Obsoleted solutions
- `RELATES_TO` - General connections
## Phase 3: SESSION END (Summarize)
Store a session summary when:
- Multiple files modified
- Significant refactoring completed
- New features implemented
- Important decisions made
```javascript
mcp__memory__store_memory({
content: "Added authentication system with JWT. Supports login, logout, and token refresh. Impact: Users can now login securely.",
type: "Context",
tags: ["myapp", "auth", "feature", "2025-12"],
importance: 0.9,
metadata: {
files_modified: ["src/auth/UserAuth.ts", "src/middleware/auth.ts"],
feature: "authentication"
}
})
```
## Best Practices
### Do
- Load context automatically at session start
- Store high-signal events (decisions, bugs, patterns)
- Create specific relationship types (not just RELATES_TO)
- Include rich metadata in every memory
- Present recalled information naturally
- Tag consistently: project, component, type, YYYY-MM
### Don't
- Store secrets, API keys, or sensitive data
- Store trivial changes (typos, formatting)
- Create associations without verifying relevance
- Skip tagging or use inconsistent formats
- Announce "I'm searching my memory" constantly
- Store large code blocks (store patterns/decisions instead)
## Natural Integration
When recalling memories, weave context seamlessly into responses. Avoid robotic phrases like "searching my memory database" - present memories as if you've always known them.
**Bad:** "Let me search my memory... I found that you previously decided to use PostgreSQL."
**Good:** "Since you chose PostgreSQL for its ACID guarantees, we should use transactions here."
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.