Hooks
know-code gates shipping at two layers: git hooks and agent shell hooks.
Git hooks
Installed by know-code init (or refresh with know-code hooks install):
- pre-commit — runs
know-code check - pre-push — runs
know-code check
Refresh after upgrading the CLI:
know-code hooks install
Uninstall (restores backup if present):
know-code hooks uninstall
Agent hooks
Optional via know-code init --agents claude,cursor,codex:
| Agent | Config file |
|---|---|
| Cursor | .cursor/hooks.json |
| Claude | .claude/settings.json |
| Codex | .codex/hooks.json |
Gated commands (parsed command field only):
git commitgit pushgh pr createglab mr create
KNOW_CODE_OVERRIDE is never honored in agent hooks.
Uninstall agent entries:
know-code hooks uninstall --agents claude,cursor,codex
Opting out
know-code hooks uninstall- Remove agent hook entries manually
- Human emergency:
know-code overridethenKNOW_CODE_OVERRIDE=1in your terminal (not agent)
See troubleshooting.