fix(console): re-anchor claude() in pane shells after session exit#61
Merged
Conversation
- _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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_CL_ANCHOR_PRELUDEnow resolvesclvia$CL_HOME(works in non-login shells where~/.bashrchasn't been sourced)get_claude_commandwritesconsole-rc-{key}.shwith aclaude()function that callscl session startbefore launching — shared between the post-claude drop-to-shell and the shell panewhile true; do bash -l) updated to use--rcfileso typingclaudethere re-anchors automaticallytest_anchor_launch.pyassertion updated to match new prelude shapeBefore: closing claude dropped to bare
bash -l; typingclaudeagain was unanchored → ContextGuard blocked everything.After: the shell after claude exit has
claude()that runscl session start→ fresh anchor → new session starts clean.Test plan
pytest tests/test_anchor_launch.py— 2 passedcustodian-multiclean (pre-push)🤖 Generated with Claude Code