Memory & Persistence
Your agent has both short-term and long-term memory. Understanding how these work helps you get the most out of your agent.
Short-term memory: Sessions
Section titled “Short-term memory: Sessions”During a conversation, your agent maintains context in a session file. Each channel (Email, Telegram, Slack, Web Chat) gets its own session, stored as a JSONL file containing:
- Your messages
- Agent responses
- Tool calls and results
Sessions persist across turns within a conversation. When you send a message, the agent continues from where you left off.
Session commands
Section titled “Session commands”| Command | Effect |
|---|---|
/clear | Start a new session (old ones preserved) |
/resume | List recent sessions with hashes |
/resume abc1 | Resume a specific session by hash |
/compact | Compress session to save tokens |
Context limits
Section titled “Context limits”Each model has a context window limit (currently 200k tokens for all Claude models). When your session approaches the limit, use /compact to summarize older messages and free up space.
Long-term memory: MEMORY.md
Section titled “Long-term memory: MEMORY.md”/data/MEMORY.md is your agent’s persistent memory. It survives:
- Session changes
/clearcommands- Platform updates
- Channel switches
What goes in MEMORY.md
Section titled “What goes in MEMORY.md”The default MEMORY.md includes:
- Agent identity (name, email, owner)
- Email response instructions
- Available tools and skills
- Persistent storage layout
- Behavior rules
Customizing MEMORY.md
Section titled “Customizing MEMORY.md”Ask your agent to edit its memory:
“Add to your memory that I prefer concise responses”
Or:
“Show me your MEMORY.md file”
Then tell it what to change.
Configuration: config.json
Section titled “Configuration: config.json”Agent preferences like model selection are stored in /data/config.json:
{ "model": "sonnet"}The default model is Sonnet. Change it with /model haiku or /model sonnet, or just ask your agent to switch.
Cross-channel memory
Section titled “Cross-channel memory”All channels (Email, Telegram, Slack, Web Chat) share the same:
- MEMORY.md — Persistent memory
- Storage —
/datadirectory
Each channel has its own session, but they all read from the same MEMORY.md. Start a task on email, check progress on Telegram — your agent remembers everything.
Context compaction
Section titled “Context compaction”When your session gets large, use /compact to reduce token usage:
- The agent summarizes the conversation history
- Old messages are replaced with the summary
- Recent messages are preserved
- You continue with full context of what happened
Custom compaction focus
Section titled “Custom compaction focus”/compact focus on the code changes we discussedTells the agent what to prioritize in the summary.
Data portability
Section titled “Data portability”Your data is yours:
- View anytime — Ask your agent to show files
- Self-host — The agent runtime (crawdad) is open source
We don’t lock you in.
Best practices
Section titled “Best practices”Use MEMORY.md for
Section titled “Use MEMORY.md for”- Persistent preferences
- Project context that spans sessions
- Standing instructions
- Important information to always remember
Use sessions for
Section titled “Use sessions for”- Active conversations
- Work in progress
- Temporary context
Keep MEMORY.md focused
Section titled “Keep MEMORY.md focused”Don’t dump everything in MEMORY.md. It’s read every turn, so keep it concise and relevant.
Next steps
Section titled “Next steps”- Agent Workspace — Full filesystem layout
- Memory Bank Pattern — Organized project knowledge