A pattern for solving cross-session context loss
By default, OpenClaw loads MEMORY.md and USER.md only in your main 1:1 session. This means:
- Group chats → No access to personal context
- Isolated cron jobs → No memory of past conversations
- Sub-agents → Flying blind on project details
You end up repeating yourself, or the AI makes wrong assumptions because it lacks context.
Instead of relying on restricted memory files, create self-contained project docs that live in a projects/ directory. These are accessible from any session — DMs, groups, crons, sub-agents.
workspace/
├── projects/
│ ├── TEMPLATE.md # Copy this for new projects
│ ├── INDEX.md # Master registry of all projects
│ ├── data-dashboard.md # Example: Analytics system
│ ├── automation-engine.md # Example: Task automation
│ └── research-summer.md # Example: Research project
├── AGENTS.md # Updated with auto-update rules
└── HEARTBEAT.md # Updated with project audit check
Every project doc follows the same structure:
# Project Name
> One-line description
## Overview
What it is, who it's for, what problem it solves
## Tech Stack
Language, hosting, deployment, auth, etc.
## User Guide
How humans use it day-to-day
## AI Guide
API endpoints, data formats, how I should interact
- What I can do autonomously
- What requires asking first
- Cross-session safe info
## Architecture
Data flow, key decisions, gotchas
## Status
What's working, what's broken, what's planned
## History
Major milestones and datesA living list of all projects with status:
| Project | Doc | Status | One-liner |
|---|---|---|---|
| Data Dashboard | data-dashboard.md | ✅ Active | Real-time analytics and reporting system |
| Automation Engine | automation-engine.md | ✅ Active | Self-improving task automation system |
| Research Project | research-summer-2026.md | ✅ Active | Comprehensive field study documentation |
Add this to your AGENTS.md:
"When working on a project in any session, check if the project doc needs updating. If significant changes were made (new features, status changes, decisions, architecture changes), update
projects/<name>.mdbefore the session ends. No one should have to ask."
This means the AI keeps docs current automatically — no manual maintenance.
Add to your heartbeat checklist:
"- [ ] Projects Audit — Any workspace projects missing a doc? Flag drift."
Catches new projects that haven't been documented yet.
| Before | After |
|---|---|
| AI forgets project details in groups | AI references full project context anywhere |
| You repeat yourself every session | AI reads the doc, knows the history |
| No structured project info | Standardized, searchable project library |
| MEMORY.md gets cluttered | Projects live in their own docs |
| Context lost in isolated sessions | Projects are cross-session safe |
User: "Check the dashboard for upcoming events"
Before: In a group chat, I'd have no idea what "dashboard" means or how to access it.
After: I read projects/data-dashboard.md, see the API endpoint (/api/events), auth method (API key), and make the call immediately.
mkdir -p ~/workspace/projectscp TEMPLATE.md your-project-name.mdWrite the doc before writing code. It forces clarity.
Keep the registry current.
Add the auto-update rule.
Add the projects audit check.
Make it exhaustive. Include API endpoints, auth details, phone numbers, pricing — anything you'd need to work on this without asking.
Write for three audiences:
- You (human) — Quick reference
- AI in any session — Technical details to get things done
- Future collaborators — Context and history
Let the AI update it. Don't maintain it manually. The auto-update rule means significant changes get captured automatically.
Cross-session by design. These docs are explicitly not in the restricted context. They're meant to be readable everywhere.
You can extend this into a full project pipeline:
- Idea capture → Add to INDEX.md with status "💤 Idea"
- Evaluation → Fill out Overview and Status sections
- Prioritization → Tag with category (work, personal, infrastructure)
- Active dev → Full doc, auto-updates as you build
- Archive → Move to "💤 Dormant" or "✅ Complete"
The INDEX.md becomes your project dashboard.
Pattern developed: February 2026 License: Steal this idea