Skip to content

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.

During a conversation, your agent maintains context in session files stored at /data/sessions/. Each session is a JSONL file containing:

  • Your messages
  • Agent responses
  • Tool calls and results
  • Usage statistics

Sessions persist across turns within a conversation. When you send an email, the agent continues from where you left off.

CommandEffect
/clearStart a new session (old ones preserved)
/resumeList recent sessions with hashes
/resume abc1Resume a specific session by hash
/compactCompress session to save tokens

Each model has a context window limit:

ModelContext Window
Haiku200k tokens
Sonnet200k tokens
Opus200k tokens

When your session approaches the limit, use /compact to summarize older messages and free up space.

/data/MEMORY.md is your agent’s persistent memory. It survives:

  • Session changes
  • /clear commands
  • Platform updates

The default MEMORY.md includes:

# Agent Memory
## Identity
- Name: buddy
## Outbox Instructions
[How to send emails via /data/outbox/email/]
## Standing Instructions
[Any persistent instructions you add]

Ask your agent to edit its memory:

“Add to your memory that I prefer concise responses”

Or edit directly:

“Show me your MEMORY.md file”

Then tell it what to change.

Agent preferences like model selection are stored in /data/config.json:

{
"model": "haiku"
}

Changed via /model haiku|sonnet|opus command.

All agent data lives in R2 storage:

agents/{agent_id}/
├── MEMORY.md # Long-term memory
├── config.json # Preferences
├── sessions/
│ └── {id}.jsonl # Session files
├── outbox/
│ ├── email/ # Pending emails
│ ├── sent/ # Sent emails
│ └── failed/ # Failed emails
└── events/
└── {ts}.jsonl # Run events

Each agent has isolated storage — agents can’t see each other’s data.

When your session gets large, use /compact to reduce token usage:

  1. The agent summarizes the conversation history
  2. Old messages are replaced with the summary
  3. Recent messages are preserved
  4. You continue with full context of what happened
/compact focus on the code changes we discussed

Tells the agent what to prioritize in the summary.

Claude supports prompt caching. When parts of your context match previous requests, you get cache hits:

  • Cache read — Free tokens from cache
  • Cache write — Tokens written to cache (cheaper than input)

The session footer shows cache stats:

R663k W37k

R = cache read, W = cache write. High cache read = cheaper turns.

Your data is yours:

  1. View anytime — Ask your agent to show files
  2. Export — Download from R2 (contact support)
  3. Self-host — Run your own TinyFat instance

We don’t lock you in.

  • Persistent preferences
  • Project context that spans sessions
  • Standing instructions
  • Important information to always remember
  • Active conversations
  • Work in progress
  • Temporary context

Don’t dump everything in MEMORY.md. It’s read every turn, so keep it concise and relevant.