Per QA round 1 (PR #36, finding #7): hooks/global/webfetch-nudge.sh re-implements project-root detection (git rev-parse --show-toplevel + md5 hashing) instead of sourcing the shared hooks/lib/project-root.sh library that hooks/project/ctx-execute-enforcer.sh uses.
Consequences:
- In a monorepo submodule, the hook resolves to the submodule root rather than the outermost project root. A
context-mode entry registered in the outermost .mcp.json may be missed (though the CLAUDE_CONFIG_DIR / global-settings fallback usually catches this).
- Cache key for
/tmp/ctx-webfetch-avail-<hash> diverges between the webfetch-nudge hook and the ctx-execute-enforcer hook when run against the same monorepo submodule.
Fix options:
- Source
hooks/lib/project-root.sh and use the shared PROJECT_ROOT / PROJECT_HASH variables.
- Explicitly document that webfetch-nudge uses event-
cwd-first detection intentionally (and accept the monorepo caveat).
Context: #36 (comment)
Per QA round 1 (PR #36, finding #7):
hooks/global/webfetch-nudge.shre-implements project-root detection (git rev-parse --show-toplevel+ md5 hashing) instead of sourcing the sharedhooks/lib/project-root.shlibrary thathooks/project/ctx-execute-enforcer.shuses.Consequences:
context-modeentry registered in the outermost.mcp.jsonmay be missed (though theCLAUDE_CONFIG_DIR/ global-settings fallback usually catches this)./tmp/ctx-webfetch-avail-<hash>diverges between the webfetch-nudge hook and the ctx-execute-enforcer hook when run against the same monorepo submodule.Fix options:
hooks/lib/project-root.shand use the sharedPROJECT_ROOT/PROJECT_HASHvariables.cwd-first detection intentionally (and accept the monorepo caveat).Context: #36 (comment)