Clawback: Hooks-based implementation of leaked Claude verification loops

Clawback is a GitHub project that implements the verification loops from the leaked Claude source map as mechanical hooks rather than prompts. The approach addresses the limitation where prompt-based verification (like iamfakeguru/claude-md's "you are FORBIDDEN from completing without running tsc") can be skipped by the model under context pressure.
Hook architecture
The system splits the problem into two layers:
- Hooks (mechanical, can't be skipped):
- Stop hook: Runs typecheck + lint when Claude tries to complete. If it fails, exits with code 2, forcing Claude to keep fixing. Three consecutive failed blocks trigger a circuit breaker.
- PostToolUse: Auto-formats and lints after every file edit.
- PreToolUse: Blocks edits to .env and lockfiles before Claude touches them.
- PostCompact: Re-injects git state and gotchas.md after context compaction.
- CLAUDE.md (behavioral): For what hooks can't enforce, including phased execution (≤5 files per phase), plan vs build separation, context decay awareness, and mistake logging.
Technical details
The tool auto-detects the stack by looking for configuration files: tsconfig.json, go.mod, Cargo.toml, pyproject.toml, and composer.json. It requires no configuration and has zero dependencies. Clawback works alongside iamfakeguru's CLAUDE.md project, not instead of it.
The implementation is based on the leaked verification loops that were gated behind USER_TYPE === 'ant' in the source map. The GitHub repository is available at https://github.com/LZong-tw/clawback.
📖 Read the full source: r/ClaudeAI
👀 See Also

Handoffs Pattern in Claude Workflows: Two-File Split vs One-Doc Summary
Long Claude sessions break on context decay. Handoffs compress what matters and start fresh. Two approaches: Matt Pocock's single-doc handoff skill vs a two-file split with persistent narrative and ephemeral prompt.

Applying Claude Code's Architecture to Local 9B Models: Key Findings and Optimizations
A developer extracted architectural patterns from Claude Code's leaked source code and applied 10 optimizations to qwen3.5:9b running locally on an RTX 5070 Ti. The key discovery was that qwen3.5:9b has native structured tool_calls, and the biggest limitation for 9B models is self-discipline in knowing when to stop exploring and start producing output.
Tendril: A self-extending agent that builds and registers tools on the fly
Tendril is an agentic sandbox that autonomously discovers, builds, and registers tools. It starts with just three bootstrap tools and dynamically grows its capability registry without asking the user.

AutoDream: 11-hook memory system for Claude Code with safety features
AutoDream is an open-source tool that adds project memory persistence and command safety to Claude Code. It uses 11 hooks across 6 events to inject context, block dangerous commands, and survive the /compact operation.