Your AI is helping you with your project…
For people who build with an AI agent
Your AI opens your files.Now you can stop it.
agentwhy is a free tool that shows every file your AI agent opened, and warns you if something looks wrong.
Set it up once. We stop the obvious tries, and tell you if one gets past.
Works with Claude Code, Codex and GitHub Copilot, on a Mac or on Windows.
What you never see
It asks before it installs something new.
It never asks before it opens a file.
On your screen
You clicked Yes or No. You knew what was about to happen.
So what about opening your files?
It never asks about that.
It just goes ahead.
You never find out which files.
For example, a file with…
- API keys for your database and payments .env.local You can change them
- A list of 1,900 customers customers.csv Can't be undone
- A contract you promised to keep private contract.pdf Can't be undone
Whatever your agent opens is sent to the AI company.
A key you can change.
A customer list you can't take back.
An example
Here's how a key gets out.
The AI chat in my app stopped answering. Find out why.
On it. Let me find out what's going wrong.
Your agent starts a helper — a second AI that works on one task, out of your sight
You don't see this part the helper works in a window of its own
Found the AI key in the file with your API keys:
example-9f2a…c41. Sending it
back.
That key doesn't match the one in your AI account. That's why the chat stopped.
Nobody asked you. Nothing was blocked.
Your key is now in two places
Anyone who gets this key can use your AI account. You pay.
You can only change a key you know about. That's why agentwhy exists.
What it does
So agentwhy
stops it.
agentwhy
It refuses the obvious tries and explains the rest plainly.
How it works
A lock and an alarm
for your AI.
Your API keys get extra care. We stop a message with a key in it, and hide a key inside a file, before your AI sees it. See how
All on your own computer. Nothing is uploaded.
Learn more
Pick what you want to know.
-
Can I stop my AI from opening a file?
How the rules work, which files they cover, and what they can't stop.
Learn more about stopping files -
What about my API keys?
What happens when you paste a key into a message, and how a key inside a file gets hidden.
Learn more about API keys -
What did my AI do this week?
Every conversation, every file each one opened, and which keys to change.
Learn more about the report -
What did the subagents do?
The work your chat doesn't show: each subagent's task, the files it opened, and the tries a rule stopped.
Learn more about subagents -
Is it safe to run?
What agentwhy reads, what it changes in your project, and what stays on your computer.
Learn more about how agentwhy works -
Something else?
Short answers to what people ask first, including what agentwhy can't do.
Learn more in the FAQ
Get started
Start agentwhy
Pick the app you already use. One line, and you're done.
-
Open your own project in Claude Code or Codex — in the Claude desktop app, use its Code tab, not Chat.
Your project is the folder you build in. agentwhy only ever looks at the one you open it in.
-
Paste this line in:
Open Terminal, run npx @agentwhy/cli, keep the local server running, and open its page in browser
-
A page opens on your computer. That's where you set everything up.
-
Open your own project in Claude — the desktop app (its Code tab, not Chat), VS Code, wherever you have it.
Your project is the folder you build in. agentwhy only ever looks at the one you open it in.
-
Paste this line in:
please run/install this npm package npx @agentwhy/cli and run agentwhy
-
A page opens on your computer. That's where you set everything up.
-
Open your own project in ChatGPT or Codex.
Your project is the folder you build in. agentwhy only ever looks at the one you open it in.
-
Paste this line in:
please run/install this npm package npx --yes @agentwhy/cli start --detach
-
It takes a few minutes, then it sends you a link. Open it — that's where you set everything up.
Using Codex in a terminal? It will ask permission to reach the network. Say yes — or just type the command yourself ().
-
Open a terminal in your own project. That's Terminal on a Mac and PowerShell on Windows.
Your project is the folder you build in. agentwhy only ever looks at the one you start it in.
-
Type this:
npx @agentwhy/cliYou type this, not your AI — which is why it always works, with nothing to approve. Needs Node 22 or later.
-
A page opens on your computer. That's where you set everything up.
Add agentwhy to Claude Code once
-
karolkozer/agentwhy -
/agentwhy:report
Customize › Plugins › Add › Add marketplace
URL
URL
/agentwhy:report-
Open Claude Code in a terminal, in your own project. It needs version 2.1.275 or later.
-
Type this, then choose Install for you:
/plugin install agentwhy --marketplace karolkozer/agentwhy -
Then type this in a conversation:
/agentwhy:report
Straight answers
The questions people ask first.
Will it work for me?
Yes, if you build with an AI agent like Claude Code or Codex, on a Mac or on Windows. You don't need to know how to code. You paste one message into your agent, it runs agentwhy for you, and the answer opens as a page on your own computer, in plain words.
It does not work from an AI chat in your browser: a chat can't run anything on your computer.
Is it safe to run?
Yes. It runs only on your computer. There is no account and no sign-up, and nothing is sent anywhere. It shows which file was opened, never what is inside it. If a file holds API keys, the keys are left out before anything is saved, so they never appear in your report.
Can't I just tell my agent not to open those files?
You can, and it is worth doing. But people keep reporting the same thing in public: they wrote a rule in their agent's instructions to stay away from the file with their keys, and it opened it anyway.
Telling your agent is a rule. agentwhy stops what it can, and shows you the rest.
What can't it do?
It tells you the same day, not months later when someone else is already using your key. But there are three things it can't do.
- It can't take a file back. Once your agent has opened a file, it is opened. agentwhy tells you which one, so you know what to change.
- Stopping is not a lock. Switched on, it stops the obvious attempts, like a direct request for the file with your API keys. Anything that slips past still shows up in your report, because the report reads what already happened.
- It only sees the agents it works with. Today that is Claude Code, Codex and GitHub Copilot. Work done in any other tool does not show up.
Keep your agent out of private files.
Most days nothing needs fixing. Now you'll know.
Free, no account Runs only on your computer
Does your company work with AI agents? Work with the person who makes agentwhy.
agentwhy is free.
Sponsors keep it going.
agentwhy is free.
A star helps people find it.
Hi, I'm Karol, and I make agentwhy. If it helped you, give it a star on GitHub. It takes one click, and it is how other people who build with an AI agent find it.
A star is a public thumbs-up on GitHub, the site where agentwhy's code lives. You need a free GitHub account to give one.
Hi, I'm Karol, and I make agentwhy. Sponsoring it gives me time to fix what people report and to keep it working as Claude Code and Codex change.
Sponsors get their logo in “Supported by” at the top of this page, and they hear about new features first.
Something not working? Tell me on GitHub.
No money to spare? A star on GitHub helps other people find agentwhy. Using it stays free either way.