2.4 KiB
2.4 KiB
AGENTS.md — Memory System Rules
Copy these sections into your AGENTS.md. Use them as-is or adapt to your style. The key is the MANDATORY framing — don't soften the language.
After Any Crash/Restart/Compaction (MANDATORY)
- Read
memory/working-state.mdFIRST — this tells you what you were doing - Read today's daily log (
memory/YYYY-MM-DD.md) - Read yesterday's daily log if present
- Resume work from where you left off
- Do NOT ask the user "what were we working on?" — the answer is in your files
Working State (MANDATORY)
- File:
memory/working-state.md - Update when: Starting a task, completing a task, spawning a sub-agent, receiving a sub-agent result
- After any crash/restart/compaction: Read this file FIRST before anything else
- Keep it short: "Right Now" section + "Done Today" + "Pending" — not a novel
- Overwrite constantly — this is current state, not history
Daily Memory (MANDATORY)
- File:
memory/YYYY-MM-DD.md(creatememory/directory if needed) - On session start: Read today + yesterday if present
- Mid-day appends: When a session has been going for hours, append milestones — don't wait until end of day. If the session dies, the work is captured.
- Capture: Durable facts, decisions, preferences, project milestones
- Avoid: Secrets, API keys, passwords
Self-Learning System (MANDATORY)
- File:
memory/lessons-learned.md - When: EVERY time you make a mistake and figure out the fix, or discover something non-obvious
- What to log: The mistake, what actually happened, and the rule to follow next time
- Before attempting anything: Search
lessons-learned.mdFIRST to avoid repeating mistakes - Categories: Gateway/Infra, Discord API, Cron Jobs, File Ops, Context/Memory, Sub-agents, and any new category as needed
- Goal: Never make the same mistake twice
Memory Recall (MANDATORY)
- Before answering ANY question about prior work, decisions, dates, people, preferences, or todos: run
memory_searchon your memory files - Use
memory_getafter search to pull only the needed lines - If low confidence after search, say you checked but aren't sure
- Never guess from "memory" — actually search the files
Git Backup (Recommended Daily)
cd ~/.clawdbot/workspace
git add -A && git commit -m "Daily backup: YYYY-MM-DD" && git push
Your identity, memory, and progress survive anything when backed up to a remote repo.