anthropics / anthropics/claude-code

[BUG] Scheduled routine "Run Now" hangs at "Initialized session" — possible regression of #84271

Open
#89,135 1 comment 0 reactions 0 assignees View on GitHub
area:routines bug has repro platform:web
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?

Created a scheduled cloud routine (Claude Code Routines / RemoteTrigger API) with job_config.ccr.session_context.events containing one type: "user" message, and Gmail + Google Calendar MCP connectors attached. Running it (both via manual "Run Now" and the API run action) consistently produces a session that opens, shows "Initialized session," and then does nothing — no assistant turn, no tool call, no response to the prompt at all.

This looks like the same symptom as #84271 ("Cloud routine sessions 'Complete' without ever processing the initial prompt message"), which was closed without a resolution comment. Reproduced fresh today, so flagging in case it's a regression or the fix was incomplete.

### What Should Happen?

The scheduled routine should process the initial prompt message and actually execute — e.g. search Gmail/Calendar and produce the digest it was configured to generate — instead of idling indefinitely after "Initialized session."

### Error Messages/Logs

```shell
No error is shown — that's the problem. GET /v1/code/sessions/{id}/events shows only environment provisioning events (sandbox allocated, Claude Code process started), then nothing further. Both stuck sessions stayed at worker_status: idle for 45+ minutes with zero additional events.

Trigger: trig_01TpKG1YKz9yNg6nkLEahf7n
Stuck sessions: cse_01EggXthZPAMZN31DTMPf1am, cse_01RqeZ13BydGXewQytsvLqdd
Environment: env_01FekAh6dF6nYSuQQDrxV58R (Default)
Related: #84271 (closed, same symptom, no resolution noted)
```

### Steps to Reproduce

1. Create a routine via POST /v1/code/triggers with job_config.ccr.session_context.events containing one type: "user" message, and Gmail + Google Calendar MCP connectors attached.
2. Trigger action: "run" (also reproduced via the Routines page "Run Now" button).
3. Session opens, shows "Initialized session," and never progresses.

### Claude Model

Sonnet (default)

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

claude --version

### Platform

Other

### Operating System

Windows

### Terminal/Shell

PowerShell

### Additional Information

This bug is specifically about the claude.ai/code cloud routines feature (scheduled agents), not the local CLI — several fields above (OS, terminal, Claude Code version) may not be directly applicable since the failure happens in Anthropic's cloud dispatcher, not on my machine.
Platform is "Other" because this is via claude.ai's Routines/Claude Code cloud feature (claude.ai/code/routines), not direct Anthropic API usage.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the trigger through POST /v1/code/triggers and the Routines page “Run Now” action, then inspect GET /v1/code/sessions/{id}/events for the provisioning and initialization sequence. Done means the session processes the initial user message, performs the configured Gmail or Google Calendar tool call, and produces a response instead of remaining idle.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.