LeakStop
An open-source mod for Claude Code that watches what the agent is about to do and steps in before a key or token ends up where it shouldn't.
- Role
- Design and development
- Launched
- Stack
The challenge
A few weeks ago, an agent working in my terminal read my .env and wrote my API keys straight into the conversation. I had to rotate every one of them. Nobody did anything wrong: the agent was just doing its job. But the same thing can happen in other ways: a key copied into the code, a printenv that dumps the whole environment, or a git add . that takes a private key into the repository.
What I did
Claude Code recently added mods, plugins that can observe and intercept what the agent does. I spent a few evenings trying them out and the result is LeakStop, my first mod and the first one I actually use.
LeakStop looks at what the agent is about to do and acts before it happens:
- Lets through anything with no risk, such as writing to a
.envthat git ignores. - Warns on weak signals, such as a JWT or a
password = "…"that might be test data. - Asks when a real secret is about to end up in the code or when a sensitive file is about to be shown, and offers a better way out: reading the value from an environment variable.
- Blocks a
git commitor agit pushthat would publish a secret. - Masks a secret that appears in a tool’s output or in a message before the agent sees it.
It recognises private keys and tokens from AWS, GitHub, GitLab, Stripe, Slack, Google, npm and Hugging Face, among others, as well as passwords inside URLs and Authorization headers. It also tells example placeholders, commit hashes and UUIDs apart so that it doesn’t raise false alarms.
How it is built
It is written in TypeScript and everything runs on your machine: no network, no model and no accounts. It never reads your environment variables and never stores a full secret, only a short prefix and the last three characters. Every change is tested against the oldest and the newest version of Claude Code that it supports.
It is open source under the MIT licence. To try it, inside Claude Code:
/plugin marketplace add AlexandreMartinezOlmos/claude-code-leakstop
/plugin install leakstop@leakstop

