anthropics / anthropics/claude-code

[BUG]Scheduled task stalls indefinitely on Write permission prompt despite matching allow rule (settings.json correct)

Open
#87,843 2 comments 0 reactions 0 assignees View on GitHub
area:permissions area:skills bug platform:macos stale
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

A custom scheduled task repeatedly triggers a Write tool permission dialog even though the target path is explicitly covered by an allow rule in permissions.allow in both the project-level and user-level settings.json. On most mornings a human was present to click "Allow" manually, but on 2026-08-19 nobody was present in time and the session went idle instead of completing. task stalls indefinitely on Write permission prompt despite matching allow rule (settings.json correct)

### What Should Happen?

The Write call should be auto-approved by the matching allow rule, exactly as it is in an interactive session with identical settings — the same call, run manually afterward with the same config, completed with zero prompts.

### Error Messages/Logs

```shell
No stack trace available — the failure mode is a permission dialog ("Allow Claude to write .md?") followed by the session state changing to "Connection went idle" with no further output.
```

### Steps to Reproduce

1.Create a scheduled task (via the scheduled-tasks skill) that writes files under a project directory, e.g. ~/PKA/Obserwacje/*.md.
2.Add "Write(/Users//PKA/**)" to permissions.allow in both /.claude/settings.json and ~/.claude/settings.json (verified identical, no drift, no conflicting settings.local.json).
3.Let the scheduled task fire unattended (no interactive session open).
4.On several mornings (2026-08-01, 08-02, 08-03, 08-04, 08-05, 08-14, 08-19) the run stalls on a Write permission dialog for a path matched by the allow rule.
5.Run the identical Write call manually in an interactive session with the same settings — it completes with no prompt.
Note: duplicate/parallel task firing was ruled out via mcp__scheduled-tasks__list_scheduled_tasks (only one instance ran).

### Claude Model

Not sure / Multiple models

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.179 (Claude Code)

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

Non-interactive/CI environment

### Additional Information

This happens specifically in the scheduled-task execution context (Claude Code's own scheduled-tasks feature), not in an interactive terminal session — the same Write call in an interactive session with identical settings never prompts. macOS 26.5.2 (build 25F84), Darwin 25.5.0, arm64.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the scheduled-tasks skill and compare an unattended run with the identical interactive Write call. Check the project-level and user-level settings.json permission rules and use mcp__scheduled-tasks__list_scheduled_tasks to confirm a single run; done means a matching Write rule is auto-approved in the scheduled-task context without the session going idle.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.