The Problem Nobody Talks About
Every guide on AI agent reliability tells you to log state. Write current-task.json. Write context-snapshot.json. Write outbox.json.
Good advice. But incomplete.
The trap: most agents write but never read.
The files exist. The data is there. And when the agent restarts — from a crash, a scheduled restart, a model swap — it starts from zero anyway.
You built a memory system your agent ignores.
Why This Happens
Most SOUL.md files and agent configs focus on what to do during a task. They don't define a boot sequence.
So when the agent initializes, it:
- Loads its system prompt
- Gets a task
- Starts fresh
Step 0 — read your own state — is missing.
The Fix: A Boot Sequence
Add an explicit boot sequence to your agent config. Before the agent does anything, it should:
Boot sequence:
1. Check for current-task.json — if exists, resume from last known step
2. Check context-snapshot.json — load relevant context
3. Check outbox.json — are there pending items to deliver first?
4. If all clear, accept new task
That's it. Four checks before the agent touches anything new.
What Goes in Each File
current-task.json — the active task and current step
{
"task": "process_daily_report",
"step": 3,
"total_steps": 7,
"last_updated": "2026-03-09T04:00:00Z"
}
context-snapshot.json — key context the agent needs across restarts
{
"active_positions": [...],
"pending_decisions": [...],
"last_verified": "2026-03-09T03:55:00Z"
}
outbox.json — completed work waiting for delivery
[
{
"type": "report",
"content": "...",
"created": "2026-03-09T03:58:00Z",
"delivered": false
}
]
The Three-File Pattern in Practice
With a proper boot sequence, your agent becomes restart-safe:
- Scheduled restart at 3 AM? Agent picks up mid-task, not from scratch.
- Model swap? New model loads the same context the old one had.
- Crash on step 4 of 7? Agent resumes at step 4, not step 1.
This is the difference between an agent that has memory and one that uses memory.
Adding It to Your SOUL.md
In your agent's SOUL.md or system prompt, add a section like this:
## Boot Sequence
Before accepting any new task:
1. Read current-task.json — resume if incomplete task found
2. Read context-snapshot.json — load active context
3. Check outbox.json — deliver any undelivered items
4. Log boot completion to agent-log.json
5. Accept new task
Simple. Explicit. And it closes the write-only trap permanently.
The Bigger Lesson
Reliability in AI agent systems isn't just about what an agent does during a task. It's about what it does at the edges — startup, shutdown, failure, recovery.
Most configs are optimized for the happy path. The boot sequence is your insurance policy for everything else.
If you want a full library of agent config patterns like this — boot sequences, escalation rules, circuit breakers, dead letter queues — they're all at askpatrick.co.
New patterns added nightly.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.