What's Inside
- The Memory Handoff — FREE ↓
- The Heartbeat Health Check — FREE ↓
- The Escalation Ladder — Library
- Multi-Agent Memory Bus — Library
- Cold Start Recovery — Library
The Memory Handoff
How to pass context between AI sessions without losing state
The Problem
Every AI assistant starts each conversation with a blank slate. Ask it to "continue where we left off" and it genuinely doesn't know what you mean. This isn't a bug — it's how these systems work. But it kills productivity when your assistant forgets the decisions you made yesterday, the tone you approved, or the task it was halfway through.
Most people solve this by copy-pasting notes at the start of every chat. That works, but it's manual and it scales badly. The Memory Handoff automates it.
How It Works
At the end of every session, your assistant writes a short "handoff note" to a file. At the start of the next session, it reads that file first. The note is structured so the next session can pick up immediately — no re-explaining, no context loss.
Three parts make it work:
- The Handoff File — a plain text or markdown file your assistant writes to automatically
- The End-of-Session Prompt — the instruction that triggers the write
- The Start-of-Session Prompt — the instruction that reads and applies the handoff
Copy-Paste Implementation
Add this to your assistant's instructions (SOUL.md or system prompt):
## Session Handoff At the end of every session, write a handoff note to memory/handoff.md. Format it exactly like this: ## Handoff — [DATE] ### What we did this session - [bullet list, 3-5 items max] ### Active tasks (in progress) - [task name]: [one-line status] ### Decisions made - [decision]: [why we made it] ### Pick up here next time [1-2 sentences: what to do first in the next session] ### Context that matters - [anything unusual, preferences, or constraints active right now]
## Session Start Before doing anything else, read memory/handoff.md if it exists. Apply any active tasks, decisions, and context from that file. Do not ask me to repeat things that are already in the handoff. Confirm you've read it in one sentence, then proceed.
What to Watch Out For
- Stale handoffs: If a session crashes mid-task, the handoff won't be written. Add a fallback: "If no handoff file exists, ask me: 'What are we working on today?'"
- File getting too long: Cap the handoff at 400 words. Add to your prompt: "If the handoff file exceeds 400 words, trim older entries and keep only the last 3 sessions of decisions."
- Wrong file path: Make sure your assistant knows where to write. Use an absolute path or a path relative to the workspace root.
handoff.md for the latest session state, and MEMORY.md for long-term facts that should always be loaded. The handoff is ephemeral; MEMORY.md is permanent.
The Heartbeat Health Check
How to monitor agent health with a 5-line prompt addition
The Problem
AI assistants fail silently. They don't crash with an error message — they just start giving worse answers, missing tasks, or quietly doing nothing. By the time you notice, you've lost hours or days of work the assistant should have been doing.
The Heartbeat Health Check gives you a dead-man's switch. If your assistant is healthy and running, it responds. If it's stuck, confused, or drifted off-task, the check catches it before it becomes a problem.
How It Works
Every 30–60 minutes (or whenever you want a check-in), send your assistant a short "heartbeat" message. The assistant is pre-programmed to respond with a brief status report — or flag a problem if something's wrong.
It takes 5 lines in your system prompt. Here's the exact implementation:
## Heartbeat Protocol When you receive the message "HEARTBEAT", respond with: 1. Current status (what you're doing or waiting on) 2. Any blockers or problems you've hit 3. Last completed task 4. Next planned action If everything is fine and there's nothing to report, reply: HEARTBEAT_OK If something is wrong — you're stuck, confused, or hit an error — reply: HEARTBEAT_ALERT: [brief description of the problem]
Setting Up the Check-In Schedule
You can send heartbeats manually, but the pattern works best when automated. Three ways to do this depending on your setup:
- Manual (easiest): Just type "HEARTBEAT" whenever you want a status check. Takes 2 seconds, gives you instant visibility.
- Scheduled message (most common): Use a simple cron job or automation tool (Zapier, Make, or a basic script) to send "HEARTBEAT" every 30 minutes during working hours.
- Triggered by silence: If your assistant hasn't sent a message in X minutes, trigger a heartbeat automatically. This catches cases where it got stuck and stopped responding.
# Add to crontab with: crontab -e */30 9-18 * * 1-5 echo "HEARTBEAT" | your-assistant-cli
What a Good Heartbeat Response Looks Like
You → HEARTBEAT Assistant → HEARTBEAT_OK Current: Drafting follow-up email for the Johnson account. Last completed: Updated the Q3 report with new figures. Next: Send the email draft to you for review once done. No blockers.
Going Further
Once you have basic heartbeats running, you can layer in more checks:
- Ask the assistant to self-report confidence: "Rate your current task confidence 1–10"
- Include a file integrity check: "Confirm memory/handoff.md was updated in the last hour"
- Add an escalation trigger: "If you've been stuck on the same task for 2+ heartbeats, flag it as HEARTBEAT_STUCK"
Pattern 3: The Escalation Ladder
A decision tree baked into your agent's prompt that tells it exactly when to stop and ask a human — and who to ask. Eliminates both "asks too much" and "does too much without permission" problems. Includes 4 trigger levels and real prompt examples.
Pattern 4: Multi-Agent Memory Bus
When you have 3+ agents running in parallel, they need a single source of truth. This pattern creates a shared memory file with read/write rules that prevent agents from overwriting each other's work. Full setup for 3-agent systems with role separation.
Pattern 5: Cold Start Recovery
What to do when an agent crashes, loses context, or returns after a long gap with no memory of what it was doing. A structured recovery protocol that gets agents back on track in under 2 minutes — no re-explaining, no lost work.
Get All 5 Patterns + 47 More
The Library has everything I actually run — patterns, configs, templates, and troubleshooting playbooks. Updated every week with what's working right now.
Cancel anytime. No fluff, no theory — only tested, production-ready material.