hook

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(stdin io.Reader, stdout io.Writer) error

Run is the main hook entry point, invoked by Claude Code after each tool use. It reads a Payload from stdin, captures workspace state, and creates a step.

Types

type Payload

type Payload struct {
	SessionID      string          `json:"session_id"`
	ToolUseID      string          `json:"tool_use_id"`
	ToolName       string          `json:"tool_name"`
	ToolInput      json.RawMessage `json:"tool_input"`
	ToolResponse   json.RawMessage `json:"tool_response"`
	CWD            string          `json:"cwd"`
	TranscriptPath string          `json:"transcript_path"`
}

Payload is the JSON structure Claude Code sends to PostToolUse hooks via stdin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL