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 ¶
Report forwards only whitelisted hook metadata to the local session observer. It never returns a Claude permission decision or writes anything to stdout.
func ReportTo ¶ added in v1.4.11
ReportTo is Report with a destination for the hook's stdout. Only in remote-approval mode, and only for an eligible Bash permission request, does it wait for a remote decision and write Claude's PermissionRequest decision JSON to out. Otherwise it writes nothing, so Claude's own dialog decides.
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{}
// contains filtered or unexported fields
}
func New ¶
New creates an authenticated loopback receiver and private, session-local settings. Cancellation closes the receiver and removes both temporary files.
func NewWithOptions ¶ added in v1.4.11
NewWithOptions is New with optional behaviour such as remote approval.
func (*Observer) Decide ¶ added in v1.4.11
Decide delivers a remote approval decision ("accept" or "cancel") to the hook helper waiting on pendingID. It fails with ErrPendingRequestMismatch when nothing is waiting: remote approval is off, the request was already answered (locally or remotely), or it timed out.
type Options ¶ added in v1.4.11
type Options struct {
// RemoteApproval lets Bridge answer Bash permission requests. The hook
// helper waits for a remote decision while Claude Code shows its own
// dialog; whichever answers first wins (Claude kills the hook when the
// person answers locally). Off by default.
RemoteApproval bool
}
Options configures optional observer behaviour.