Scheduled tasks hang forever: Bash commands with shell expansion get no permission suggestions, can never auto-approve, and exhaust active-session limits
Summary
In Claude Desktop's local scheduled tasks ([CCDScheduledTasks]), a Bash tool-permission request for any command containing shell expansion ($VAR, ${...}, $(...), backticks) arrives with no permission suggestions. Scheduled-task auto-approval matches suggestions against the task's stored approvals, so a suggestion-less request can never be auto-approved — the unattended session emits an interactive permission prompt nobody is present to answer and hangs indefinitely. Hung sessions keep counting toward the active-session limits, so subsequent scheduled fires are silently skipped (Skipping dispatch ... global_limit (active=3, limit=3) / per_task_limit), which cascades into all scheduled routines silently failing.
Environment
- Claude Desktop (macOS) 1.12603.1
- Bundled Claude Code CLI 2.1.170
- macOS Darwin 25.4.0 (Apple Silicon)
Repro
- Create a local scheduled task whose work involves a Bash command with a shell variable, e.g.
SLUG=/tmp/foo; find "$SLUG" -name '*.json'(any$VAR/$()form reproduces). - Let it fire unattended.
~/Library/Logs/Claude/main.logshows:
````
[CCDScheduledTasks] Not auto-approving "Bash" in scheduled task "<task>": no suggestions on request
Emitted tool permission request <uuid> for Bash in session local_<id>
- The session freezes right after its first such tool_use (transcript stops growing; zero tool_results). It stays "active" indefinitely; later fires of any task are skipped with
Skipping dispatch ... global_limit/per_task_limit.
Literal-only Bash commands in the same session log Auto-approved tool permission for "Bash" and proceed normally, and MCP tool requests carry suggestions normally (rule(s) not in stored approvals: ... (stored count=N)) — the gap is specific to expansion-bearing Bash commands.
Expected
Some combination of:
- Generate at least an exact-command (or bare-
Bash) suggestion for expansion-bearing commands so stored approvals can match, or - In scheduled/unattended sessions, deny-and-continue (so the model can adapt) instead of emitting an interactive prompt that can never be answered, and/or
- A timeout on unanswered permission prompts in scheduled sessions so hung runs don't exhaust the active-session limits and silently block all other scheduled tasks.
Impact
One expansion-bearing Bash command in any scheduled task's flow silently kills that run and (via the active-session limits) starves every other scheduled task — with nothing surfaced in the UI. It took log forensics in main.log to distinguish this from a crash.