"Good intentions don't work. Mechanisms do." -- Jeff Bezos
16 mechanisms codified from working with Claude Code every day. Distilled into the operating principles that actually stuck.
Not rules (rules get forgotten between sessions). Not principles (too abstract to enforce). Mechanisms -- with triggers, retry logic, and failure notifications that fire whether you remember them or not.
Early on, when something went wrong, I'd ask Claude to prevent it happening again. It would write a rule or save a note in memory. Next session? Gone. So I started thinking harder about what actually sticks.
A mechanism has:
- A clear trigger (not manual memory)
- Consistent execution when the trigger fires
- A defined expected outcome
- Retry logic (up to N attempts) when the outcome isn't met
- A failure notification if retries are exhausted -- never fail silently
| # | Mechanism | One-liner |
|---|---|---|
| 01 | Discover and derive, never assume or ask | Check before creating, derive before asking, discover before computing |
| 02 | git mv, not cp + rm | Preserve history when moving files |
| 03 | No orphaned files | If content migrates, delete the source |
| 04 | One focused thing per session | Resist scope creep |
| 05 | Deferred work needs persistent markers | Write flags, not verbal promises |
| 06 | Fix conflicts autonomously | Fix it directly, don't surface the problem |
| 07 | Build mechanisms, not habits | The meta-mechanism that defines all others |
| 08 | Incremental rollout, not big-bang swap | Add alongside, verify, then remove the old |
| 09 | Atomic credential persistence | Persist replacements before doing any other work |
| 10 | Parity over independence | Test that N things work the same, not just individually |
| 11 | One branch, one scope | Branch frozen once PR is ready; verify scope before committing |
| 12 | Consolidate review in the artifact | Put proposed changes inside the file, not in chat |
| 13 | Dry-run before data-patching | Test scripts against real data, not just synthetic tests |
| 14 | Trace the cascade | Walk every downstream consumer before finalizing a pipeline change |
| 15 | Build callables, not embedded logic | One script, multiple callers, same behaviour |
| 16 | Smallest shippable first | Ship the smallest slice that validates the hypothesis |
Option 1: Copy what you need
Browse the mechanisms/ directory. Each file is self-contained. Copy any mechanism into your own CLAUDE.md or project configuration.
Option 2: Install as a Claude Code plugin
git clone https://github.com/christophecapel/claude-mechanisms.git ~/.claude/plugins/claude-mechanismsBuilt by Christophe Capel -- a product leader building a personal operating system with Claude Code and codifying the discipline that makes it work.
These mechanisms emerged from real failures: wrong-branch commits, lost credentials, orphaned files, scope creep across parallel sessions, and rules that Claude forgot between conversations. Each one exists because something broke and I made sure it wouldn't break the same way twice.
If any of these save you time, I want to hear about it. If you have mechanisms of your own, open a PR or an issue.
MIT
