Rule-guided coding
When you type any prompt — for example, “add a login form” — thefetch-rules.sh hook fires automatically. It queries the Rippletide backend with your prompt text and injects the most relevant rules into Claude’s context.
Claude states which rules it’s applying before responding:
Violation detection
When Claude attempts to write or edit code (via the Edit, Write, or MultiEdit tools), thecheck-code.sh hook intercepts the tool call before it executes. It sends the proposed code to the Rippletide backend, which checks it against your active rules.
If no violations are found, the code is written normally.
If violations are found, the tool call is blocked and Claude is told what went wrong.
Auto-rewrite on violation
When a violation is detected, Claude automatically rewrites the code to fix it. This happens silently — you don’t need to intervene. The auto-fix loop works like this:1
First attempt
Claude rewrites the code to address the violations and retries the tool call.
2
Second and third attempts
If the rewrite still violates rules, Claude tries again — up to 3 automatic attempts total. Each attempt shows a diff of the changes.
3
User decision (after 3 failures)
If all 3 automatic attempts fail, Claude asks you to choose:
- (A) Try one more rewrite — Claude makes a 4th attempt
- (B) Override and keep original code — Claude uses the original code as-is
Override
If you choose to override (option B), Claude adds an override comment to the code:check-code.sh hook to skip violation checking for that block on future edits.
What gets checked
The hook checks code in source files only. These file types are skipped:.md,.json,.yaml,.yml,.txt.toml,.cfg,.ini,.csv