◉CLAUDE LABJP
●CC 2.1.332 — 2.1.332 (11/25) is still current. Skills from MCP servers appear as server:skill (beta)●OPUS 4.5 — Opus 4.5 is now scheduled to retire from the Claude API on 2027/1/22. Move to claude-opus-5-5●SONNET 4.5 — Sonnet 4.5 retires from the Claude API tomorrow, 11/30. Last day to check for hard-coded IDs●DISK — Users on Windows report Cowork's session disk filling up with no way to clean it●NEW — New: Asking Cowork for a meeting draft? Hand over old minutes after the outline is set●JETBRAINS — Our guide to using Claude with JetBrains IDEs is still among the most-read pages●CC 2.1.332 — 2.1.332 (11/25) is still current. Skills from MCP servers appear as server:skill (beta)●OPUS 4.5 — Opus 4.5 is now scheduled to retire from the Claude API on 2027/1/22. Move to claude-opus-5-5●SONNET 4.5 — Sonnet 4.5 retires from the Claude API tomorrow, 11/30. Last day to check for hard-coded IDs●DISK — Users on Windows report Cowork's session disk filling up with no way to clean it●NEW — New: Asking Cowork for a meeting draft? Hand over old minutes after the outline is set●JETBRAINS — Our guide to using Claude with JetBrains IDEs is still among the most-read pages
Articles/Cowork
◈ Cowork/2026-06-29Advanced

Failing Loud on Stale Inputs: A Freshness Contract for Unattended Pipelines

How to stop a scheduled, unattended pipeline from silently shipping degraded work when its upstream data is empty or stale. We implement a freshness contract in bash that asserts recency, non-emptiness, and provenance, plus two real pitfalls I hit running Cowork scheduled tasks.

Cowork71Scheduled Tasks20Automation44PipelinesReliability5

✦ Premium Article

I opened the scheduled-run log one morning and the output count had gone up by one, exactly as planned. Then I read what it had produced, and felt a small chill.

The shape was right, but the specific, hard-won details were missing. Tracing it back, the data file the job read had still been empty at that moment. An upstream refresh had run a few minutes late, and the downstream step happily concluded it had "successfully read an empty file" — then quietly shipped a thin result.

When you run things unattended, the scariest outcome is not a crash. It is a run that does not stop and finishes wrong anyway. Crashes get noticed. Silent degradation hides until a human re-reads the output days later.

I am an indie developer, and alongside my apps I run automated content updates across several sites using Cowork's scheduled tasks. After hitting this class of bug more than once, I gave up on patching symptoms. What I actually needed was to treat the input itself as something to verify on every run. This article turns that into what I call an input freshness contract.

Silent degradation is almost always an input problem

When output degrades quietly, the generation logic is rarely the broken part. Far more often the input reaching the generator is wrong, and nothing checks it. I kept seeing the same three shapes.

The first is an empty file. Misread a path with cat, or read a path that does not exist, and the shell returns an empty string and marches on. The generator dutifully treats "no reference data" as a valid state and produces something generic and inoffensive.

The second is a stale file. When an upstream refresh fails or lags, last run's file is still sitting there. The downstream step reads it as "today's data" and builds today's output from yesterday's context. The file exists and has content. What it lacks is recency.

The third is leftover residue. If you write to a fixed-name temp file, a failed write this run leaves the previous contents in place, and they get mixed in silently. This is nastier than empty or stale, because it looks plausible and so survives longer.

What they share is that the process appears to succeed. Unless you place an explicit gate that distrusts the input, the degradation slips straight through.

Treat the input as a contract: recency, non-emptiness, provenance

So I started treating upstream inputs not as an implicit assumption but as an explicit contract. I call it a contract because I want enforcement: if it is not satisfied, the downstream step does not get to run. I narrowed the conditions to three.

Recency: was the file updated within an acceptable window? For reference data regenerated daily, say within 24 hours. Past that threshold, it is "stale."

Non-emptiness: is there a meaningful minimum of content? Not merely "non-zero bytes," but a sensible minimum byte count per input, so a few dozen bytes of headers are not mistaken for real content.

Provenance: did the input come from the right source? For a cloned repository, does local HEAD match the remote tip? For a temp file, was it written by this run? This is the condition that stops you mistaking an old location for the latest one.

Only inputs that satisfy all three count as trustworthy; if even one is missing, the run halts. The key is to decide this at a mechanical gate, not to leave the judgment to the generator.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦The three failure modes — empty, stale, and leftover input — that make automated pipelines ship degraded output silently, and how to tell them apart
✦A roughly 60-line bash freshness gate that asserts recency, non-emptiness, and provenance before any generation runs
✦Design decisions shaped by two pitfalls I hit on Cowork scheduled runs: UTC date overwrites and a nobody-owned stale clone
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Cowork2026-09-18
How I decide between Cowork and Claude Code: by where approvals land
Cowork and Claude Code run the same Claude, so I stopped comparing features and started sorting work by one question: can a human approval interrupt this step, or not? Here is the line I draw and the code I keep on the unattended side.
◈ Cowork2026-11-20
Copy Your Scheduled Tasks' Prompts and Times Once a Week, So You Can Restore Them If They Vanish
Scheduled tasks can disappear or need rescheduling after an app update or a save that fails to read its file. Here is a weekly habit for keeping three things—prompt, schedule, and connected folders—in your own folder, plus a small script that tells you which copies changed since last week.
◈ Cowork2026-10-26
I Linted 36 Unattended-Run Prompts: All 7 'Use This Tool' Hits Turned Out to Be Bans
One permission dialog is enough to stall an unattended task, because nobody is there to click it. This note covers a lint script that counts prompt lines that tell the task to use such a tool, why a banned-word grep gave seven false alarms, and how matching on word stems fixed it.