diff options
| -rw-r--r-- | .config/claude-code/settings.json | 43 | ||||
| -rwxr-xr-x | bin/__claude-code-notify | 19 | ||||
| -rw-r--r-- | home-manager/config/sh/claude-code.sh | 3 | ||||
| -rw-r--r-- | justfile | 4 | ||||
| -rw-r--r-- | mitamae/default.rb | 3 |
5 files changed, 70 insertions, 2 deletions
diff --git a/.config/claude-code/settings.json b/.config/claude-code/settings.json new file mode 100644 index 0000000..b85331f --- /dev/null +++ b/.config/claude-code/settings.json @@ -0,0 +1,43 @@ +{ + "permissions": { + "allow": [ + "Bash(fd:*)", + "Bash(find:*)", + "Bash(grep:*)", + "Bash(ls:*)", + "Bash(mkdir:*)", + "Bash(rg:*)", + "Bash(touch:*)", + + "Bash(git diff:*)", + "Bash(git fetch:*)", + "Bash(git log:*)", + "Bash(git status:*)" + ], + "deny": [ + "Bash(git push:*)" + ] + }, + "hooks": { + "Notification": [ + { + "hooks": [ + { + "type": "command", + "command": "__claude-code-notify Notification" + } + ] + } + ], + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "__claude-code-notify Stop" + } + ] + } + ] + } +} diff --git a/bin/__claude-code-notify b/bin/__claude-code-notify new file mode 100755 index 0000000..18e3ac5 --- /dev/null +++ b/bin/__claude-code-notify @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ "$(uname)" = "Darwin" ]; then + if [ "$1" = "Stop" ]; then + message="Task completed" + sound=Glass + else + message="$(jq '.message')" + sound=Funk + fi + osascript -e "display notification $message with title \"Claude Code\" sound name \"$sound\"" +else + if [ "$1" = "Stop" ]; then + message="Task completed" + else + message="$(jq '.message')" + fi + notify-send "Claude Code" "$message" +fi diff --git a/home-manager/config/sh/claude-code.sh b/home-manager/config/sh/claude-code.sh index 0b467bb..8dc8fc3 100644 --- a/home-manager/config/sh/claude-code.sh +++ b/home-manager/config/sh/claude-code.sh @@ -1,4 +1,3 @@ -# Safe wrappers for Claude Code if [ -n "$CLAUDECODE" ]; then # Safe wrapper for find command find() { @@ -41,4 +40,4 @@ if [ -n "$CLAUDECODE" ]; then command fd "$@" } -fi
\ No newline at end of file +fi @@ -28,3 +28,7 @@ gc: home-manager expire-generations '-1 month' nix profile wipe-history nix store gc + +# TODO +copy-claude-code-settings: + cp .config/claude-code/settings.json ~/.claude/ diff --git a/mitamae/default.rb b/mitamae/default.rb index c9efd3c..e61a798 100644 --- a/mitamae/default.rb +++ b/mitamae/default.rb @@ -56,6 +56,9 @@ directory "#{home}/bin" link "#{home}/bin/tmux-pane-idx" do to "#{home}/dotfiles/bin/tmux-pane-idx" end +link "#{home}/bin/__claude-code-notify" do + to "#{home}/dotfiles/bin/__claude-code-notify" +end # SKK directory "#{home}/.config/skk" |
