1
We watch.
We check which files your AI says it opened.
Your AI is helping you with your project…
For people who build with an AI agent
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'll tell you whenever your AI opens something private.
Works with Claude Code and Codex, on a Mac or on Windows.
What you never see
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…
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
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
agentwhy
It watches your agent's work and explains it in plain words.
How it works
1
We check which files your AI says it opened.
2
We warn you when we find a private file.
3 If you want
We can stop your AI from opening private files.
A pasted key gets stopped too. Paste an API key into a message in Claude Code or Codex, and we stop the message before your AI gets it. Then we tell you what to do instead.
All on your own computer. Nothing is uploaded.
Your week
Each conversation with your AI, in one table: when it was, what you asked, and whether your AI opened something private.
Your weekThis week, Sep 28 – Oct 4
Pick a day to see only that day
All 7 conversations this week.
An example project.
Look back
Your AI's work in your project, day by day. Pick a conversation and follow it step by step, even the part a helper did out of your sight.
Your conversations
You askedFind out why the AI chat stopped answering
You askedSummarise the contract with the plant supplier
You askedCheck the key file is kept away from the AI
An example project. Click a conversation to see its story.
All files
Files we found in this chat: what your AI did with each one, which of them were private, and what to do about it.
All files ofFind out why the AI chat stopped answering
6 of 6 files shown. Every file of this conversation is listed, private or not. A file your AI only came across by name isn’t counted as opened.
An example project.
Diagram
The same steps as one picture: who handed the work to whom, what was opened, and where it ended up.
The conversationFind out why the AI chat stopped answering
An example project.
Step by step
The same conversation as a list, first to last. What a helper did sits inside the step that gave it the work, and the one step that opened a private file stands out.
The conversationFind out why the AI chat stopped answering
6 steps that touched nothing private are hidden.
On it.
assistant.ts.widget.tsx.package.json.search_issues from the MCP server sentry. Its server works outside the record, so we can’t see which files it opened.Search the error reports your app sent to Sentry, by text, project and time.
business-plan.md.customers.csv. A rule in your settings stopped it.assistant.ts..env. A rule in your settings stopped it.assistant.ts.We only see what each AI wrote down and did, not what it was thinking. Helpers that worked at the same time aren’t in order with each other.
An example project.
By folder
The same files, laid out as they sit in your project, with who opened each one: your AI, or a helper. The colour of a name says what happened to it.
The conversationFind out why the AI chat stopped answering
On it.Before the next 8 steps.
customers.csv. A rule in your settings stopped it.On it.Before the next 8 steps.
business-plan.md.On it.Before the next 8 steps.
assistant.ts.On it.Before the next 8 steps.
assistant.ts.assistant.ts.On it.Before the next 8 steps.
widget.tsx..env. A rule in your settings stopped it.On it.Before the next 8 steps.
package.json.On it.Before the next 8 steps.
business-plan.md.Folders no AI went into aren’t drawn. A dot on a folder means something inside it needs a look. The icons say what kind of file it is; the colour of a name says what happened to it.
An example project.
See it in action
Your AI starts a helper: a second AI you don't see
You don't see this part
example-9f2a…c41
Your AI opened a private file. Let's make it safe.
✓ You're done. Nice work. The key your AI saw doesn't work anymore.
.env
What happened
Fix it
Done
You choose
Stop your AI, or let it open the file and tell you. One click per file.
Try it: click Stop or Tell me.
We stop your AI when it tries to open it.
Best for API keys and bank details.
Your AI can open it. You'll know when it does.
Best for files your AI needs for its work.
What you get
Besides the warnings, here's what else you get.
Your AI has to ask you first. You say yes or no.
What you asked, and what your AI opened.
And which of them are locked.
It shows which file was opened, never what's inside.
Your files stay yours
Nothing is uploaded. No account.
Only which file was opened, and what to change.
Change a setting or turn it off anytime.
Where it works
On a Mac and on Windows.
Not from an AI chat in your browser: a chat can't run anything on your computer.
Get started
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/cli
You 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:reportOpen 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
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.
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.
Change the keys in the file it names, and nothing else. For each key, sign in to the service it belongs to, like your payments or AI account, open the page with your API keys and create a new one. Put the new key where the old one was, then delete the old key. Once it is deleted, whoever saw it can do nothing with it.
Each key takes a couple of minutes. Then tick the file off your list.
agentwhy stops the message before your AI gets it. It tells you which key it found and on which line, and what to do instead: put the key in the file with your API keys, and write its name in your message.
This works in Claude Code and Codex, when agentwhy's warnings in your chat are on. It recognises the keys of common services by their shape. A key it doesn't recognise still goes through.
Some apps name a new chat from your first message, so that message may already have been sent. When that can happen, agentwhy says so, and you change the key.
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 is a record of what actually happened.
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.
agentwhy reads the saved records your agent keeps as it works. If your agent opens a file in a way those records don't spell out, agentwhy can miss it. For example, from inside a small program your agent writes and runs, through a file name it puts together while working, or through another tool connected to your agent.
Stopping covers the usual ways of opening a file, not every way. When a saved record is incomplete, agentwhy says so.
By default, no. It only reads the saved records your agent already keeps on your computer while it works.
The warnings in your chat and stopping are the optional parts that add anything: a couple of lines in your project. It shows you those exact lines and asks first, and they can be taken out again at any time.
You can. But one afternoon of work can run to thousands of lines, written for machines rather than people, and every helper your agent started on its own keeps a separate file. agentwhy reads all of them and gives you one page.
npx agentwhylocalhost. Needs Node 22 or newer. Works on
macOS and Windows.
agentwhy initagentwhy init --remove undoes it.
UserPromptSubmit hook in Claude Code and Codex,
set up with the warnings, refuses a message holding one of 77
known key formats or a URL with a password. Sample values pass,
and a value beside a sensitive name does not refuse. It fails
open: if the hook can't run, the message goes. A refused message
stays in Claude Code's record and Codex's prompt history on your
disk, key included.
agentwhy check --mark rotated <path>Most days the answer is no. 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.
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.