Skip to content

Hooks

The hooks cckit installs, what fires each one, and what it does.

A hook is a script Claude Code runs automatically when something happens — a session starts, a command is about to run, a session ends. cckit scaffolds a few during cckit init, so the right check runs at the right moment without you remembering to run it.

These three are scaffolded for every project.

EventHookWhat it does
SessionStartrepo-hygiene.shA read-only report at the start of each session: stale branches, leftover worktrees, and stashes — the same things cckit gc cleans up.
SessionStartkit_version_check.shA quiet notice if this project is behind the installed cckit — the prompt to run cckit update.
PreToolUse (Bash)guard-base-branch-commit.shBlocks a commit made straight to the base branch, so work always goes through a branch and a PR.

cckit init adds these when you turn the matching option on.

EventHookEnabled byWhat it does
PreToolUse (Bash)prepush_gate.shpre-push gateRuns your project’s check (tests, lint) before a git push, so a red branch never reaches the remote.
SessionStartkit-local-status.shlocal model layerAnnounces the local model (mlx_lm.server) when it’s enabled and alive.
SessionStartmempal_session_start.shmemory (MemPalace)Loads this project’s saved context (wake-up --wing) at the start of a session. The body is wing-scoped; for a wing-scoped identity header, drop in .claude/mempal-identity.<wing>.txt.
Stopmempal_save.shmemory (MemPalace)Files the finished session into MemPalace.
PreCompactmempal_precompact.shmemory (MemPalace)A safety-net sweep to memory before the conversation is compressed.
SessionEndmempal_followup.shmemory (MemPalace)Captures any unsynced work if a session closes abruptly.

Hooks are plain scripts under .claude/hooks/ in your project, registered in .claude/settings.local.json. They are yours to read and edit — every one is a safe no-op when its tool isn’t installed, so nothing breaks if a dependency is missing.

Do thisCommand
Scaffold the hookscckit init
Check setup is healthycckit doctor
Check the repo health a hook reportscckit gc
Act on the update noticecckit update

Independent, educational project — not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic PBC. Disclaimer & trademarks ·

From Mexico with love by josegtz