Remember - Store Decisions and Patterns
Filesystem vs MCP memory (Opus 5 guidance, CC 2.1.111+): Opus 5 reads filesystem memory reliably across multi-session work. Use that to your advantage:
- Short-lived handoff state (current phase, task in-progress, pending approvals) →
.claude/chain/*.json files. Small, structured, session-scoped.
- Durable auto-memory (user facts, feedback, project conventions) →
~/.claude/projects/<slug>/memory/*.md files with a one-line index in MEMORY.md. Read on every session start.
- Cross-session knowledge graph (typed entities + relations for query traversal) → MCP memory server (this skill's default path). Best when future sessions will search for patterns.
The three are complementary, not alternatives. Prefer fs for anything you'd want to grep; prefer MCP for anything you'd want to traverse.
Store important decisions, patterns, or context in the knowledge graph for future sessions. Supports tracking success/failure outcomes for building a Best Practice Library.
Argument Resolution
TEXT = "$ARGUMENTS" # Full argument string, e.g., "We use cursor pagination"
FLAG = "$ARGUMENTS[0]" # First token — check for --success, --failed, --category, --agent
# Parse flags from $ARGUMENTS[0], $ARGUMENTS[1] etc. (CC 2.1.59 indexed access)
# Remaining tokens after flags = the text to remember
Architecture
The remember skill uses knowledge graph as storage:
- Knowledge Graph: Entity and relationship storage via
mcp__memory__create_entities and mcp__memory__create_relations - FREE, zero-config, always works
Benefits:
- Zero configuration required - works out of the box
- Explicit relationship queries (e.g., "what does X use?")
- Cross-referencing between entities
- No cloud dependency
Automatic Entity Extraction:
- Extracts capitalized terms as potential entities (PostgreSQL, React, pgvector)
- Detects agent names (database-engineer, backend-system-architect)
- Identifies pattern names (cursor-pagination, connection-pooling)
- Recognizes "X uses Y", "X recommends Y", "X requires Y" relationship patterns
Usage
Store Decisions (Default)
/ork:remember <text>
/ork:remember --category <category> <text>
/ork:remember --success <text> # Mark as successful pattern
/ork:remember --failed <text> # Mark as anti-pattern
/ork:remember --success --category <category> <text>
# Agent-scoped memory
/ork:remember --agent <agent-id> <text> # Store in agent-specific scope
/ork:remember --global <text> # Store as cross-project best practice
Flags
| Flag |
Behavior |
| (default) |
Write to graph |
--success |
Mark as successful pattern |
--failed |
Mark as anti-pattern |
--category <cat> |
Set category |
--agent <agent-id> |
Scope memory to a specific agent |
--global |
Store as cross-project best practice |
Categories
decision - Why we chose X over Y (default)
architecture - System design and patterns
pattern - Code conventions and standards
blocker - Known issues and workarounds
constraint - Limitations and requirements
preference - User/team preferences
pagination - Pagination strategies
database - Database patterns
authentication - Auth approaches
api - API design patterns
frontend - Frontend patterns
performance - Performance optimizations
Outcome Flags
--success - Pattern that worked well (positive outcome)
--failed - Pattern that caused problems (anti-pattern)
If neither flag is provided, the memory is stored as neutral (informational).
Workflow
1. Parse Input
Check for --success flag → outcome: success
Check for --failed flag → outcome: failed
Check for --category <category> flag
Check for --agent <agent-id> flag → agent_id: "ork:{agent-id}"
Check for --global flag → use global user_id
Extract the text to remember
If no category specified, auto-detect from content
2. Auto-Detect Category
| Keywords |
Category |
| chose, decided, selected |
decision |
| architecture, design, system |
architecture |
| pattern, convention, style |
pattern |
| blocked, issue, bug, workaround |
blocker |
| must, cannot, required, constraint |
constraint |
| pagination, cursor, offset, page |
pagination |
| database, sql, postgres, query |
database |
| auth, jwt, oauth, token, session |
authentication |
| api, endpoint, rest, graphql |
api |
| react, component, frontend, ui |
frontend |
| performance, slow, fast, cache |
performance |
3. Extract Lesson (for anti-patterns)
If outcome is "failed", look for:
- "should have", "instead use", "better to"
- If not found, prompt user: "What should be done instead?"
4-6. Extract Entities and Create Graph
Extract entities (Technology, Agent, Pattern, Project, AntiPattern) from the text, detect relationship patterns ("X uses Y", "chose X over Y", etc.), then create entities and relations in the knowledge graph.
7. Confirm Type + Scope (AskUserQuestion — M118 #1466)
Auto-classification is best-effort. Before writing, ask the user to confirm both the memory type and the persistence scope. Pre-select the auto-detected type as the default option when the classifier is confident (≥0.9):
# Skip when the invocation already specifies type and scope:
# /ork:remember --type=preference --global → skip, use those values
# /ork:remember --session → skip, no persistence
#
# Otherwise, ask both:
AskUserQuestion(questions=[
{"question": "What type of memory?",
"header": "Type",
"options": [
{"label": "Preference", "description": "How I like to work (style, format, tooling)"},
{"label": "Project fact", "description": "State of THIS codebase (decisions, constraints)"},
{"label": "Reference", "description": "External system pointer (URL, doc, dashboard)"},
{"label": "Feedback", "description": "Correction to future behavior — applied as a rule"}
]},
{"question": "Apply to?",
"header": "Scope",
"options": [
{"label": "This project (default)", "description": "Scoped to .claude/projects/<this-project>/memory/"},
{"label": "All projects (global)", "description": "User-level memory at ~/.claude/memory/"},
{"label": "This session only", "description": "Print to context but don't persist"}
]}
])
Default selection rules:
- If auto-detected category maps to one of the 4 type options with confidence ≥0.9, that option is pre-selected (the user can still override).
- "This project" is always the scope default.
- "This session only" returns immediately without writing — useful when the user wants to surface a fact for the conversation but not commit it.
Global memory writes route to ~/.claude/memory/<filename>.md instead of the project-local memory directory. The MEMORY.md index is updated in whichever scope was selected (project- or user-level).
Load entity extraction rules, type assignment, relationship patterns, and graph creation examples: Read("references/graph-operations.md")
7. Confirm Storage
Display confirmation using the appropriate template (success, anti-pattern, or neutral) showing created entities, relations, and graph stats.
Load output templates and examples: Read("references/confirmation-templates.md")
File-Based Memory Updates
When updating .claude/memory/MEMORY.md or project memory files:
- PREFER Edit over Write to preserve existing content and avoid overwriting
- Use stable anchor lines:
## Recent Decisions, ## Patterns, ## Preferences
- See the
memory skill's "Permission-Free File Operations" section for the full Edit pattern
- This applies to the calling agent's file operations, not to the knowledge graph operations above
References
Load on demand with Read("references/<file>"):
| File |
Content |
category-detection.md |
Auto-detection rules for categorizing memories (priority order) |
graph-operations.md |
Entity extraction, type assignment, relationship patterns, graph creation |
confirmation-templates.md |
Output templates (success, anti-pattern, neutral) and usage examples |
Related Skills
ork:memory - Search, load, sync, visualize (read-side operations)
Error Handling
- Knowledge graph unavailable → show configuration instructions
- Empty text → ask user for content; text >2000 chars → truncate with notice
- Both --success and --failed → ask user to clarify
- Entity extraction fails → create generic Decision entity; relation fails → create entities first, retry
1---
2name: remember
3license: MIT
4compatibility: "Claude Code 2.1.251+. Requires memory MCP server."
5description: "Stores decisions, patterns, and outcomes in the MCP memory knowledge graph as entities with typed observations and relations. Supports recording architectural decisions, anti-patterns, tool preferences, workflow outcomes, and project conventions that persist across sessions. Use when saving patterns, remembering outcomes, recording decisions, or building institutional knowledge."
6argument-hint: "[decision-or-pattern]"
7context: inherit
8version: 3.0.1
9author: OrchestKit
10tags: [memory, decisions, patterns, best-practices, graph-memory]
11user-invocable: true
12allowed-tools: [Read, Grep, Glob, Bash, AskUserQuestion, mcp__memory__create_entities, mcp__memory__create_relations, mcp__memory__add_observations, mcp__memory__search_nodes]
13complexity: low
14persuasion-type: collaborative
15effort: low
16model: haiku
17metadata:
18 source: https://skillmd.com/skills/yonatangross/remember
19 category: workflow-automation
20 mcp-server: memory
21triggers:
22 keywords: [remember, save, store, record, "best practice", "anti-pattern", "lets not forget", "mark this"]
23 examples:
24 - "remember that we chose Postgres over MongoDB"
25 - "save this decision: always use cursor-based pagination"
26 - "store this pattern as a best practice"
27 anti-triggers: [recall, search, "show memory", "knowledge graph", "load context", explore]
28---
29
30# Remember - Store Decisions and Patterns
31
32> **Filesystem vs MCP memory (Opus 5 guidance, CC 2.1.111+):** Opus 5 reads filesystem memory reliably across multi-session work. Use that to your advantage:
33> - **Short-lived handoff state** (current phase, task in-progress, pending approvals) → `.claude/chain/*.json` files. Small, structured, session-scoped.
34> - **Durable auto-memory** (user facts, feedback, project conventions) → `~/.claude/projects/<slug>/memory/*.md` files with a one-line index in `MEMORY.md`. Read on every session start.
35> - **Cross-session knowledge graph** (typed entities + relations for query traversal) → MCP memory server (this skill's default path). Best when future sessions will *search* for patterns.
36>
37> The three are complementary, not alternatives. Prefer fs for anything you'd want to grep; prefer MCP for anything you'd want to traverse.
38
39Store important decisions, patterns, or context in the knowledge graph for future sessions. Supports tracking success/failure outcomes for building a Best Practice Library.
40
41## Argument Resolution
42
43```python
44TEXT = "$ARGUMENTS" # Full argument string, e.g., "We use cursor pagination"
45FLAG = "$ARGUMENTS[0]" # First token — check for --success, --failed, --category, --agent
46# Parse flags from $ARGUMENTS[0], $ARGUMENTS[1] etc. (CC 2.1.59 indexed access)
47# Remaining tokens after flags = the text to remember
48```
49
50## Architecture
51
52The remember skill uses **knowledge graph** as storage:
53
541. **Knowledge Graph**: Entity and relationship storage via `mcp__memory__create_entities` and `mcp__memory__create_relations` - FREE, zero-config, always works
55
56**Benefits:**
57- Zero configuration required - works out of the box
58- Explicit relationship queries (e.g., "what does X use?")
59- Cross-referencing between entities
60- No cloud dependency
61
62**Automatic Entity Extraction:**
63- Extracts capitalized terms as potential entities (PostgreSQL, React, pgvector)
64- Detects agent names (database-engineer, backend-system-architect)
65- Identifies pattern names (cursor-pagination, connection-pooling)
66- Recognizes "X uses Y", "X recommends Y", "X requires Y" relationship patterns
67
68## Usage
69
70### Store Decisions (Default)
71```
72/ork:remember <text>
73/ork:remember --category <category> <text>
74/ork:remember --success <text> # Mark as successful pattern
75/ork:remember --failed <text> # Mark as anti-pattern
76/ork:remember --success --category <category> <text>
77
78# Agent-scoped memory
79/ork:remember --agent <agent-id> <text> # Store in agent-specific scope
80/ork:remember --global <text> # Store as cross-project best practice
81```
82
83## Flags
84
85| Flag | Behavior |
86|------|----------|
87| (default) | Write to graph |
88| `--success` | Mark as successful pattern |
89| `--failed` | Mark as anti-pattern |
90| `--category <cat>` | Set category |
91| `--agent <agent-id>` | Scope memory to a specific agent |
92| `--global` | Store as cross-project best practice |
93
94## Categories
95
96- `decision` - Why we chose X over Y (default)
97- `architecture` - System design and patterns
98- `pattern` - Code conventions and standards
99- `blocker` - Known issues and workarounds
100- `constraint` - Limitations and requirements
101- `preference` - User/team preferences
102- `pagination` - Pagination strategies
103- `database` - Database patterns
104- `authentication` - Auth approaches
105- `api` - API design patterns
106- `frontend` - Frontend patterns
107- `performance` - Performance optimizations
108
109## Outcome Flags
110
111- `--success` - Pattern that worked well (positive outcome)
112- `--failed` - Pattern that caused problems (anti-pattern)
113
114If neither flag is provided, the memory is stored as neutral (informational).
115
116## Workflow
117
118### 1. Parse Input
119
120```
121Check for --success flag → outcome: success
122Check for --failed flag → outcome: failed
123Check for --category <category> flag
124Check for --agent <agent-id> flag → agent_id: "ork:{agent-id}"
125Check for --global flag → use global user_id
126Extract the text to remember
127If no category specified, auto-detect from content
128```
129
130### 2. Auto-Detect Category
131
132| Keywords | Category |
133|----------|----------|
134| chose, decided, selected | decision |
135| architecture, design, system | architecture |
136| pattern, convention, style | pattern |
137| blocked, issue, bug, workaround | blocker |
138| must, cannot, required, constraint | constraint |
139| pagination, cursor, offset, page | pagination |
140| database, sql, postgres, query | database |
141| auth, jwt, oauth, token, session | authentication |
142| api, endpoint, rest, graphql | api |
143| react, component, frontend, ui | frontend |
144| performance, slow, fast, cache | performance |
145
146### 3. Extract Lesson (for anti-patterns)
147
148If outcome is "failed", look for:
149- "should have", "instead use", "better to"
150- If not found, prompt user: "What should be done instead?"
151
152### 4-6. Extract Entities and Create Graph
153
154Extract entities (Technology, Agent, Pattern, Project, AntiPattern) from the text, detect relationship patterns ("X uses Y", "chose X over Y", etc.), then create entities and relations in the knowledge graph.
155
156### 7. Confirm Type + Scope (AskUserQuestion — M118 #1466)
157
158Auto-classification is best-effort. Before writing, ask the user to confirm both the memory type and the persistence scope. Pre-select the auto-detected type as the default option when the classifier is confident (≥0.9):
159
160```python
161# Skip when the invocation already specifies type and scope:
162# /ork:remember --type=preference --global → skip, use those values
163# /ork:remember --session → skip, no persistence
164#
165# Otherwise, ask both:
166AskUserQuestion(questions=[
167 {"question": "What type of memory?",
168 "header": "Type",
169 "options": [
170 {"label": "Preference", "description": "How I like to work (style, format, tooling)"},
171 {"label": "Project fact", "description": "State of THIS codebase (decisions, constraints)"},
172 {"label": "Reference", "description": "External system pointer (URL, doc, dashboard)"},
173 {"label": "Feedback", "description": "Correction to future behavior — applied as a rule"}
174 ]},
175 {"question": "Apply to?",
176 "header": "Scope",
177 "options": [
178 {"label": "This project (default)", "description": "Scoped to .claude/projects/<this-project>/memory/"},
179 {"label": "All projects (global)", "description": "User-level memory at ~/.claude/memory/"},
180 {"label": "This session only", "description": "Print to context but don't persist"}
181 ]}
182])
183```
184
185**Default selection rules:**
186- If auto-detected category maps to one of the 4 type options with confidence ≥0.9, that option is pre-selected (the user can still override).
187- "This project" is always the scope default.
188- "This session only" returns immediately without writing — useful when the user wants to surface a fact for the conversation but not commit it.
189
190**Global memory writes** route to `~/.claude/memory/<filename>.md` instead of the project-local memory directory. The MEMORY.md index is updated in whichever scope was selected (project- or user-level).
191
192Load entity extraction rules, type assignment, relationship patterns, and graph creation examples: `Read("references/graph-operations.md")`
193
194### 7. Confirm Storage
195
196Display confirmation using the appropriate template (success, anti-pattern, or neutral) showing created entities, relations, and graph stats.
197
198Load output templates and examples: `Read("references/confirmation-templates.md")`
199
200## File-Based Memory Updates
201
202When updating `.claude/memory/MEMORY.md` or project memory files:
203- **PREFER Edit over Write** to preserve existing content and avoid overwriting
204- Use stable anchor lines: `## Recent Decisions`, `## Patterns`, `## Preferences`
205- See the `memory` skill's "Permission-Free File Operations" section for the full Edit pattern
206- This applies to the calling agent's file operations, not to the knowledge graph operations above
207
208---
209
210## References
211
212Load on demand with `Read("references/<file>")`:
213
214| File | Content |
215|------|---------|
216| `category-detection.md` | Auto-detection rules for categorizing memories (priority order) |
217| `graph-operations.md` | Entity extraction, type assignment, relationship patterns, graph creation |
218| `confirmation-templates.md` | Output templates (success, anti-pattern, neutral) and usage examples |
219
220---
221
222## Related Skills
223- `ork:memory` - Search, load, sync, visualize (read-side operations)
224
225## Error Handling
226
227- Knowledge graph unavailable → show configuration instructions
228- Empty text → ask user for content; text >2000 chars → truncate with notice
229- Both --success and --failed → ask user to clarify
230- Entity extraction fails → create generic Decision entity; relation fails → create entities first, retry