fix(launch): forward env vars into tmux sessions#2190
fix(launch): forward env vars into tmux sessions#2190pgagarinov wants to merge 4 commits intoYeachan-Heo:devfrom
Conversation
tmux new-session inherits the server's environment, not the calling process's. When CLAUDE_CONFIG_DIR is set before running omc, the value is picked up by prepareOmcLaunchConfigDir() but silently lost when the tmux session spawns because the server was started earlier without it. Inject critical env vars as export statements into the shell command that runs inside the tmux pane, after .zshrc/.bashrc sourcing so omc values take precedence over stale tmux server state. Values are quoted via the existing quoteShellArg helper. Constraint: tmux server env is inherited at session creation, not client env Rejected: tmux set-environment before new-session | race with concurrent launches Rejected: tmux new-session -e flag | requires tmux 3.2+, not portable Confidence: high Scope-risk: narrow Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Skill markdown files hardcoded $HOME/.claude in bash code blocks,
ignoring the user's CLAUDE_CONFIG_DIR override. Replace all instances
with ${CLAUDE_CONFIG_DIR:-$HOME/.claude} so skills respect custom
config directories.
Also adds a regression test that scans all skill markdown files for
bash blocks containing bare $HOME/.claude without the fallback pattern.
Confidence: high
Scope-risk: narrow
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The installer generates shell commands for settings.json hooks and HUD
statusLine that hardcode $HOME/.claude. When a user runs a different
profile via CLAUDE_CONFIG_DIR, these commands point to the wrong
directory.
Replace $HOME/.claude with ${CLAUDE_CONFIG_DIR:-$HOME/.claude} in
generated Unix commands so hooks and HUD resolve to the active profile
at runtime while preserving the $HOME/.claude default.
Also updates hud SKILL.md JSON examples and adds backward-compat tests
ensuring isOmcHook/isOmcStatusLine recognize both old and new formats.
Confidence: high
Scope-risk: moderate
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The pre-tool enforcer was updated to use PreToolUse deny API (permissionDecision: 'deny') but the test still expected the old decision: 'block' format. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Thanks — there is useful work in here, especially the tmux env-forwarding direction and the CLAUDE_CONFIG_DIR coverage improvements. The allowlisted export approach itself looks reasonably safe. I'm still marking this request-changes / not-merge-ready for two concrete reasons:
The current failing CI signal is also not clean because If you want this to land, please split and resend as a tighter PR focused on the actual tmux / CLAUDE_CONFIG_DIR fix path only, without the unrelated pre-tool-enforcer contract adjustment. — |
|
Closing for now instead of leaving this in request-changes limbo. Please reopen as a tighter PR scoped only to the tmux / CLAUDE_CONFIG_DIR fix path, without unrelated contract shifts.\n\n—\n*[repo owner's gaebal-gajae (clawdbot) 🦞]* |
Summary
Comprehensive fix for
CLAUDE_CONFIG_DIRnot being respected across OMC. Three commits:1. fix(launch): forward env vars into tmux sessions
tmux new-sessioninherits the server's environment, not the calling process's.CLAUDE_CONFIG_DIRset beforeomcis silently lost when the tmux session spawns.exportstatements into the tmux shell command, after RC sourcing.buildEnvExportPrefix, allowlist contract; integration tests creating real tmux sessions withprintenv(no API tokens), including shell quoting with spaces and single quotes.2. fix(skills): use CLAUDE_CONFIG_DIR in skill bash blocks
$HOME/.claudein bash code blocks. Replaced with${CLAUDE_CONFIG_DIR:-$HOME/.claude}.$HOME/.claudein bash blocks.3. fix(installer): use CLAUDE_CONFIG_DIR in generated hook and HUD commands
settings.jsonhook commands and HUD statusLine commands that hardcode$HOME/.claude. When running with a custom profile, hooks and HUD point to the wrong directory.${CLAUDE_CONFIG_DIR:-$HOME/.claude}in generated Unix commands.isOmcHook/isOmcStatusLinerecognize both old and new command formats.Reproduction
CLAUDE_CONFIG_DIR=~/.claude-personalomc(non--pmode, outside tmux)printenv CLAUDE_CONFIG_DIRshows wrong value/omc-setup— bash commands reference~/.claudeinstead of the custom dirsettings.jsonhooks — commands point to$HOME/.claude/hooks/...Rebased on latest
dev. Supersedes #2170.🤖 Generated with Claude Code