Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Fix duplicate command.executed events for Cursor shell hooks

Cursor Agent56d15613a89d
diff --git a/cli/beacon-hooks/cmd/post_tool.go b/cli/beacon-hooks/cmd/post_tool.go
index 791f642e..a89e6741 100644
--- a/cli/beacon-hooks/cmd/post_tool.go
+++ b/cli/beacon-hooks/cmd/post_tool.go
@@ -351,6 +351,12 @@ func emitCursorPostHookObserved(logger *logging.Logger, input map[string]interfa
})
emitHookEvent(logger, "tool.failed", "tool", "high", "Tool execution failed", input, fields)
return true
+ case "postToolUse":
+ toolName := strings.ToLower(getFirstStr(input, "tool_name", "toolName"))
+ if toolName == "shell" || strings.Contains(toolName, "terminal") {
+ return true
+ }
+ return false
default:
return false
}