Scheduled tasks ignore project-pinned model (run on claude-opus-5-5 instead of settings.json's model); permission gate occasionally stalls despite defaultMode:auto
Description
Scheduled tasks (created via create_scheduled_task, running non-interactively/headless) ignore the model pinned in the project's .claude/settings.json and run on claude-opus-5-5 instead. Separately (possibly related, possibly not), one run of the same recurring scheduled task hung waiting on a permission decision for most of its execution, despite permissions.defaultMode: "auto" in the same settings file, then recovered near the end of its own accord.
This is a regression we previously worked around by pinning the model explicitly; the pin is silently not honored for headless/scheduled-task sessions specifically (interactive sessions in the same project honor it correctly).
Environment
- Windows 11 Pro, Claude Code desktop app
- Project
.claude/settings.json:
``json``
{
"model": "claude-sonnet-5",
"permissions": { "defaultMode": "auto" }
}
- Tasks created with the scheduled-tasks MCP (
create_scheduled_task), running on standard cron schedules (e.g.10,45 8,9 * * 1-5).
Steps to reproduce
- Set
.claude/settings.jsonat the project root with"model": "claude-sonnet-5"and"permissions": {"defaultMode": "auto"}. - Create a recurring scheduled task in that project via the scheduled-tasks MCP.
- Let it fire on its cron schedule (headless, no user present).
- Inspect the resulting session's metadata (e.g. via
get_session/ session list):modelreportsclaude-opus-5-5, notclaude-sonnet-5.
Observed today (2026-09-28), three separate scheduled-task runs, same project
| Run (local time Paris) | Task | Model reported by session metadata | Outcome |
|---|---|---|---|
| 08:19 | premarket-nq-matin | claude-opus-5-5 | completed normally |
| 15:10 | premarket-nq-prebrief | claude-opus-5-5 | completed, but the run's own final message states the permission gate returned no verdict for most of the execution ("le contrôle d'autorisation n'a rendu aucun verdict"), causing several data sections to be marked unavailable instead of being fetched |
| 15:21 | premarket-nq-ajustement | claude-opus-5-5 | completed normally |
All three sessions belong to the same project, whose .claude/settings.json pins claude-sonnet-5 and permissions.defaultMode: "auto". The file was not modified between runs (git history / file mtime confirm this). This is a recurrence of a symptom we first hit about a week earlier in the same project (model silently reverting to Opus on scheduled tasks; permission mode intermittently not resolving despite defaultMode: "auto"), which we thought we had worked around by pinning the model explicitly — the pin is evidently not applied to headless scheduled-task sessions.
Impact
- Unwanted token/cost consumption on a more expensive model than configured.
- Occasional silent degradation of scheduled-task output (sections skipped) when the permission gate stalls, with no error surfaced to the user — only discoverable by reading the task's own log output after the fact.
Expected behavior
- A scheduled/headless session should honor
.claude/settings.json'smodelexactly like an interactive session in the same project. permissions.defaultMode: "auto"should reliably auto-resolve permission checks in headless mode, or the task should fail fast/loud instead of silently stalling for most of its runtime.