openclaw fix intermediate 15 minutes

Why Your OpenClaw Agent Only Remembered One Day of Work

The most dangerous agent behavior isn't crashing — it's quietly being wrong. An agent that warns you about missing data when the data is right there is not a bug you'll catch in testing. You'll catch it when you look at a weekly recap and wonder why your own work disappeared.

The Problem

An OpenClaw weekly recap job was producing this output every Sunday:

Weekly Recap — Feb 23–Mar 1

⚠️ Only one daily note exists for the week (Feb 27), so this is a partial picture.

Four daily notes existed in memory/daily/ for that week. The agent found one.

The job payload told the agent to “run weekly maintenance per PRIORITY.md.” PRIORITY.md’s weekly section said: review the backlog, confirm TASKS.md is clean. No instructions for reading daily notes. The agent improvised the recap portion — and guessed wrong.

Why This Happens

OpenClaw scheduled jobs run in isolated sessions. There is no memory of previous conversations, no accumulated context. The agent starts fresh with only:

  1. Its workspace files (SOUL.md, PRIORITY.md, TASKS.md, etc.)
  2. The job payload message

When the payload says “send the weekly summary” but doesn’t define what a weekly summary contains, the agent fills in the gap. It knows daily notes exist (SOUL.md mentions them). It tries to find them. But without explicit instructions on how to find them — run ls, filter by date range, read each file — it improvises a file discovery approach that may or may not work.

In this case, it found one file instead of four. No error was thrown. The recap went out with a false warning.

The fix isn’t a bug patch. It’s a specification problem.

The Fix

Step 1: Add explicit instructions to PRIORITY.md

Replace vague intent (“send the weekly summary”) with a step-by-step procedure:

Before:

## Weekly Maintenance (Sunday)

- Review Backlog — flag anything older than 2 weeks to Adam
- Confirm TASKS.md is clean: no completed tasks left in the list

After:

## Weekly Maintenance (Sunday)

### Steps

1. **Determine the week's date range** — run `TZ=America/Los_Angeles date +%Y-%m-%d`
   to get today's date. The week spans the 7 days ending today (Mon–Sun).
2. **Read daily notes** — run `ls memory/daily/` and read every file whose date
   falls within that range. Missing days are normal — do not flag them as a warning.
3. **Review Backlog** — flag anything in TASKS.md older than 2 weeks to Adam.
4. **Confirm TASKS.md is clean** — no completed tasks left in the list.

### Output Format

\`\`\`
Weekly Recap — [Mon date] – [Sun date]

✅ Completed this week:
- [task] | [date]

🗂️ Tasks reviewed: [X] active ([Y] urgent, [Z] soon, [W] backlog)
⚠️ Stale backlog items (>2 weeks): [item][age]
\`\`\`

Rules:
- Do not warn about missing days. Just report what was done.
- Keep it short. One message, no walls of text.

Step 2: Update the job payload to match

Before:

"message": "Sunday weekly recap. Run weekly maintenance per PRIORITY.md — review the backlog for anything >2 weeks old, flag items that need attention, and send the weekly summary."

After:

"message": "Sunday weekly recap. Run weekly maintenance per PRIORITY.md — read this week's daily notes from memory/daily/ to summarize completed tasks, review the backlog for anything >2 weeks old, and send the weekly summary using the format in PRIORITY.md."

The payload now names the data source (memory/daily/) explicitly. The agent no longer has to infer it.

Key Takeaway

Scheduled agent jobs are specifications, not suggestions. When a job runs in an isolated session, every behavior you don’t define explicitly is behavior the agent will improvise. Improvised behavior is non-deterministic — it may work in testing and fail silently in production. The fix is always the same: find the gap between what you told the agent and what you expected it to do, and close it with explicit instructions, explicit data sources, and explicit output formats.

FAQ

Why does my OpenClaw scheduled job produce different results than when I run the same prompt interactively?

Scheduled jobs run in isolated sessions with no prior context. The agent has to reason from scratch using only what's in its workspace files and the job payload message. Any behavior that worked interactively because of session context will fail silently in a cron job.

How do I make an OpenClaw cron job read files from a directory?

Instruct it explicitly in the job payload or in the referenced instruction file. Tell it to run ls on the target directory, filter by date range, and read each file. Without explicit instructions, the agent may guess — and guess wrong.

My weekly recap agent says files are missing but they exist on disk. What's wrong?

The agent is likely improvising its file discovery logic instead of following explicit instructions. Add step-by-step instructions to your PRIORITY.md or equivalent: get today's date, compute the date range, run ls, filter, read each file. Treat missing days as normal — don't warn on gaps.

Where should I put weekly recap instructions in OpenClaw?

In the file your job payload points to. If your payload says 'run weekly maintenance per PRIORITY.md', the weekly recap logic belongs in PRIORITY.md. The job message is the entry point — everything the agent needs must be reachable from there.