From 7062fed3de5927d302bcb79ba91d9ee9a829d145 Mon Sep 17 00:00:00 2001 From: AviPeltz Date: Thu, 18 Dec 2025 14:50:05 -0800 Subject: [PATCH] fixed weird claude bug --- apps/desktop/src/main/lib/agent-setup.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main/lib/agent-setup.ts b/apps/desktop/src/main/lib/agent-setup.ts index 60697ff2452..2e22ec83e40 100644 --- a/apps/desktop/src/main/lib/agent-setup.ts +++ b/apps/desktop/src/main/lib/agent-setup.ts @@ -90,11 +90,14 @@ function createClaudeWrapper(): void { return; } + // Use $HOME instead of ~ because tilde doesn't expand inside JSON strings. + // Using ~ causes Claude Code's file watcher to malfunction and watch TMPDIR. const script = `#!/bin/bash # Superset wrapper for Claude Code # Injects notification hook settings -SUPERSET_CLAUDE_SETTINGS='{"hooks":{"Stop":[{"hooks":[{"type":"command","command":"~/${SUPERSET_DIR_NAME}/hooks/notify.sh"}]}],"PermissionRequest":[{"matcher":"*","hooks":[{"type":"command","command":"~/${SUPERSET_DIR_NAME}/hooks/notify.sh"}]}]}}' +NOTIFY_SCRIPT="$HOME/${SUPERSET_DIR_NAME}/hooks/notify.sh" +SUPERSET_CLAUDE_SETTINGS="{\\"hooks\\":{\\"Stop\\":[{\\"hooks\\":[{\\"type\\":\\"command\\",\\"command\\":\\"$NOTIFY_SCRIPT\\"}]}],\\"PermissionRequest\\":[{\\"matcher\\":\\"*\\",\\"hooks\\":[{\\"type\\":\\"command\\",\\"command\\":\\"$NOTIFY_SCRIPT\\"}]}]}}" exec "${realClaude}" --settings "$SUPERSET_CLAUDE_SETTINGS" "$@" `;