fix:fallback to args for SessionStart when CLAUDE_PLUGIN_ROOT env is … - #177
fix:fallback to args for SessionStart when CLAUDE_PLUGIN_ROOT env is …#177meet987654 wants to merge 1 commit into
Conversation
rajpratham1
left a comment
There was a problem hiding this comment.
The updated agent-owned-edit criteria better match the stated intent of the evaluation by checking that the agent commits to performing the edit itself and explains the concrete action and verification. The change is focused and consistent with the PR goal. I don't see any blocking issues.
codeCraft-Ritik
left a comment
There was a problem hiding this comment.
Cross-Platform / Path Safety:
When relying on argument substitution via args in hooks.json, how does the desktop app interpolate ${CLAUDE_PLUGIN_ROOT} when the path contains spaces or non-ASCII characters (e.g., macOS /Users/user name/Library/Application Support/... or Windows paths with backslashes)?
Confirm that the hook configuration passes the argument as an isolated array element rather than a raw shell-interpolated string to prevent accidental argument splitting.
|
Thanks for the review and great question regarding path safety! Yes, it is completely safe from argument splitting. By placing Because it's executed as a discrete array element rather than a raw shell string ( Furthermore, we actually have test coverage specifically validating this behavior! In |
Summary
Fixes #129.
The
SessionStartalways-on hook silently fails on the Claude Code desktop app (macOS) because the app does not exportCLAUDE_PLUGIN_ROOTinto the hook process environment (it only substitutes it into the hook arguments).This PR modifies
hooks/hooks.jsonto safely re-introduce theargsarray while keeping thenode -escript. It allows the hook to fall back toprocess.argv[1]when the environment variables are missing, ensuring the ADHD mode flag check loads correctly on the desktop app. A visibleconsole.errorhas also been added in the rare case that the variable is completely absent.Unit tests (
tests/test_always_on_hooks.py) have been updated to support the newargsarray configuration without breaking Codex compatibility.Authorship and provenance — select exactly one
Agent/tool and model/version:
Antigravity IDE (Gemini)
Agent contribution:
Investigated the root cause in the git history, identified the need for a fallback via
argsinhooks.json, updated the unit tests to pass the new command structure, and verified the fix locally.Human verification:
Approved the implementation plan, reviewed the test results, created the branch, and pushed the commit.
Known limitations or uncertain results:
None.
Labels
Target label:
type: bugAuthor label:
author: communityWorkflow labels:
status: review-readySafety and side effects
Side effects, permissions, network access, and cost:
No side effects. This executes entirely locally.
Compatibility
Migration or rollback notes:
N/A
Verification
python -m unittest discover -s tests -v—Ran 50 tests in 32.890s. OKBehavior evals:
N/A (Hooks configuration change, unit test coverage is sufficient)
Final accountability