[BUG] CCR remote agent commits to local branch without pushing — work lost when sandbox terminates
Preflight Checklist
- [x] I have searched existing issues 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?
When a scheduled remote agent (CCR) creates a git commit, it does so on a local branch inside the ephemeral sandbox. The sandbox terminates after the session ends, and the commit is permanently lost — there is no automatic git push before teardown.
What Should Happen?
The CCR runtime should automatically push any committed branches to the remote repository before the sandbox terminates. Alternatively, the documentation and/or the agent's system prompt should make it explicitly clear that the user's prompt must include git push — and ideally the runtime should warn or fail visibly if commits exist but were not pushed at session end.
Error Messages/Logs
- No error, no warning, no indication that the push was missing — the routine status showed ended_reason: "run_once_fired" as if everything succeeded
Steps to Reproduce
- Create a one-time scheduled routine via the RemoteTrigger API with a git repository source
- Include instructions for the agent to write a file and commit it
- Wait for the routine to fire
- Check the GitHub repository — the branch and commit are absent
- Check the routine's job_config response — it shows outcomes[].git_repository.git_info.branches: ["claude/quirky-euler"], confirming the branch was created inside the sandbox but never
pushed
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.119 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Impact
- ~12% of weekly token quota consumed with zero recoverable output
- No error, no warning, no indication that the push was missing — the routine status showed ended_reason: "run_once_fired" as if everything succeeded
Environment
- Claude Code CLI (scheduled routines / CCR)
- Environment: env_01MKmuuDckQzSYZBBa7xYzEG (anthropic_cloud)
- Model: claude-opus-4-7
- Trigger type: run_once_at (one-shot)
- Repository: GitHub (public)
Suggested fix
Either:
- Auto-push all local commits before sandbox teardown, or
- Detect unpushed commits at session end and surface a clear warning/error in the routine's outcome metadata, or
- Add a prominent note in the CCR documentation that prompts must explicitly include git push to persist work
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗