Skip to content

Commit 950ba73

Browse files
committed
clean up hook handling
1 parent bfdcc86 commit 950ba73

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

cmd/entire/cli/hook_registry.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
"github.com/entireio/cli/cmd/entire/cli/agent"
1414
"github.com/entireio/cli/cmd/entire/cli/agent/claudecode"
15-
"github.com/entireio/cli/cmd/entire/cli/agent/cursor"
1615
"github.com/entireio/cli/cmd/entire/cli/agent/geminicli"
1716
"github.com/entireio/cli/cmd/entire/cli/logging"
1817
"github.com/entireio/cli/cmd/entire/cli/paths"
@@ -76,7 +75,6 @@ func newAgentHooksCmd(agentName agent.AgentName, handler agent.HookHandler) *cob
7675
// "tool" for tool-related hooks (before-tool, after-tool),
7776
// "agent" for all other agent hooks.
7877
func getHookType(hookName string) string {
79-
// Note: Claude Code and Cursor share the same hook names (pre-task, post-task, post-todo)
8078
switch hookName {
8179
case claudecode.HookNamePreTask, claudecode.HookNamePostTask, claudecode.HookNamePostTodo:
8280
return "subagent"
@@ -140,16 +138,12 @@ func newAgentHookVerbCmdWithLogging(agentName agent.AgentName, hookName string)
140138
return fmt.Errorf("failed to parse hook event: %w", parseErr)
141139
}
142140

143-
switch {
144-
case event != nil:
141+
if event != nil {
145142
// Lifecycle event — use the generic dispatcher
146143
hookErr = DispatchLifecycleEvent(ag, event)
147-
case agentName == agent.AgentNameClaudeCode && hookName == claudecode.HookNamePostTodo:
148-
// PostTodo creates incremental checkpoints during subagent execution
144+
} else if agentName == agent.AgentNameClaudeCode && hookName == claudecode.HookNamePostTodo {
145+
// PostTodo is Claude-specific: creates incremental checkpoints during subagent execution
149146
hookErr = handleClaudeCodePostTodo()
150-
case agentName == agent.AgentNameCursor && hookName == cursor.HookNamePostTodo:
151-
// PostTodo creates incremental checkpoints during subagent execution
152-
hookErr = handleCursorPostTodo()
153147
}
154148
// Other pass-through hooks (nil event, no special handling) are no-ops
155149

cmd/entire/cli/hooks_cursor_posttodo.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)