Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

When tool hooks run and produce output, the response now includes the path to the hook file that generated the output. This helps models investigate or modify the hook behavior when they receive hook feedback.

Background

Tool hooks can produce output that gets included in the tool result (e.g., formatter messages, lint errors). Previously, the model only saw the output text without knowing which file produced it. Including the hook path enables the model to:

  • Read the hook file to understand its behavior
  • Suggest modifications to the hook if needed
  • Better understand the project's hook configuration

Implementation

  • Added hook_path?: string field to WithHookOutput interface in src/common/types/tools.ts
  • Updated appendHookOutput function to accept and propagate hook paths through all result types
  • Updated all three call sites in withHooks.ts to pass the relevant hook path

Example output

{
  "success": true,
  "output": "...",
  "hook_output": "Formatted: test.ts",
  "hook_duration_ms": 42,
  "hook_path": "/path/to/project/.mux/tool_hook"
}

Validation

  • Extended existing test to verify hook_path is correctly included in results
  • All tests pass, static-check passes

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $0.91

When a tool hook runs and produces output, the response now includes
the path to the hook file that generated the output. This helps models
investigate or modify the hook behavior.

- Added hook_path field to WithHookOutput interface
- Updated appendHookOutput to accept and propagate hook paths
- Extended test to verify hook_path is included in results
@github-actions github-actions bot added the enhancement New feature or functionality label Jan 24, 2026
@ammario ammario merged commit 3cfab56 into main Jan 24, 2026
24 checks passed
@ammario ammario deleted the tool-hooks-eyqd branch January 24, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants