Skip to content

Instantly share code, notes, and snippets.

@dmateusp
Created May 15, 2026 10:36
Show Gist options
  • Select an option

  • Save dmateusp/b7e61ada4b2ccf64a657ee17a7561d54 to your computer and use it in GitHub Desktop.

Select an option

Save dmateusp/b7e61ada4b2ccf64a657ee17a7561d54 to your computer and use it in GitHub Desktop.
[~/.claude/settings.json] Terminal notifications for Claude Code + VSCode + MacOSX using terminal-notifier: focuses on the VSCode window that Claude notified from, adds the git branch to the notification
{
"effortLevel": "medium",
"model": "sonnet[1m]",
"hooks": {
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message \"Claude has a question in $(basename $PWD)$(git rev-parse --abbrev-ref HEAD 2>/dev/null | sed 's/.*/ [&]/')\" -title \"Claude Code\" -contentImage \"/Applications/Visual Studio Code.app/Contents/Resources/Code.icns\" -sound Glass -execute \"$(which code) --reuse-window '$PWD'\""
}
]
},
{
"matcher": "ExitPlanMode",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message \"Plan ready for review in $(basename $PWD)$(git rev-parse --abbrev-ref HEAD 2>/dev/null | sed 's/.*/ [&]/')\" -title \"Claude Code\" -contentImage \"/Applications/Visual Studio Code.app/Contents/Resources/Code.icns\" -sound Glass -execute \"$(which code) --reuse-window '$PWD'\""
}
]
}
],
"PermissionRequest": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message \"Permission required in $(basename $PWD)$(git rev-parse --abbrev-ref HEAD 2>/dev/null | sed 's/.*/ [&]/')\" -title \"Claude Code\" -contentImage \"/Applications/Visual Studio Code.app/Contents/Resources/Code.icns\" -sound Glass -execute \"$(which code) --reuse-window '$PWD'\""
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message \"Task completed in $(basename $PWD)$(git rev-parse --abbrev-ref HEAD 2>/dev/null | sed 's/.*/ [&]/')\" -title \"Claude Code\" -contentImage \"/Applications/Visual Studio Code.app/Contents/Resources/Code.icns\" -sound Glass -execute \"$(which code) --reuse-window '$PWD'\""
}
]
}
]
}
}
@dmateusp

Copy link
Copy Markdown
Author

For this to work you need:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment