cchook

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(input *Input, cfg RunConfig) (int, error)

Run executes the hook orchestration flow. Returns exitCode: 0 = continue normally, 2 = feedback to Claude.

Types

type Input

type Input struct {
	cclocate.HookInput
	HookEventName  string     `json:"hook_event_name"`
	PermissionMode string     `json:"permission_mode"`
	ToolName       string     `json:"tool_name"`
	ToolInput      *ToolInput `json:"tool_input"`
}

Input represents the JSON input from a Claude Code PostToolUse hook. It embeds cclocate.HookInput for the common fields (session_id, transcript_path, cwd).

func ParseInput

func ParseInput(r io.Reader) (*Input, error)

ParseInput reads and parses hook JSON input from a reader.

type RunConfig

type RunConfig struct {
	Spawner pane.PaneSpawner
	Theme   string
}

RunConfig holds configuration for the hook runner.

type ToolInput

type ToolInput struct {
	FilePath string `json:"file_path"`
}

ToolInput represents the input parameters of a Write tool call.

Jump to

Keyboard shortcuts

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