Skip to content

fix: make Claude hook settings shell neutral - #671

Merged
rafaelscosta merged 1 commit into
mainfrom
fix/claude-hook-settings-windows-path-20260507
May 7, 2026
Merged

fix: make Claude hook settings shell neutral#671
rafaelscosta merged 1 commit into
mainfrom
fix/claude-hook-settings-windows-path-20260507

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace POSIX-only ${CLAUDE_PROJECT_DIR:-.} hook commands in committed Claude settings with shell-neutral relative wrapper commands
  • add a governance regression test that blocks returning to CLAUDE_PROJECT_DIR/${...} syntax
  • bump core package to 5.1.11 and add STORY-123.16 evidence

Validation

  • git diff --check
  • npm test -- tests/claude/subagent-governance.test.js --runInBand --forceExit
  • npm run validate:semantic-lint
  • npm run validate:manifest
  • npm run validate:publish
  • npm run lint -- --quiet
  • npm run typecheck
  • npm run test:ci (315 suites / 7,847 tests passed; 149 skipped)

Context

Clean replacement for the remaining Windows hook command residue from stale PR #551. The older PR remains dirty and broader than the remaining runtime issue; this PR keeps the current wrapper architecture intact.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed hook command paths to be shell-neutral, improving cross-platform compatibility (Windows, macOS, Linux).
  • Tests

    • Added regression test to validate hook command syntax.
  • Documentation

    • Updated story documentation for hook configuration improvements.
  • Chores

    • Bumped package version to 5.1.11.

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 7, 2026 3:59pm

Request Review

@github-actions github-actions Bot added area: agents Agent system related area: workflows Workflow system related squad mcp type: test Test coverage and quality area: core Core framework (.aios-core/core/) area: installer Installer and setup (packages/installer/) area: synapse SYNAPSE context engine area: cli CLI tools (bin/, packages/aios-pro-cli/) area: pro Pro features (pro/) area: health-check Health check system area: docs Documentation (docs/) area: devops CI/CD, GitHub Actions (.github/) labels May 7, 2026
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ccf8aae2-38d0-46b9-b612-69f223e1cbd3

📥 Commits

Reviewing files that changed from the base of the PR and between e83c2a5 and a46215e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .claude/settings.json
  • docs/stories/epic-123/STORY-123.16-claude-hook-settings-windows-path.md
  • package.json
  • tests/claude/subagent-governance.test.js

Walkthrough

This PR removes shell-dependent variable expansion from Claude hook commands, replacing ${CLAUDE_PROJECT_DIR:-.} syntax with direct node .claude/hooks/<name>.cjs invocations. A regression test enforces the new pattern. The package version is incremented to 5.1.11, and a story document records the completed work.

Changes

Shell-Neutral Claude Hooks

Layer / File(s) Summary
Claude Hook Configuration
.claude/settings.json
UserPromptSubmit, PreCompact, and PreToolUse hook commands are updated to use node .claude/hooks/<name>.cjs instead of ${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/<name>.cjs templated paths.
Regression Test
tests/claude/subagent-governance.test.js
New test extracts hook commands from .claude/settings.json, asserts expected wrapper scripts are present, and validates each command lacks CLAUDE_PROJECT_DIR or ${ syntax while matching the node .claude/hooks/<name>.cjs pattern.
Documentation & Version
docs/stories/epic-123/STORY-123.16-claude-hook-settings-windows-path.md, package.json
Story document records acceptance criteria, dev notes, validation commands, and file list. Package version increments from 5.1.10 to 5.1.11.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

area: core, type: test, area: docs

Suggested reviewers

  • Pedrovaleriolopez
  • oalanicolas
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: make Claude hook settings shell neutral' directly and clearly describes the main change: making Claude hook commands platform-independent by removing POSIX-specific syntax.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/claude-hook-settings-windows-path-20260507

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@rafaelscosta
rafaelscosta merged commit a892ff1 into main May 7, 2026
41 checks passed
@rafaelscosta
rafaelscosta deleted the fix/claude-hook-settings-windows-path-20260507 branch May 7, 2026 16:03
tuanmedeiros pushed a commit to tuanmedeiros/aios-core-synkraay that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent system related area: cli CLI tools (bin/, packages/aios-pro-cli/) area: core Core framework (.aios-core/core/) area: devops CI/CD, GitHub Actions (.github/) area: docs Documentation (docs/) area: health-check Health check system area: installer Installer and setup (packages/installer/) area: pro Pro features (pro/) area: synapse SYNAPSE context engine area: workflows Workflow system related mcp squad type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant