Related ToolsClaude CodeClaudeAiderCursorCody

SpecLock Enforces Your Claude.md Rules Instead of Letting Claude Ignore Them

Claude by Anthropic
Image: Anthropic

If you use Claude for coding, you've probably set up a Claude.md file - the instruction document that tells the AI how to behave in your project. Things like "always write tests", "use camelCase", or "never touch the payment module". The problem: Claude treats these as strong hints, not rules. It follows them most of the time, then quietly ignores them when generating code that technically works but violates your standards.

SpecLock is a new open-source project from developer sgroy10 that tries to close this gap. The concept is simple: hook into your Claude workflow and validate that Claude's output actually conforms to your spec before it lands in your codebase. The project's own description puts it plainly - "Your Claude.md is a suggestion. This makes it a law."

This is a genuine pain point for anyone running Claude Code on a real project with actual conventions. Spec drift - where the AI gradually deviates from your stated rules - wastes time on review and erodes trust in AI-generated code. A lightweight enforcement layer addresses that without requiring you to restructure how you work.

The project is early. It has minimal community traction so far and the implementation details are still thin. But the underlying problem it's solving is real, and developer teams using Claude Code at any serious scale will recognize it immediately. If the spec enforcement proves reliable in practice, this kind of tooling could become a standard part of the Claude Code setup rather than a niche add-on.