Make Claude Code pass your checks before it pushes to main.
Rules and Locks adds Claude Code hooks and a pre-push runner to your repo. On branches you protect, the Bash guard looks for a passing record for the exact commit the agent is pushing.
Ten questions. Results on screen. No email required.
Your agent knows the rule. What happens when it skips it?
You tell it to run the build before pushing. It runs the tests, sees green and moves on. If the build was the check that would have caught the problem, the mistake is already on its way to main.
Give the agent an exact push command and make it show a passing record for that commit. If the record is missing, the guard tells it what to do next.
Four things you add to your repo
- Bash guardA Bash guard for Claude Code. It blocks common mistakes including rm, amending and force-pushing. It refuses Git aliases it sees in Bash. Recognised pushes must use the supported form. Branches you protect also need a passing record for that commit.
- Pre-push checkA runner for the checks you approve, such as lint, tests and your production build. It reports each result and can run in check-only mode in CI.
- Scoped lessonsA CLAUDE.md with a kit section, plus a workflow for moving lessons into files that load when Claude works on matching paths. You approve each move and each starter lesson.
- Optional Codex reviewAn optional Codex review on your account. Prepare a checkout at the commit you want reviewed. The pack flags findings without a code-like excerpt, and you check each finding against the source.
The kit’s own runtime uses built-in Node modules. The installed files travel with the repo when you commit them.
The guard handles common mistakes in Claude Code’s Bash tool. It has limited visibility into what scripts and other tools do. Use it as a local guard, alongside any controls you use on your Git host.
Rules and Locks setup pack
Install the Bash guard, your pre-push checks and the review workflow on a branch you can inspect before merging.
- Introductory price for the first 30 days
- £49.99 / US$59
- Standard price after 30 days
- £79 / US$99
Tested on macOS and Windows x64 with the required tools already installed. Check the requirements.
Checkout is opening shortly.
- The setup pack as a ZIP download
- The installer skill your own Claude Code runs in your repo
- Guard hooks, pre-push check, scoped lessons and optional Codex review
- Starter lessons on common agent mistakes, offered for your stack
- A short guide to your first two weeks
- Email support from me, with a reply within 2 working days
- 12 months of updates, emailed to you as a new download
Email support@rulesandlocks.com within 30 days of purchase for a full refund. No reason required.
Watch the guard refuse a force push
A recorded Claude Code session in a sample repo. The checks and the push are real.
- The Bash guard refuses the agent’s force push to main.
- The agent runs the configured checks, then pushes the exact checked commit in the supported form.
See what changes in a sample repo
These are selected changes from an install of the current pack. The sample accepted a starter lesson and skipped Codex review.
M CLAUDE.md
M .claude/settings.json
A .claude/kit.config.json
A .claude/rules/lessons/starter-general.md
A .claude/skills/rl-review/SKILL.md
A .kit/runtime/hooks/guard-bash.mjs
A .kit/manifest.json
This diff is on the rules-and-locks-setup branch. The sample’s main branch stayed at its original commit.
Install it on a branch you can review
Unzip the pack. Keep the files together. The included README has the commands.
Open the repo in Claude Code. Load the included plugin and start its install skill.
Read the plan. The installer checks your tools and shows the plan before it creates a branch or edits project files. You confirm the checks to run and the branches to protect.
Approve the changes. Claude Code asks before each step. It wires the hooks and, if you choose, moves scoped lessons and configures Codex. A local self-test checks the runtime. You can also opt into a live check in a fresh Claude Code session.
Review, merge and restart. The installer stops on its own branch. Review the diff, then merge while preserving the installer commits if you want scripted uninstall. Start a fresh Claude Code session to load the hooks and skills.
Who's behind it
I'm James Bell. I've spent 26 years in large, regulated global businesses, and a good part of that on how AI gets governed.
I'm a Fellow of the British Computer Society and a Chartered IT Professional.
So when my own coding agent kept breaking rules it had been given, I recognised the problem. I'd spent years on the same problem at a much larger scale: a policy only holds when something enforces it. Rules and Locks is the same controls thinking, cut down to one developer and one agent.
For developers who ship with Claude Code
If you already ship with Claude Code, put a check in front of the push before the next missed build. Start with the checks you already trust.
New to Claude Code? Start with the starter lessons you choose, the two-week guide and /rl-lesson for writing down the mistakes you see in your own code.
What you’ll need
- macOS or Windows x64.
- Git, with
user.nameanduser.emailset. On Windows, use Git for Windows with Git Bash. - A repo with at least one commit and a clean working tree. Commit or stash your changes and untracked files first. Open the main checkout.
- Node 20 or later.
- Claude Code 2.1.295 or later on macOS, or 2.1.310 or later on Windows. Sign in before installing.
- The Codex CLI, logged in to your own account, if you want the optional reviewer. On Windows it needs
codex.exeon PATH.
Questions
Will it get in the way of my own pushes?
The guard runs in Claude Code’s Bash tool. A push you type in your own terminal runs as usual. For the agent, a push the guard recognises must use the supported form, and a configured protected branch needs a passing record for the exact commit.
What if the installer gets stuck?
If a check fails, read the installer’s report before merging. The installer works on a separate branch and never pushes or merges it. Email support@rulesandlocks.com if you need help.
Which systems have you tested?
We tested install, uninstall and the guard in a live Claude Code session on macOS and Windows x64. The Windows run used build 26300, with Git for Windows, Node and Claude Code already installed. Install those tools before running the pack. Automatic installation of missing tools and Linux are untested.
What stacks does it work with?
The runner uses approved shell commands from your repo. Those can include lint, tests and a production build, depending on your stack and what you configure.
What does the second reviewer cost?
Whatever your own Codex account costs. You use your own account; I don't resell access. If you'd rather not pay for Codex, skip that step and install the rest.
Will you see my code?
The kit sends no code to me. Your own Claude Code may send repository context to its configured provider during installation and any live check you choose to run. If you enable Codex, it reviews on your account. The commands you approve can make their own network requests.
Can my team use it?
It's built for one repo and one developer at the wheel. For teams, join the team-edition waitlist below. No date yet.
Do I get updates?
Yes, for 12 months. When there's an update, I'll email you a new download. The runtime lives in your repo, so nothing in it changes unless you choose to take an update.
Can I take it out again?
Yes. Keep the installer commits in Git history so the uninstall command can work from them. It creates a removal branch, reverses unchanged installer changes and lists edited files for you to check. If your workflow squashes the install, use its manifest as a manual removal checklist.
What about refunds?
Email support@rulesandlocks.com within 30 days of purchase for a full refund. No reason required.
Rules or locks?
Ten yes-or-no questions about the checks and review habits you use today. Get your score and see what to change first. You can read the result here without giving an email address.
Start with the first three questions. You can set up Bash restrictions and a pre-push check before you’ve built a library of lessons.
What to change
Your result request was received.
Find the gaps before the next push.
Take the free self-check and leave with a list of changes you can make in your own repo.
Get five emails over two weeks on turning rules into locks. Unsubscribe from any email.
Leading a team?
On a team, the lock belongs on the server as well as on each laptop, and that's a different product. I'm working on a team edition. No date yet; join the list and I'll tell you when there's something to try.
Join the team-edition waitlist Privacy notice