Expose hooks configuration through the CLI and SDK
Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 5 comments · opened Jul 25, 2025 · closed Aug 4, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
My scenario is to have a custom mode/agent that is forced into using the "container-use" mcp. Currently, I have to add the following to every single project, but I'm much prefer to create a zsh alias that would trigger this mode/agent.
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "echo \"Remember to always use the mcp__container-use__environment tools!\""
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bun run /Users/johnlindquist/dev/claude-agents/hooks/cc-stop.ts"
}
]
}
]
}
}
5 Comments
At least for the CLI, you can now use the new
--settingsflag. Any hooks you add to the file provided by the flag will be included.Example:
@dicksontsai sweet! Thank you!
To clarify, this is "additional" settings? So it will still load project/global settings? I would love a way to completely isolate the settings of a session to ignore all other mcps/hooks/etc.
Yes,
--settingswould be additional, at least for array-like settings fields such as hooks and mcps.We don't have such a feature yet. The closest is the
CLAUDE_CONFIG_DIRenv var, but that only isolates the home/user settings, not the project settings@dicksontsai Is some sort of "--isolate-settings" feature planned? Should I open an issue?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.