Skip to content

Commit cd89cf1

Browse files
committed
config: Anchor Claude hook script path to $CLAUDE_PROJECT_DIR
Hook commands used a relative .claude/hooks path, which breaks when Claude Code runs commands from a subdirectory. Quote and resolve the script path via $CLAUDE_PROJECT_DIR in the pkl renderer and regenerate the settings.json outputs.
1 parent 0a7c4f7 commit cd89cf1

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

.claude/settings.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/assets/generated/config/claude/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce policy bash"
10+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce policy bash"
1111
}
1212
]
1313
}
@@ -18,15 +18,15 @@
1818
"hooks": [
1919
{
2020
"type": "command",
21-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks diff-trace"
21+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks diff-trace"
2222
}
2323
]
2424
},
2525
{
2626
"hooks": [
2727
{
2828
"type": "command",
29-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
29+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
3030
}
3131
]
3232
}
@@ -36,7 +36,7 @@
3636
"hooks": [
3737
{
3838
"type": "command",
39-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
39+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
4040
}
4141
]
4242
}
@@ -46,7 +46,7 @@
4646
"hooks": [
4747
{
4848
"type": "command",
49-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
49+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
5050
}
5151
]
5252
}

config/.claude/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce policy bash"
10+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce policy bash"
1111
}
1212
]
1313
}
@@ -18,15 +18,15 @@
1818
"hooks": [
1919
{
2020
"type": "command",
21-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks diff-trace"
21+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks diff-trace"
2222
}
2323
]
2424
},
2525
{
2626
"hooks": [
2727
{
2828
"type": "command",
29-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
29+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
3030
}
3131
]
3232
}
@@ -36,7 +36,7 @@
3636
"hooks": [
3737
{
3838
"type": "command",
39-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
39+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
4040
}
4141
]
4242
}
@@ -46,7 +46,7 @@
4646
"hooks": [
4747
{
4848
"type": "command",
49-
"command": "bash .claude/hooks/run-sce-or-show-install-guidance.sh sce hooks conversation-trace"
49+
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh\" sce hooks conversation-trace"
5050
}
5151
]
5252
}

config/pkl/renderers/claude-content.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import "claude-metadata.pkl" as metadata
44

55
local missingSceInstallMessage = "sce CLI not found. Install it from https://sce.crocoder.dev/docs/getting-started#install-cli"
66

7-
local claudeSceHookScriptPath = ".claude/hooks/run-sce-or-show-install-guidance.sh"
7+
local claudeSceHookScriptPath = "$CLAUDE_PROJECT_DIR/.claude/hooks/run-sce-or-show-install-guidance.sh"
88

9-
local function sceHookCommand(arguments: String): String = "bash \(claudeSceHookScriptPath) \(arguments)"
9+
local function sceHookCommand(arguments: String): String = "bash \\\"\(claudeSceHookScriptPath)\\\" \(arguments)"
1010

1111
local agentFrontmatterBySlug = new Mapping {
1212
for (unitSlug, _ in shared.agents) {

0 commit comments

Comments
 (0)