UserPromptSubmit hooks don't fire when launched from a subdirectory
Resolved 💬 3 comments Opened Apr 14, 2026 by atomarch Closed Apr 18, 2026
Bug
UserPromptSubmit hooks defined in .claude/settings.json at the project root don't fire when Claude Code is launched from a subdirectory of the repo. Other settings from the same file (e.g., permissions) load correctly.
Repro
- Define a
UserPromptSubmithook in<repo-root>/.claude/settings.json:
{
"permissions": {
"allow": ["Bash(myscript:*)"]
},
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "echo '{\"additionalContext\": \"hook fired\"}'"
}
]
}
]
}
}
cd <repo-root>/dir1/dir2/and runclaude- Type any prompt
Expected: Hook fires and injects additionalContext.
Actual: Hook does not fire. Claude processes the prompt normally with no hook involvement. Permissions from the same .claude/settings.json file are loaded and enforced correctly.
Running claude from the repo root with the same settings works as expected — the hook fires on every prompt.
Environment
- macOS (Darwin 24.6.0)
- Claude Code CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗