Documentation
¶
Overview ¶
Package hooks provides Claude Code hook management functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasSessionCaptureHook ¶
func HasSessionCaptureHook(settings *ClaudeSettings) bool
HasSessionCaptureHook checks if the session capture hook is already installed
func InstallSessionCaptureHook ¶
InstallSessionCaptureHook installs the PostToolUse hook for sl session capture. Returns (installed bool, err error) where installed is true if a new hook was added.
func SaveClaudeSettings ¶
func SaveClaudeSettings(settings *ClaudeSettings) error
SaveClaudeSettings saves settings to ~/.claude/settings.json
func UninstallSessionCaptureHook ¶
UninstallSessionCaptureHook removes the session capture hook. Returns (removed bool, err error) where removed is true if the hook was found and removed.
Types ¶
type ClaudeSettings ¶
type ClaudeSettings struct {
Hooks map[string][]HookMatcher `json:"hooks,omitempty"`
// Preserve other fields
Other map[string]json.RawMessage `json:"-"`
}
ClaudeSettings represents the structure of ~/.claude/settings.json
func LoadClaudeSettings ¶
func LoadClaudeSettings() (*ClaudeSettings, error)
LoadClaudeSettings loads settings from ~/.claude/settings.json
func (ClaudeSettings) MarshalJSON ¶
func (s ClaudeSettings) MarshalJSON() ([]byte, error)
func (*ClaudeSettings) UnmarshalJSON ¶
func (s *ClaudeSettings) UnmarshalJSON(data []byte) error
Custom JSON marshaling to preserve unknown fields
type HookMatcher ¶
HookMatcher represents a hook matcher in Claude settings