-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Environment
- roborev version: v0.31.1
- Claude Code version: 2.1.42
- OS: Linux (devcontainer)
- Agent: claude-code
- Command:
roborev review
Problem
When running roborev review with the claude-code agent configured, all review jobs fail with:
agent: claude failed: exit status 1 (parse error: no valid stream-json events parsed from output)
stderr: Error: Claude Code cannot be launched inside another Claude Code session.
Nested sessions share runtime resources and will crash all active sessions.
To bypass this check, unset the CLAUDECODE environment variable.
This happens when roborev is run from a regular terminal (not within an active Claude Code session).
Verified:
- The
CLAUDECODEenvironment variable is not set (echo $CLAUDECODEreturns empty) - No Claude Code process is running (
ps aux | grep claudeshows no active sessions) - Running from a standard terminal in a devcontainer
Suspected root cause
roborev appears to be spawning Claude Code in a way that causes it to detect a nested session. This might be:
- Spawning
claudemultiple times in sequence - Not properly cleaning up environment state between calls
- Some interaction with how roborev's worker pool manages Claude Code processes
Claude Code has guards against nested sessions that check more than just the CLAUDECODE variable - they may detect process hierarchy, sockets, or other runtime state.
Expected behaviour
roborev should be able to use the claude-code agent without triggering nested session errors, or should provide clear guidance on how to configure it properly for environments where the CLI approach won't work.
Suggested fix
This is my first time using roborev. Not sure if I have missed something but I wonder if something in roborev needs to be adjusted to avoid nesting sessions.
Related
- Claude Code nested session guard: [DOCS] Session docs missing nested-Claude launch guard behavior and recovery guidance anthropics/claude-code#25434