Problem
ApexStack hooks use relative paths (.claude/hooks/...) and assume the cwd is the ops repo root. When working inside workspace/<project>/, every hook fails with "No such file or directory" because the project repo doesn't have .claude/hooks/.
Additionally, several hooks check issues/PRs against the origin repo, which is wrong when operating cross-repo (e.g. creating a PR for me2resh/curios-dog from the ops repo context).
Affected hooks (all of them)
Path resolution failures (cwd = workspace//)
Every hook fails because .claude/hooks/*.sh doesn't exist in the project repo:
validate-branch-name.sh
block-git-add-all.sh
check-secrets.sh
block-main-push.sh
validate-commit-format.sh
pre-push-gate.sh
require-agdr-for-arch-changes.sh
verify-commit-refs.sh
validate-pr-create.sh
block-unreviewed-merge.sh
require-design-review-for-ui.sh
block-merge-on-red-ci.sh
auto-code-review.sh
Cross-repo logic failures
These hooks check issues/PRs against origin instead of the --repo target:
validate-pr-create.sh — checks issue exists in origin, not the --repo argument
verify-commit-refs.sh — checks Closes #N against origin
block-merge-on-red-ci.sh — can't resolve PRs in other repos
auto-code-review.sh — doesn't auto-trigger Rex for cross-repo PRs
Proposed fix
- Absolute path resolution — hooks should resolve their own location via
$(dirname "$0") or by finding the ops repo root (e.g. walk up from $BASH_SOURCE to find CLAUDE.md)
- Cross-repo awareness — hooks that validate issues/PRs should respect the
--repo flag when present in the command being validated
- Graceful degradation — if a hook can't determine the ops repo root, warn instead of failing silently
Impact
Currently non-blocking (hooks fail with exit code 0 in the "No such file or directory" case), but this means zero SDLC enforcement when working in workspace projects — the exact scenario the portfolio model is designed for.
Problem
ApexStack hooks use relative paths (
.claude/hooks/...) and assume the cwd is the ops repo root. When working insideworkspace/<project>/, every hook fails with "No such file or directory" because the project repo doesn't have.claude/hooks/.Additionally, several hooks check issues/PRs against the origin repo, which is wrong when operating cross-repo (e.g. creating a PR for
me2resh/curios-dogfrom the ops repo context).Affected hooks (all of them)
Path resolution failures (cwd = workspace//)
Every hook fails because
.claude/hooks/*.shdoesn't exist in the project repo:validate-branch-name.shblock-git-add-all.shcheck-secrets.shblock-main-push.shvalidate-commit-format.shpre-push-gate.shrequire-agdr-for-arch-changes.shverify-commit-refs.shvalidate-pr-create.shblock-unreviewed-merge.shrequire-design-review-for-ui.shblock-merge-on-red-ci.shauto-code-review.shCross-repo logic failures
These hooks check issues/PRs against origin instead of the --repo target:
validate-pr-create.sh— checks issue exists in origin, not the--repoargumentverify-commit-refs.sh— checksCloses #Nagainst originblock-merge-on-red-ci.sh— can't resolve PRs in other reposauto-code-review.sh— doesn't auto-trigger Rex for cross-repo PRsProposed fix
$(dirname "$0")or by finding the ops repo root (e.g. walk up from$BASH_SOURCEto findCLAUDE.md)--repoflag when present in the command being validatedImpact
Currently non-blocking (hooks fail with exit code 0 in the "No such file or directory" case), but this means zero SDLC enforcement when working in workspace projects — the exact scenario the portfolio model is designed for.