fix: improve state detection accuracy and notification UX
- Hook reads JSON from stdin (not env vars) matching Claude Code protocol - end_turn = Idle (not NeedsInput); real questions come from hooks - Permission prompt (stale tool_use) never becomes Idle - Notifications auto-expire after 10s (--expire-time) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
setup.go
14
setup.go
@@ -7,15 +7,11 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// parseHookEnv builds a HookEvent from Claude Code hook environment variables.
|
||||
func parseHookEnv() HookEvent {
|
||||
return HookEvent{
|
||||
SessionID: os.Getenv("SESSION_ID"),
|
||||
Cwd: os.Getenv("SESSION_CWD"),
|
||||
HookEventName: os.Getenv("HOOK_EVENT_NAME"),
|
||||
NotificationType: os.Getenv("NOTIFICATION_TYPE"),
|
||||
ToolName: os.Getenv("TOOL_NAME"),
|
||||
}
|
||||
// parseHookStdin reads a HookEvent from stdin (Claude Code sends JSON on stdin).
|
||||
func parseHookStdin() HookEvent {
|
||||
var event HookEvent
|
||||
json.NewDecoder(os.Stdin).Decode(&event)
|
||||
return event
|
||||
}
|
||||
|
||||
// runSetup adds vmux hooks to ~/.claude/settings.json (idempotent).
|
||||
|
||||
Reference in New Issue
Block a user