This skill is always loaded into the agent’s context.
Structure
The memory system consists of two files:memory/MEMORY.md- Long-term facts (preferences, project context, relationships). Always loaded into context.memory/HISTORY.md- Append-only event log. NOT loaded into context. Search it with grep. Each entry starts with[YYYY-MM-DD HH:MM].
Search Past Events
Use grep to search historical events:exec tool to run grep commands.
When to Update MEMORY.md
Write important facts immediately usingedit_file or write_file:
User Preferences
Project Context
Relationships
Auto-consolidation
Old conversations are automatically summarized and appended toHISTORY.md when the session grows large. Long-term facts are extracted to MEMORY.md.
You don’t need to manage this process manually.
Examples
Storing a Preference
When a user says “I prefer tabs over spaces”:- Add to
memory/MEMORY.md:
Searching for Past Meetings
Finding Deadlines
Best Practices
- Be selective - Only store truly important facts in
MEMORY.md - Be specific - Include context with preferences (“Prefers TypeScript for new projects”)
- Use grep - Search
HISTORY.mdinstead of loading it into context - Update immediately - Write facts when they’re mentioned, not later