Agent memory controls what an agent remembers across sessions. Use memory scopes to give agents project-specific recall, user-wide patterns, or ephemeral session-only context.
// In SessionEnd hook or via [LEARN] tagsimport { createStore } from 'pro-workflow';const store = createStore();store.addLearning({ project: process.env.PROJECT_NAME, category: 'Architecture', rule: 'Split large components into smaller ones', mistake: 'Created 500-line component', correction: 'Extracted 3 sub-components'});store.close();
---name: orchestratordescription: Multi-phase development with project memorytools: ["Read", "Glob", "Grep", "Bash", "Edit", "Write"]skills: ["pro-workflow"]model: opusmemory: project---# OrchestratorRecalls from previous sessions:- How we structured features- What testing approach we use- Which files typically change together- Past mistakes and correctionsApplies learned patterns to new features.
---name: debuggerdescription: Systematic debugging with user memorytools: ["Read", "Grep", "Bash"]model: opusmemory: user---# DebuggerRecalls from all projects:- Common bug patterns (off-by-one, null checks, race conditions)- Debugging techniques that worked- Tools and commands that helpApplies cross-project debugging knowledge.
---name: temp-explorerdescription: One-time exploration with no persistencetools: ["Read", "Glob", "Grep"]model: haikumemory: localpermissionMode: auto---# Temp ExplorerExplore without storing findings.Memory is session-only.
# Project memorycat .claude/memory/orchestrator/memory.md# User memorycat ~/.claude/memory/reviewer/memory.md# Via databasesqlite3 ~/.pro-workflow/data.db \ "SELECT * FROM learnings WHERE project = '$(basename $PWD)' ORDER BY created_at DESC LIMIT 10;"
# Clear project memory for agentrm -rf .claude/memory/orchestrator/# Clear user memory for agentrm -rf ~/.claude/memory/reviewer/# Clear database learnings for projectsqlite3 ~/.pro-workflow/data.db \ "DELETE FROM learnings WHERE project = '$(basename $PWD)';"
Clearing memory is irreversible. Export learnings first if you want a backup.