Use absolute path for sandlot-activity binary in Claude hooks

This commit is contained in:
Chris Wanstrath 2026-02-19 19:55:54 -08:00
parent f9f87862b0
commit a6f6d8b067

View File

@ -67,9 +67,10 @@ export async function create(log?: (msg: string) => void): Promise<void> {
log?.("Warning: ANTHROPIC_API_KEY not found in ~/.env — claude will require manual login")
}
const activityBin = `/home/${USER}/.local/bin/sandlot-activity`
const hooks = {
UserPromptSubmit: [{ hooks: [{ type: "command", command: "sandlot-activity active" }] }],
Stop: [{ hooks: [{ type: "command", command: "sandlot-activity idle" }] }],
UserPromptSubmit: [{ hooks: [{ type: "command", command: `${activityBin} active` }] }],
Stop: [{ hooks: [{ type: "command", command: `${activityBin} idle` }] }],
}
const settingsJson = JSON.stringify(apiKey
? { apiKeyHelper: "~/.claude/api-key-helper.sh", skipDangerousModePermissionPrompt: true, hooks }