claude-code - 💡(How to fix) Fix Scheduled task ignored repeated user directive — wasted ~210K tokens on prohibited work [4 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48296Fetched 2026-04-16 07:03:47
View on GitHub
Comments
4
Participants
2
Timeline
7
Reactions
0
Timeline (top)
commented ×4labeled ×3

Claude Code's scheduled task system (nightly-builder) executed unauthorized work overnight, ignoring a clear user directive to stop all Madrid-related work. The user gave this directive multiple times across sessions. The agent failed to enforce it at the data layer (task status), relying instead on ambiguous instruction text that a subsequent autonomous session misinterpreted.

Root Cause

The agent relied on instruction text to enforce an exclusion directive instead of changing task statuses at the data layer. Priority X before Y was interpreted as Y is allowed after X rather than Y is prohibited.

RAW_BUFFERClick to expand / collapse

Summary

Claude Code's scheduled task system (nightly-builder) executed unauthorized work overnight, ignoring a clear user directive to stop all Madrid-related work. The user gave this directive multiple times across sessions. The agent failed to enforce it at the data layer (task status), relying instead on ambiguous instruction text that a subsequent autonomous session misinterpreted.

What Happened

  1. User gave clear directive: no more Madrid work
  2. The agent receiving the directive did NOT change Madrid task statuses from pending to owner-blocked in the manifest
  3. The scheduled task file said "Flagstaff before Madrid" instead of "no Madrid"
  4. A nightly-builder session ran overnight, saw pending Madrid tasks, and executed them
  5. Two unauthorized subagent sessions consumed ~210K tokens:
    • L-MAD-2 (Madrid expansion): ~128K tokens
    • L-MAD-3 (Madrid audio tour): ~82K tokens

Root Cause

The agent relied on instruction text to enforce an exclusion directive instead of changing task statuses at the data layer. Priority X before Y was interpreted as Y is allowed after X rather than Y is prohibited.

Failure Mode

This is a systemic issue: when a user says stop or no regarding a category of work, autonomous scheduled tasks in future sessions have no mechanism to inherit that directive unless it is explicitly encoded in the data files they read. Cross-session directive enforcement is broken.

Impact

  • ~210K tokens of unauthorized usage
  • User trust damaged
  • 11 Madrid pages + 1 audio tour built against explicit instructions

Suggested Fix

  1. Scheduled tasks should have a mandatory pre-execution check against a user-maintained blocklist
  2. When a user says stop X or no X, the agent should be required to update ALL persistence layers (manifest status, scheduled task config, memory) not just acknowledge verbally
  3. Consider adding a confirmation/approval gate for scheduled tasks before execution begins

Environment

  • Claude Code CLI on Windows 11
  • Model: claude-sonnet-4-6
  • Scheduled task: nightly-builder-lowdown-guide
  • Date: 2026-04-14 to 2026-04-15

extent analysis

TL;DR

Implement a mandatory pre-execution check against a user-maintained blocklist for scheduled tasks to prevent unauthorized work.

Guidance

  • Update the agent to change task statuses from pending to owner-blocked in the manifest when a user gives a directive to stop a category of work.
  • Ensure that all persistence layers (manifest status, scheduled task config, memory) are updated when a user gives a stop or no directive.
  • Consider adding a confirmation/approval gate for scheduled tasks before execution begins to prevent misinterpretation of directives.
  • Review and refine the instruction text to avoid ambiguity and ensure that priority directives are correctly interpreted.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The suggested fix requires changes to the agent's behavior and the scheduled task system to ensure that user directives are correctly enforced across sessions.

Recommendation

Apply a workaround by implementing a manual blocklist check for scheduled tasks until a more comprehensive fix can be developed, as this will help prevent similar unauthorized work in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING