aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-07-04 01:05:49 +0900
committernsfisis <nsfisis@gmail.com>2025-07-04 01:05:49 +0900
commita515b5dc7053fa4ba4e93eb744270af640734855 (patch)
treedcd46a2c76ed81cb22b1d737e6d5f0e18b0e3e59
parenta944fb5c719bb4cdc7d541e28d2dde881eac5248 (diff)
downloaddotfiles-a515b5dc7053fa4ba4e93eb744270af640734855.tar.gz
dotfiles-a515b5dc7053fa4ba4e93eb744270af640734855.tar.zst
dotfiles-a515b5dc7053fa4ba4e93eb744270af640734855.zip
claude-code: add settings.json
-rw-r--r--.config/claude-code/settings.json43
-rwxr-xr-xbin/__claude-code-notify19
-rw-r--r--home-manager/config/sh/claude-code.sh3
-rw-r--r--justfile4
-rw-r--r--mitamae/default.rb3
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
diff --git a/justfile b/justfile
index 8eb6577..a6f078d 100644
--- a/justfile
+++ b/justfile
@@ -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"