claudehooks

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package claudehooks observes Claude Code's structured lifecycle hooks. It has no telemetry, enrollment, or remote control-plane dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capabilities

func Capabilities() bridge.InteractionCapabilities

func Report

func Report(ctx context.Context, configPath string, input io.Reader) error

Report forwards only whitelisted hook metadata to the local session observer. It never returns a Claude permission decision or writes anything to stdout.

Types

type Event

type Event struct {
	SessionID     string `json:"session_id"`
	Name          string `json:"hook_event_name"`
	Tool          string `json:"tool_name,omitempty"`
	ToolID        string `json:"tool_use_id,omitempty"`
	ToolKey       string `json:"tool_key,omitempty"`
	AgentID       string `json:"agent_id,omitempty"`
	PromptID      string `json:"prompt_id,omitempty"`
	Source        string `json:"source,omitempty"`
	Notification  string `json:"notification_type,omitempty"`
	ElicitationID string `json:"elicitation_id,omitempty"`
	Server        string `json:"mcp_server_name,omitempty"`
}

Event deliberately excludes prompts, tool arguments/results, paths, and text. The short-lived helper removes those fields before contacting the observer.

type Observer

type Observer struct {
	SettingsPath string
	ConfigPath   string
	Updates      <-chan bridge.Interaction
	Done         <-chan struct{}
}

func New

func New(ctx context.Context, executable string) (*Observer, error)

New creates an authenticated loopback receiver and private, session-local settings. Cancellation closes the receiver and removes both temporary files.

Jump to

Keyboard shortcuts

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