Skip to content

fix(console): re-anchor claude() in pane shells after session exit#61

Merged
ProtocolWarden merged 1 commit into
mainfrom
feat/anchor-pane-shell
May 28, 2026
Merged

fix(console): re-anchor claude() in pane shells after session exit#61
ProtocolWarden merged 1 commit into
mainfrom
feat/anchor-pane-shell

Conversation

@ProtocolWarden
Copy link
Copy Markdown
Owner

Summary

  • _CL_ANCHOR_PRELUDE now resolves cl via $CL_HOME (works in non-login shells where ~/.bashrc hasn't been sourced)
  • get_claude_command writes console-rc-{key}.sh with a claude() function that calls cl session start before launching — shared between the post-claude drop-to-shell and the shell pane
  • Shell pane (while true; do bash -l) updated to use --rcfile so typing claude there re-anchors automatically
  • test_anchor_launch.py assertion updated to match new prelude shape

Before: closing claude dropped to bare bash -l; typing claude again was unanchored → ContextGuard blocked everything.
After: the shell after claude exit has claude() that runs cl session start → fresh anchor → new session starts clean.

Test plan

  • pytest tests/test_anchor_launch.py — 2 passed
  • custodian-multi clean (pre-push)

🤖 Generated with Claude Code

- _CL_ANCHOR_PRELUDE now resolves cl via $CL_HOME (works in non-login
  shells where ~/.bashrc hasn't been sourced)
- get_claude_command writes console-rc-{key}.sh with a claude() function
  that re-anchors on each invocation; post-claude shell uses --rcfile
- Shell pane (while-true loop) also uses --rcfile so `claude` typed
  there anchors automatically — no more blocked sessions after first exit
- test_anchor_launch: assertion updated to match new prelude shape

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ProtocolWarden ProtocolWarden merged commit 254f01d into main May 28, 2026
4 of 5 checks passed
@ProtocolWarden ProtocolWarden deleted the feat/anchor-pane-shell branch May 28, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant