Clawback turns leaked Claude Code verification patterns into stop, pre-tool, post-tool, and post-compaction hooks. It replaces prompt-only guardrails with deterministic checks and shows how fast the source-map leak is becoming third-party control layers.

USER_TYPE === 'ant' verification pattern into a public hook kit, and the Clawback repo says its stop hook blocks Claude Code from finishing until typecheck and lint pass.CLAUDE.md, while the official hooks guide describes hooks as a way to get deterministic control instead of hoping the model chooses to run checks.You can read the Clawback repo, compare it with iamfakeguru's claude-md, and cross-check the public extension points in Anthropic's hooks reference. Claude Code Unpacked also gives a quick visual map of the agent loop, tool system, and the unreleased features people kept pulling out of the leak.
Clawback is a small but telling follow-up to the Claude Code source-map leak. Instead of copying internal flags, the repo uses Claude Code's public hooks API to recreate the part people actually wanted: hard stop-checks.
Its five-hook layout is very literal:
protect-files on PreToolUse blocks edits to .env, lockfiles, and .git/post-edit on PostToolUse runs formatting and report-only lint after editsstop-verify on Stop runs full typecheck plus lint, with a three-strike circuit breakerpost-compact on PostCompact re-injects git state and gotchas.mdnotification on Notification surfaces desktop alertsThe Claude Code Source Leak: fake tools, frustration regexes, undercover mode, and more
1.4k upvotes · 571 comments
The interesting design choice is the split between prompt guidance and enforced checks. The Reddit write-up explicitly calls prompts requests and hooks guarantees, which is almost a direct answer to iamfakeguru's claude-md: prompt engineering can reconstruct behavior, but it can still be skipped under context pressure.
That framing matches Anthropic's own wording. In the official hooks guide, hooks are described as deterministic controls that ensure actions happen at specific lifecycle points, including validation, formatting, and project rule enforcement.
Claude Code Unpacked
1.1k upvotes · 403 comments
The broader story is how fast the leak turned into reference material and third-party tooling. Claude Code Unpacked turned the codebase into an explorable map of the agent loop, source tree, tool system, and hidden features, while its HN thread treated the 500K line size as evidence of how much defensive machinery sits behind a coding agent CLI.
Clawback takes a narrower path than the leak tourism. It picks one concrete internal pattern, verification before completion, and ships it back as an installable layer on top of documented hook events such as PreToolUse, PostToolUse, Stop, and PostCompact in Anthropic's hooks reference.
Claude Code's source code has been leaked via a map file in their NPM registry
2.1k upvotes · 1k comments
Claude Code Unpacked : A visual guide
1.1k upvotes · 403 comments