From 32ba73179396c65991f0df1562aafdeb88a4aaef Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Mon, 6 Jul 2026 22:19:09 -0700 Subject: [PATCH] Move typecheck hook to async PostToolUse for TS/TSX edits Co-Authored-By: Claude Opus 4.8 --- .claude/settings.json | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 84465da..8201cbd 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -9,17 +9,14 @@ "command": ".claude/hooks/lint-on-edit.sh", "timeout": 30, "statusMessage": "Linting..." - } - ] - } - ], - "Stop": [ - { - "hooks": [ + }, { "type": "command", - "command": "output=$(npm run typecheck 2>&1); rc=$?; if [ $rc -ne 0 ]; then printf '{\"systemMessage\":\"TypeCheck failed:\\n%s\"}' \"$(echo \"$output\" | tail -30 | sed 's/\"/\\\\\"/g; s/$/\\\\n/' | tr -d '\\n')\"; fi", - "timeout": 60 + "if": "Write(*.ts)|Write(*.tsx)|Edit(*.ts)|Edit(*.tsx)|MultiEdit(*.ts)|MultiEdit(*.tsx)", + "command": "output=$(npm run typecheck 2>&1); rc=$?; if [ $rc -ne 0 ]; then printf '{\"hookSpecificOutput\":{\"hookEventName\":\"PostToolUse\",\"additionalContext\":\"TypeCheck failed:\\n%s\"}}' \"$(echo \"$output\" | tail -30 | sed 's/\"/\\\\\"/g; s/$/\\\\n/' | tr -d '\\n')\"; fi", + "timeout": 60, + "statusMessage": "Type-checking...", + "async": true } ] }