Skip to content

Commit 6451d7f

Browse files
Alan Shumclaude
andcommitted
fix: move hook script to hooks.example/ to prevent self-triggering
Move refresh-semantic-diff.sh from .claude/hooks/ to .claude/hooks.example/ so the project-level hook doesn't trigger semantic-diff within the semantic-diff repo itself. Update README with setup note about using global settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f022949 commit 6451d7f

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed
File renamed without changes.

.claude/settings.local.json

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
{
2-
"hooks": {
3-
"PostToolUse": [
4-
{
5-
"matcher": "Edit|Write",
6-
"hooks": [
7-
{
8-
"type": "command",
9-
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/refresh-semantic-diff.sh",
10-
"async": true,
11-
"timeout": 10
12-
}
13-
]
14-
}
15-
]
16-
}
17-
}
1+
{}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,18 @@ semantic-diff is designed to work as a live diff viewer alongside Claude Code.
136136

137137
### Setup
138138

139-
1. Copy the hook script:
139+
1. Copy the hook script (an example is provided in `.claude/hooks.example/`):
140140

141141
```bash
142142
mkdir -p ~/.claude/hooks
143-
cp .claude/hooks/refresh-semantic-diff.sh ~/.claude/hooks/
143+
cp .claude/hooks.example/refresh-semantic-diff.sh ~/.claude/hooks/
144144
chmod +x ~/.claude/hooks/refresh-semantic-diff.sh
145145
```
146146

147147
2. Add to your Claude Code settings (`~/.claude/settings.local.json`):
148148

149+
> **Note:** Add this to your **global** (`~/.claude/settings.local.json`) or **user-level** settings, not the project-level `.claude/settings.local.json`. Adding it to the project settings will cause the hook to trigger within the semantic-diff repo itself, repeatedly opening new semantic-diff instances.
150+
149151
```json
150152
{
151153
"hooks": {

0 commit comments

Comments
 (0)