Is this a reproducible bug?
Current behavior
On restart, herdr fails to resume claude panes with No conversation found with session ID: <uuid>. herdr-agent-state.sh (integration v5) reports
pane.report_agent_session keyed only by the HERDR_PANE_ID env var, storing just
the id. Any process inheriting that env can claim the pane — including a nested
claude run in a different cwd. The official remember plugin triggers it: it runs
claude -p with cwd=$TMPDIR and inherited env, so its SessionStart hook reports
the throwaway session id (written under ~/.claude/projects/-tmp/) and overwrites
the pane's real id. On restore, claude --resume <id> is cwd-scoped (searches only
~/.claude/projects/<encoded-pane-cwd>/), so the -tmp session is never found.
Expected behavior
A nested/sandboxed claude run must not overwrite a pane's interactive session, and aka stored session must resume (or degrade to a clean start) instead of erroring.
Proposed fix
- Resume by the session's real path, not the pane cwd. The hook already has
transcript_path; the CLI already accepts report-agent --agent-session-path.
Persist it and cd there (or resume by path) on restore — fixes it even for -tmp.
- Authority by PID/foreground, not just HERDR_PANE_ID — only accept reports
from the pane's tracked foreground process, so a sibling nested run can't clobber it.
- Graceful fallback — if the stored session file is missing on restore, start
clean instead of erroring.
Reproduction
- In a herdr claude pane, start interactive
claude in a repo, send a message.
- From inside that pane, run a nested headless claude in another cwd:
( cd /tmp && env CLAUDECODE= claude -p hi --max-turns 1 )
(or just let the remember plugin run its consolidation)
- herdr pane get <pane_id> → agent_session.value now points to a session that
find ~/.claude/projects -name '.jsonl' resolves under projects/-tmp/.
- Restart herdr → pane fails with No conversation found with session ID.
Impact
Loss of claude session continuity on restart — the headline feature. Silent: the
clobber happens in the background, user only sees it after a restart. Affects every
pane whenever a nested/headless claude runs (the bundled remember plugin alone is
enough). codex unaffected (its resume is global, not cwd-scoped).
Environment
herdr 0.6.8, claude integration v5, Linux/WSL2, Claude Code (recent).
Is this a reproducible bug?
Current behavior
On restart, herdr fails to resume
claudepanes withNo conversation found with session ID: <uuid>.herdr-agent-state.sh(integration v5) reportspane.report_agent_sessionkeyed only by theHERDR_PANE_IDenv var, storing justthe id. Any process inheriting that env can claim the pane — including a nested
clauderun in a different cwd. The officialrememberplugin triggers it: it runsclaude -pwithcwd=$TMPDIRand inherited env, so its SessionStart hook reportsthe throwaway session id (written under
~/.claude/projects/-tmp/) and overwritesthe pane's real id. On restore,
claude --resume <id>is cwd-scoped (searches only~/.claude/projects/<encoded-pane-cwd>/), so the-tmpsession is never found.Expected behavior
A nested/sandboxed claude run must not overwrite a pane's interactive session, and aka stored session must resume (or degrade to a clean start) instead of erroring.
Proposed fix
transcript_path; the CLI already accepts report-agent --agent-session-path.
Persist it and cd there (or resume by path) on restore — fixes it even for -tmp.
from the pane's tracked foreground process, so a sibling nested run can't clobber it.
clean instead of erroring.
Reproduction
claudein a repo, send a message.find ~/.claude/projects -name '.jsonl' resolves under projects/-tmp/.
Impact
Loss of claude session continuity on restart — the headline feature. Silent: the
clobber happens in the background, user only sees it after a restart. Affects every
pane whenever a nested/headless claude runs (the bundled remember plugin alone is
enough). codex unaffected (its resume is global, not cwd-scoped).
Environment
herdr 0.6.8, claude integration v5, Linux/WSL2, Claude Code (recent).