[BUG] tool.execute.after hook receives undefined output for /review command

Resolved 💬 2 comments Opened Jan 24, 2026 by sano-suguru Closed Feb 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using the /review command, the tool.execute.after hook is triggered but the output parameter is undefined instead of the expected object with output and metadata properties.

This causes plugins/hooks that access output.metadata or output.output to crash with:

TypeError: undefined is not an object (evaluating 'output.metadata')

What Should Happen?

The tool.execute.after hook should receive a valid output object with at least:

{
  output: string,
  metadata: object
}

Even if the tool returns no data, the object should exist (possibly with empty values).

Error Messages/Logs

TypeError: undefined is not an object (evaluating 'output.metadata')
    at <anonymous> (/Users/.../.cache/opencode/node_modules/oh-my-opencode/dist/index.js:17978:30)

Steps to Reproduce

  1. Install a plugin that uses tool.execute.after hook
  2. Run /review command
  3. Hook crashes because output is undefined

Claude Code Version

2.0.76

Platform

macOS (Darwin 24.4.0, ARM64)

Additional Information

Workaround: Add if (!output) return; at the start of tool.execute.after handlers.

Related: This may also affect other built-in slash commands that don't properly pass output to hooks.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗