Managing Conversation History and Context
Control how OpenClaw handles conversation history, context windows, and session management.
How Context Works
OpenClaw maintains conversation context to provide coherent multi-turn interactions. Understanding how this works helps you get better responses.
Context Components
Each message to the AI includes:
- System prompt — Your base instructions
- USER.md — Your personal profile
- MEMORY.md — Long-term facts
- Conversation history — Recent messages in the current session
- Skill instructions — Active skill context
- Tool results — Output from any tools used
Context Window Limits
AI models have a maximum context window (e.g., 200K tokens for Claude). OpenClaw manages this by:
- Keeping recent messages in full
- Summarizing older messages when approaching the limit
- Always including system prompt, memory, and user profile
Session Management
Clearing Context
Start fresh without losing memory:
- "Clear the conversation" or "Start over"
- Send
/clearin the chat - This clears conversation history but keeps MEMORY.md and USER.md
Continuing Context
By default, context persists within a channel session. Switching channels starts a new session unless cross-channel context is enabled.
History Storage
Conversation logs are stored locally in your workspace:
~/.openclaw/history/
telegram/
2026-02-18.json
whatsapp/
2026-02-18.json
Configuration
{
"context": {
"max_history_messages": 50,
"summarize_after": 30,
"cross_channel": false,
"persist_history": true
}
}
Options
- max_history_messages: How many messages to keep in context
- summarize_after: When to start summarizing older messages
- cross_channel: Share context across channels
- persist_history: Save conversation logs to disk
Tips for Better Context
- Reference earlier messages explicitly: "Like I said earlier about X"
- Clear context when starting a new topic to avoid confusion
- Use memory for permanent facts, not conversation context
- Long conversations benefit from periodic summaries
Ready for your AI assistant?
Get started with Claw for All today. No setup, no terminal, just sign up and go.
Get StartedRelated Guides
How OpenClaw Memory Works: MEMORY.md and USER.md
Understand OpenClaw's persistent memory system — MEMORY.md for facts and USER.md for personal info.
Personalizing Your OpenClaw Assistant
Customize OpenClaw's personality, response style, and behavior to match your preferences.
OpenClaw Workspace Configuration Guide
Master the openclaw.json config file — channels, models, tools, permissions, and advanced settings.