Scheduled Routines re-prompt for already-allowed permissions.allow actions on every run
Summary
A scheduled task (Routine) keeps hitting manual permission prompts for actions that are already present in the global ~/.claude/settings.json permissions.allow list — every single scheduled run, not just once.
Environment
- Claude Code CLI, scheduled tasks / "Routines" feature (create_scheduled_task / list_scheduled_tasks tools)
- macOS
Steps to reproduce
- Create a scheduled task (cron-based Routine) whose prompt periodically writes to a fixed file path, e.g.
Write(/path/to/state/seen_cards.json). - Add an explicit rule to
~/.claude/settings.json:
``json``
"permissions": {
"allow": [
"Write(/path/to/state/*)"
]
}
- Let the Routine fire on its cron schedule multiple times (in our case, hourly).
- Each time it fires, click "Always allow" on the resulting permission prompt for that same Write action.
Expected behavior
Per the tool's own documented behavior when creating a scheduled task:
"Tool approvals granted during a run are stored on the task and auto-applied to future runs."
Combined with an already-matching permissions.allow rule in global settings, the task should never prompt for this action again — this is the entire point of running something unattended on a schedule with nobody present to click through prompts.
Actual behavior
- Checked via session-management tooling: every scheduled fire of the Routine spins up a brand-new session (distinct session IDs, roughly one per hour: e.g. 6 different session IDs across 07:06, 08:05, 09:05, 11:14, 11:46, 11:51 UTC in one day for the same taskId).
- Despite the identical
Write(...)rule being present in~/.claude/settings.jsonthe entire time (verified byte-for-byte, no typos/encoding issues), and despite clicking "Always allow" on this exact action in a previous run, the very next hourly run prompts for the same action again. - This happens for multiple distinct scheduled tasks (we observed it on two separate Routines), and for multiple distinct action types (Write to a state file, Edit to a JSON registry file, etc.) — not an isolated one-off.
- Net effect: a Routine that is supposed to run fully unattended cannot actually do so, because it re-prompts for the same already-allowlisted action on every scheduled fire, and nobody is present to answer the prompt (it's an unattended automation by design).
Impact
This defeats the core purpose of scheduled Routines for any workflow that needs to write/edit files or run non-trivial Bash commands — the automation stalls waiting on a permission prompt that a human may not see for hours, even though the exact same action was pre-approved both in global settings and via prior "Always allow" clicks on the very same task.
Suggested fix / question
- Either honor
~/.claude/settings.jsonpermissions.allowrules for scheduled-task sessions the same way they're honored in interactive sessions, or - Make the "approvals are stored on the task and auto-applied to future runs" behavior actually persist across the new session created on each scheduled fire (right now it appears not to, or to reset every time a new session is spun up).
Happy to provide more repro details / session IDs if useful.