Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By studiogov0.4.0MITIn 1 marketplace
Keeps your AI agent on a leash - your own rules are re-injected as the context fills up, including for the subagents it spawns, plus a guard that stops the rules file from growing. Polish - "kaganiec", "moje zasady", "trzymaj agenta w ryzach".
You run one by typing its /name in Claude Code.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
claude-code, hooks, rules, constitution, guardrails, prompt-injection, i18n
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Your rules come back before the assistant forgets them.
("Kaganiec" is Polish for a muzzle - the thing that keeps a dog from biting, not from running.)
The longer you work with an AI assistant (Claude Code), the more it drifts from your rules. Early in a conversation it remembers to answer briefly, not to make things up and to ask before sending anything - after an hour it starts losing that. The longer the conversation, the worse it gets.
kaganiec fixes it simply: it re-injects your rules as the context fills up, and it does the same for the helpers the assistant spawns. The rules stay in front of the model, so it keeps to them.
The name is deliberate. A muzzle is not a straitjacket - it does not limit what the assistant can do. It only keeps it to the rules you set yourself.
kaganiec is a plugin for Claude Code. Once installed it attaches to three moments of the assistant's work and does one simple thing each time. Nothing runs in the background, nothing goes to the internet - it all happens on your machine, while the assistant is working anyway.
1. Every time you write a message -> kaganiec asks the rhythm engine whether a
context-fill threshold was crossed. If it was, it appends rules.md to your prompt before
it reaches the model. You see nothing and do nothing - the assistant simply has your rules
in front of it. That is the heart of the plugin.
2. When the assistant spawns a helper (a smaller agent for a separate task - "search these files") -> kaganiec prepends your rules to its prompt too. Without that the helper would work blind to your rules. Exception: forks, which inherit the full context anyway, are skipped so nothing is duplicated.
3. When somebody tries to save rules.md (you or the assistant) -> kaganiec checks the
length. If it grew too much (over ~1000 tokens) it blocks the write and shows the
standard for writing rules. Why guard the length? Because every reminder stays in the
context for good - the longer the file, the more it costs. Details: COST.md.
All three mechanisms are fail-open: if anything goes wrong, the plugin quietly steps aside and never blocks your work.
You need Claude Code and Python (usually already there on Windows and macOS; check
with python3 --version).
claude plugin marketplace add studiogo/kaganiec
claude plugin install kaganiec@kaganiec
Then open Claude Code and run the wizard:
/setup-kaganiec
/plugin marketplace add studiogo/kaganiec
/plugin install kaganiec@kaganiec
/setup-kaganiec
marketplace add studiogo/kaganiec - tells Claude Code where to get the plugin
(this repository). The command itself runs nothing - it only adds an address to the list
of sources.plugin install kaganiec@kaganiec - downloads the plugin and enables it. From then
on the three hooks (see "How it works") are active. Installation does not touch your
settings.json - the hooks register through the plugin's own file
(hooks/hooks.json), so nothing in your configuration is overwritten./setup-kaganiec - the wizard that creates your rules file. It does not
overwrite an existing one. If there is none, it asks how you want to start and saves
rules.md in ~/.claude/kaganiec/.What is not installed: no background services, no autostart, no network calls. Four Python scripts and one file with your rules - that is it.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub studiogo/kaganiec --plugin kaganiecPlugins from other owners that cover similar ground