Skip to content

AI tools ​

Each developer can use a different AI assistant. fixlock writes the rules into each tool's own instructions file, so every assistant gets the same message: don't rewrite fixed or working code without telling the developer.

Check before editing, in any assistant

Besides the rules files below, fixlock includes an MCP server. Assistants can call fixlock_check_edit before changing a line and get a verdict with the owner and reason. Set it up with npx fixlock setup <assistant>; see AI assistants.

Which tools are used? ​

bash
npx fixlock tools

fixlock looks in three places:

  • the repo: e.g. .claude/, .cursor/, GEMINI.md
  • installed command-line tools: claude, codex, gemini, aider, cursor, windsurf
  • editor extensions in VS Code, VS Code Insiders, Cursor, Windsurf and VSCodium

● on tools get a rules file. ○ found tools are installed here but not enabled. Enable them:

bash
npx fixlock tools add cursor copilot
npx fixlock tools remove aider

Run npx fixlock tools on each developer's machine once. Teammates may use tools you don't.

What each tool gets ​

ToolidFile writtenStops edits before they happen?
Claude Code (CLI, VS Code, JetBrains)claude-codeCLAUDE.md + hook in .claude/settings.jsonYes
OpenAI Codex (CLI, IDE extension)codexAGENTS.mdNo: rules + commit/PR checks
Cursorcursor.cursor/rules/fixlock.mdcNo
GitHub Copilotcopilot.github/copilot-instructions.mdNo
Windsurfwindsurf.windsurf/rules/fixlock.mdNo
Gemini CLI / Code AssistgeminiGEMINI.mdNo
Clinecline.clinerules/fixlock.mdNo
Roo Coderoo.roo/rules/fixlock.mdNo
Continuecontinue.continue/rules/fixlock.mdNo
AideraiderCONVENTIONS.md (+ read: in .aider.conf.yml)No
Amazon Q Developeramazonq.amazonq/rules/fixlock.mdNo
JetBrains Juniejunie.junie/guidelines.mdNo

In shared files (CLAUDE.md, AGENTS.md, GEMINI.md, …) fixlock only edits the section between <!-- fixlock:start --> and <!-- fixlock:end -->. Your own instructions above and below it are kept. Files inside rules folders (like .cursor/rules/fixlock.mdc) belong to fixlock entirely, so don't edit them by hand.

The files are refreshed automatically on mark, remove, autolock and release. To refresh by hand: npx fixlock sync.

What the rules say ​

Every file contains:

  1. Never rewrite, delete or replace code that already works without telling the developer first.
  2. Run npx fixlock why <file>:<line> before changing an existing line.
  3. Don't change locked lines; build around them.
  4. If a locked line must change, stop and say which lock and who owns it.
  5. Keep diffs minimal.
  6. Write Conventional Commit messages.
  7. Run npx fixlock check --staged before finishing.

…followed by the list of current locks with owners and the lines to keep.

Claude Code in detail ​

init (or npx fixlock install-claude-hook) adds a PreToolUse hook for Edit, MultiEdit and Write. Before each edit it checks:

  • Locked lines: applies your policy (warn, ask, block).
  • Working code: asks if the edit deletes or rewrites committed lines by someone else (or your own older ones).
ResultWhat happens
warnA message is shown; the edit goes ahead
askClaude Code asks the developer to approve the edit, showing fixlock's explanation
blockThe edit is refused; Claude is told why and should work around the lines

The owner of a lock never gets prompted for their own lock. If the hook ever fails, it stays silent rather than stopping your work.

The settings also deny Claude permission to edit .fixlock/, .claude/settings.json and .git/hooks/, and to run fixlock remove or --no-verify. The AI can't switch the protection off.

Tools without a hook ​

For Codex, Cursor and the rest, protection is:

  1. the rules file (the assistant is instructed, though it can still make mistakes),
  2. the commit-time warning (install-hook),
  3. the PR check (enforced).

Tip for Codex/Cursor users: start tasks with "follow AGENTS.md" (or the tool's rules file) to make sure the rules are loaded.

MIT licensed · A product of Algotricz