MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / hook_cursor_post_tool_use

Function hook_cursor_post_tool_use

src/hooks/cursor.rs:68–76  ·  view source on GitHub ↗

Cursor `postToolUse` hook handler. Emits soft `additional_context` hints steering exploration tools (Grep, Glob, Read, semantic search, shell `rg`) toward tracedecay MCP tools. Registered on `postToolUse` rather than `preToolUse` because Cursor's documented `preToolUse` output schema has no context-injection field — `additional_context` is only honored on `postToolUse`. The hook runs unmatched (t

()

Source from the content-addressed store, hash-verified

66/// category is emitted at most once per session via
67/// [`super::tool_hints::ToolHintDedupe`] persisted under `.tracedecay/`.
68pub fn hook_cursor_post_tool_use() -> i32 {
69 let event = read_hook_event!();
70 let root = cursor_project_root_from_event(&event);
71 record_hook_invoked(root.as_deref(), HintAgent::Cursor, "postToolUse", &event);
72 if let Some(decision) = cursor_post_tool_use_decision(&event) {
73 println!("{decision}");
74 }
75 0
76}
77
78/// Cursor `beforeSubmitPrompt` hook handler.
79///

Callers 1

handle_hook_commandFunction · 0.85

Calls 3

record_hook_invokedFunction · 0.85

Tested by

no test coverage detected