You are operating with persistent memory. This skill defines how to maintain context across sessions.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
You are operating with persistent memory. This skill defines how to maintain context across sessions.
| Location | Type | Purpose | Update Frequency |
|---|---|---|---|
.claude/memory/ | Dynamic | Session state, decisions | Every session |
.ai/ | Static | Architecture, patterns | When patterns emerge |
| File | Content | When to Update |
|---|---|---|
context.md | Current state, next steps | End of session |
scratchpad.md | Live session operations | During session |
decisions.md | Architectural choices | When decisions made |
.ai/core/ | Tech stack, architecture | When they change |
.ai/patterns/ | Reusable solutions | After 3+ uses |
context.mdscratchpad.md for unfinished work.ai/ for patterns and architectureWrite to scratchpad.md as you work:
## Session: 2024-01-15 14:30
### Operations
- [14:31] Read context.md - last session worked on auth
- [14:32] User asked to fix login bug
- [14:35] Found issue in validateToken() at src/auth.ts:142
- [14:40] Fixed: was comparing wrong field
### Findings
- Token validation was checking user.id instead of user.uid
- Only affects users created after migration
### Decisions
- Keep backward compatibility by checking both fields
### Blockers
(none)
### Next Steps
- Add regression test for token validation
Update .ai/ when patterns emerge:
After implementing the same solution 3+ times, add it to .ai/patterns/.
sessions/YYYY-MM-DD.mdcontext.md with:
decisions.mdDuring your session, proactively update .ai/ when you encounter:
| Trigger | Location | Example |
|---|---|---|
| Pattern used 3+ times | .ai/patterns/ | Error handling, API structure |
| Architecture change | .ai/core/architecture.md | New service layer |
| Stack change | .ai/core/technology-stack.md | New dependency |
| Workflow improvement | .ai/workflows/ | Better test process |
Do not wait for session end. Update as you go:
.ai/ file immediatelyExample scratchpad entry:
### Operations
- [14:35] Implemented error handling in 3 endpoints
- [14:40] Pattern detected - created .ai/patterns/error-handling.md
- [14:45] Applied pattern to remaining endpoints
Is this information:
[Specific to today's work?]
YES --> scratchpad.md
[An architectural decision?]
YES --> decisions.md (also update .ai/ if changes architecture)
[A reusable pattern?]
YES --> .ai/patterns/
[About the tech stack?]
YES --> .ai/core/technology-stack.md
[Current project state?]
YES --> context.md
# Project Context
## Current State
[What is the current state of the project/feature?]
## Current Task
[What are we working on right now?]
## Last Session
- Date: YYYY-MM-DD
- Accomplished: [summary]
- Stopped at: [where we left off]
## Next Steps
1. [First thing to do]
2. [Second thing to do]
## Active Branches
- feature/xxx - [purpose]
## Notes
[Any context the next session needs]
# Scratchpad
Session: YYYY-MM-DD HH:MM
## Operations
- [HH:MM] Action taken
## Findings
- What was discovered
## Decisions
- Choices made and rationale
## Blockers
- Issues encountered
## Next Steps
- What to do if session ends
# Decision Log
## YYYY-MM-DD: [Decision Title]
**Context**: [Why was this decision needed?]
**Options Considered**:
1. Option A - pros/cons
2. Option B - pros/cons
**Decision**: [What was chosen]
**Rationale**: [Why this option]
**Consequences**: [What this means going forward]
The UserPromptSubmit hook displays memory state on every prompt:
[Memory] Task: Fix auth bug | Scratchpad: 24 lines | .ai/ updated: 2024-01-15
This reminder survives context compaction. Use it to stay oriented.
Activates orchestrator mode for complex tasks. The orchestrator:
Use for multi-step tasks requiring persistent state management.