claude-dont
v1.0.6
Published
Persistent negative memory for Claude — teach it once, it remembers forever
Downloads
845
Maintainers
Readme
claude-dont
Stop paying for Claude's repeated mistakes.
Every time Claude ignores your preferences, you correct it. Next session — same mistake, same correction, same wasted tokens. claude-dont ends that loop.
One command. Remembered forever.
/dont use field injectionClaude never uses field injection again. In any project. In any future session.
The token problem
Every correction you type costs tokens. Every repeated mistake costs tokens. Every rule you re-explain costs tokens.
Without claude-dont:
You: implement the auth service
Claude: [writes code with field injection]
You: I told you — use constructor injection, not field injection
Claude: sorry, here's the fix...
[next session]
You: implement the user service
Claude: [writes code with field injection again]
You: HOW MANY TIMES...Each "I told you" costs ~100–300 tokens. Multiply by sessions, by teammates, by months.
With claude-dont:
You: /dont use field injection
→ Saved. Never again.
[next session, new project, different machine]
Claude: [automatically reads your constraints]
Claude: [writes constructor injection correctly, first try]Savings breakdown
| What you stop paying for | Tokens saved | |---|---| | Re-explaining the same rule each session | 100–300 per session | | Corrections after Claude ignores preferences | 150–400 per incident | | Re-injecting rules that already fired this session | 50–200 per repeat | | Injecting irrelevant rules (wrong project/context) | 100–500 per session | | Total per active project / month | 2,000–15,000 tokens |
Rules are automatically synced to your CLAUDE.md system prompt. Thanks to prompt caching in modern LLMs, reading your rules costs practically nothing after the first message, saving you thousands of output tokens in corrections.
Install
One command:
npx claude-dont initThen restart Claude Code.
Done. That's the entire installation.
init automatically:
- Registers the MCP server in
~/.claude/settings.json - Creates the
/dontslash command - Wires an error-detection hook that prompts rule capture on mistakes
- Injects auto-call instructions into
~/.claude/CLAUDE.mdso Claude calls the tools every session without you asking
Verify your setup:
npx claude-dont doctorHow to use
Add a rule
/dont use var declarations
/dont use default exports — named exports only
/dont call setState directly — use the store action
/dont use async/await in Vue computed properties
/dont hardcode environment variables — use .envIf your instruction is vague, Claude asks one clarifying question before saving.
View your rules
Just ask Claude in chat:
"show my rules"
"what constraints do I have for this project?"Or via CLI:
npx claude-dont list
npx claude-dont list /path/to/projectShows all rules with hit counts — so you know which rules fire most.
Remove a rule
Just ask Claude in chat:
"remove the rule about var declarations"
"forget the field injection rule"Uses fuzzy matching — you don't need the exact rule text.
That's it
Claude reads your rules automatically at the start of every session from CLAUDE.md. You never repeat yourself again.
Self-learning from mistakes
When Claude makes a mistake, it doesn't just fix it — it drafts a rule:
I made a mistake: used var instead of const.
Cause: default reflex — var is shorter.
Suggested rule: "Don't use var. Use const or let."
Keywords: [var, declaration, variable]
Add this to rules.md? [Y/n]One keypress. Mistake captured forever.
The error-detect hook fires automatically when you send a stack trace or say "that's wrong" — Claude knows to suggest a rule before responding.
Conflict detection
Try to add a contradictory rule and claude-dont blocks it:
⚠ Conflict detected
New: "Don't avoid async functions"
Existing: "Don't use async functions"
Reason: Opposite polarity — shared keywords: [async, functions]
To save anyway: /dont ... forceTeam rules
Commit a .claude-dont/rules.md to your repo. Everyone on the team gets the same constraints automatically on git pull. No setup required per developer.
my-project/
├── .claude-dont/
│ └── rules.md ← commit this
└── src/Bulk import
Already have a list of rules? Import them all at once by asking Claude:
"import rules from /path/to/my-rules.md"Each - line becomes a rule with auto-extracted keywords.
Diagnose
npx claude-dont doctor[MCP Server] ✓ Registered
[CLAUDE.md] ✓ Auto-injection active
[Hook] ✓ Error detection active
[Slash Commands] ✓ /dont
[Rules] ✓ 12 rules across 3 projects
[Conflicts] ✓ NoneHow rules are stored
Human-readable markdown at ~/.claude/dont/rules.md. Hand-editable.
## global
- keywords: [console.log, logging]
rule: Don't use console.log. Use structured logger.
why: Security leak risk in prod.
## project:/your/project
- keywords: [inject, @Autowired, field injection]
rule: Don't use field injection. Constructor injection only.
why: Hides dependencies, breaks unit tests.
tags: [.java, .ts]Requirements
- Node.js 18+
- Claude Code (CLI or desktop app)
Contributing
- Clone the repository
- Run
npm install - Run
npm run buildto compile - Run
npm testto run the test suite
License
MIT
