Documentation
¶
Overview ¶
Package hooks manages Claude Code hooks integration for cdev. It handles installing, uninstalling, and checking hook status to capture real-time events from Claude running in any terminal/IDE.
Index ¶
Constants ¶
const ( // CdevHooksDir is the directory for cdev hook scripts CdevHooksDir = ".cdev/hooks" // CdevMarker is used to identify cdev-managed hooks in settings.json CdevMarker = "_cdev_managed" // InstalledMarkerFile indicates hooks have been installed InstalledMarkerFile = ".cdev/hooks/.installed" // DefaultPermissionTimeout is how long to wait for mobile response (seconds) DefaultPermissionTimeout = 60 )
Variables ¶
This section is empty.
Functions ¶
func ForwardScriptName ¶
func ForwardScriptName() string
ForwardScriptName returns the platform-appropriate forward hook script name.
func PermissionScriptName ¶
func PermissionScriptName() string
PermissionScriptName returns the platform-appropriate permission hook script name.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles Claude Code hooks installation and management.
func (*Manager) Install ¶
Install installs cdev hooks for Claude Code. This creates the hook scripts and adds hooks to Claude's settings.json. - forward.sh: Fire-and-forget script for notifications (SessionStart, PostToolUse) - permission.sh: Blocking script for PreToolUse that enables mobile permission approval
func (*Manager) IsInstalled ¶
IsInstalled checks if cdev hooks are already installed.
func (*Manager) RestoreBackup ¶
RestoreBackup restores the backup settings file if it exists. Call this if something goes wrong after modification.