LabscoMCP early access ↗
sgroy10MCP SERVER

SpecLock

Turns the rules already in your CLAUDE.md into checks that run before an edit, a shell command or a commit — with semantic matching that catches the euphemisms.

by sgroy10 ↗Agent Guardrails, Content Safety & AuditCommunity

LABSCO SUMMARY

Enforcement level depends on the client, and the README says which is which.

Claude Code gets native pre-action checks on Write, Edit and Bash. Everywhere else — Cursor, Windsurf, Cline, Codex, Gemini CLI, Copilot CLI — the agent can call SpecLock before acting but nothing guarantees it will, which the project labels MCP-assisted rather than pretending otherwise. If a constraint genuinely must hold, the answer given is speclock protect --strict plus CI, where enforcement does not depend on the coding agent at all. Start advisory: it never blocks a change while you find out what it would have caught.

What it is

A constraint enforcement layer for coding agents. It reads the rule files you already keep — CLAUDE.md, AGENTS.md, .cursorrules — turns them into locks, and checks proposed actions against them, in advisory mode by default and blocking when you switch it on.

What you get

  • The README counts 51 MCP tools and lists 49 of them by name, spanning context, constraints, enforcement, sessions and audit
  • speclock_check_conflict runs a semantic conflict check against every active lock, and speclock_get_context returns the full context pack
  • speclock_add_lock adds a constraint and auto-guards the matching files; speclock_remove_lock soft-deletes one and speclock_suggest_locks proposes new ones
  • speclock_set_enforcement switches between advisory and hard mode; speclock_override_lock records an override with a reason and speclock_override_history reads that trail back
  • speclock_semantic_audit analyses a git diff against the locks, speclock_detect_drift scans for violations, and speclock_audit checks staged files before a commit
  • speclock_session_briefing and speclock_session_summary bracket a working session; speclock_log_change, speclock_get_changes and speclock_get_events track what happened inside it
  • speclock_verify_audit checks the integrity of the HMAC audit chain, and speclock_report gives violation statistics and the most-tested locks
  • Matching is semantic rather than keyword: "clean up old patient data" reads as deletion, "temporarily disable MFA" as disabling MFA, and "enable audit logging" does not trip a lock that forbids disabling it

Requirements

The npm package speclock, version 5.8.0, started as speclock serve --project . over stdio, or installed as a Claude Code plugin from the repository's marketplace. Run npx speclock@latest protect once in the project to extract constraints — that starts advisory. protect --strict turns on blocking, and speclock doctor verifies rules, hooks and integration. No account; it runs locally by default.

Setup effort

One command — npx speclock@latest protect