Before you start
How to run checks automatically with cckit hooks
This tutorial
What you’ll set up: 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 at init so the
right check fires at the right moment without you remembering to run it. You never call a hook; Claude
Code fires it on an event.
-
Scaffold the hooks.
cckit initinstalls the always-on set into.claude/hooks/.Terminal window cckit initYou get three by default: a session-start repo-hygiene report (stale branches, worktrees, stashes), a quiet version check, and a base-branch commit guard that blocks a commit made straight to the base branch — so work always goes through a branch and a PR.
-
Confirm they’re healthy.
cckit doctorchecks the hooks are wired and refreshes any stale ones.Terminal window cckit doctor -
Turn on feature hooks as you need them. Enabling the pre-push gate at
initadds a hook that runs your project’s tests/lint before agit push, so a red branch never reaches the remote. Memory adds four more (see persistent memory).
How it works
Section titled “How it works”Hooks are plain scripts under .claude/hooks/, registered in .claude/settings.local.json — 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 (which is what makes unattended runs safe). Events map to moments:
SessionStart for reports, PreToolUse (Bash) for guards before a command runs, Stop/SessionEnd
for wrap-up.
Troubleshooting
Section titled “Troubleshooting”A hook didn’t fire. Run cckit doctor — it re-registers stale hooks. Confirm the entry exists in
.claude/settings.local.json.
A hook I don’t need is running. They’re plain scripts you own — edit or remove it from
.claude/hooks/ and its registration. Each is a safe no-op if you’d rather neutralize than delete.
The pre-push gate blocks a valid push. It runs your project’s check; a failing test or lint is the gate doing its job. Fix the finding, or adjust the check the gate runs.
Related tutorials
Section titled “Related tutorials”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