FailurecurrentRunning agents

A usage limit reaches a headless agent as plain text instead of an error

When a scheduled claude -p run hits the plan's usage limit, the message arrives as ordinary output, and a job can still end with exit code 0.

SymptomA scheduled agent job shows success, but its output is one line about a usage limit and none of its real work.

I expected a usage limit to fail a headless run loudly, yet the CLI printed one line, 'You've hit your … limit', as normal output. Several jobs wrote that line into their own dated logs and finished with exit code 0, so a status check saw success even though the work had not happened.

My first detector read exit codes, so it saw nothing. The second scanned the output for the limit line, but loose matching caught ticket titles and a search vendor's own 'usage limit reached' text. The line needs an anchor on its exact shape, and the plan limit and the spend cap need separate checks, because both lines can name a time the limit lifts.

One digest job echoed the message cut at 100 characters. The time the limit lifts was in the cut part, so the retry used a default wait and ran too early. Jobs that keep CLI output in a per-run folder were invisible to a scan of the main log. Those jobs have to print the limit line themselves and record a stop reason.

The fix is the same for every job. Read the output as well as the exit code, anchor on the message shape, and record a stop reason when the limit text appears. Then a limit is a known stop with a retry time rather than a silent success.

Check your setup read-only

Search each scheduled job's log for the text 'hit your' followed by 'limit'. Compare each match with the recorded status of the same run.

Passes ifEvery run whose log holds that text also shows a failure status or a recorded stop reason.

Access needed:scheduleragent-transcripts

If it fails: changes to make later (not part of the check)
  1. 01Search every scheduled job's log for the text 'hit your' followed by 'limit'.
  2. 02Match each hit with the run's exit code.
  3. 03List the jobs that keep CLI output outside the main log.
  4. 04Make each job print the limit line and record a stop reason.
  5. 05Keep the full line so the time the limit lifts survives.
Applies ifYou schedule headless claude -p jobs and judge a run by its exit code or by the last line of its log.

← Back to the stream

For your agent

Each post has a read-only check your agent can run against your own setup. Paste this into a read-only session:

Never asks your agent to change anything · send anything anywhere · fetch other pages · run code · read something you can't.

What each rule means, and how it's enforced
  • Change anything. Every check is a question answered by reading. Each one names what it reads. The steps under “If it fails” are for you to weigh later, never part of a check.
  • Send anything anywhere. No post asks an agent to email, post, submit, upload or report back. Your results stay with you; sharing them is your call.
  • Fetch other pages. Post text carries no links, and no post tells an agent to visit one. The only URLs in the feed point to this site's own post pages.
  • Run code. Snippets are illustrations, not commands.
  • Read something you can't. posts.json is generated from this page, field for field. Nothing is hidden from a human reader.

A gate enforces these rules before every publish: it refuses links, instructions aimed at an agent, write verbs inside a check, hidden Unicode characters and any check without an "access needed" line. Each published version carries a version number and a sha256 fingerprint, so you can pin the version you reviewed. Every post is reviewed by a person before it goes out.

Feed version 1.0 · 2026-11-16 · sha256 88d19978389827b7…

Found something that breaks these rules? Tell me on LinkedIn.