agentwhy
A local tool that reads saved Claude Code, Codex and Copilot conversations to show which private files an AI agent opened and which keys to change.
At a Glance
About agentwhy
agentwhy is made by Karol Kozer. It reads the conversation records that Claude Code, Codex and GitHub Copilot already save on your computer and reports which private files (such as .env files and keys) an AI agent or its helpers opened, the task that led to it, and which key to change. It runs locally via npx @agentwhy/cli, and the repository lists a v0.4.2 release and an Apache 2.0 license.
What It Is
agentwhy is a local security-visibility tool for people who build with AI coding agents. You run one command in your project folder, and a page opens on your computer listing conversations, the private files reached, who reached them, and what to fix. The project describes itself as pre-MVP. It processes records by fixed rules, with no AI model, account, or internet connection, and the README says secret values are replaced before a report is built.
How the report works
The dashboard shows a week of conversations, each marked by whether a private file was opened. Opening a conversation shows a to-do list, a step-by-step story of what happened, a diagram, a by-folder view, and a full event record. It also traces helper agents: which helper was given what task, which files it touched, and what it passed back to the main agent. For each private file you can choose to block it, so the agent is stopped, or track it, so the agent may read it and you are told.
Optional protection
init can add rules and hooks to Claude Code, Codex, and (when enabled) Copilot that refuse obvious reads of private files. It shows exactly what it will write and asks first, and init --remove undoes it. The documentation states this is not a sandbox: paths built at runtime, scripts, or commands handed to another shell can still get through, which is why the report reads what actually happened. The README also notes that the report can miss file access the transcript does not record, such as reads inside scripts or via connected MCP tools.
Platform and agent support
It requires Node 22 or later and was made and tested on a Mac; Windows is described as still being tested. It supports Claude Code, Codex, and GitHub Copilot conversations, but not Cursor's AI, Windsurf, or chats on claude.ai.
Community Discussions
Be the first to start a conversation about agentwhy
Share your experience with agentwhy, ask questions, or help others learn from your insights.
Pricing
Free
Free, open-source (Apache 2.0) CLI that runs on your computer and shows which files your AI agent opened. No account required.
- Runs only on your computer; sends nothing anywhere
- No account required
- Works with Claude Code and Codex on a Mac (Windows still being tested)
- Licensed under Apache License 2.0; commercial use allowed
- License does not cover the name agentwhy
Capabilities
Key Features
- Reads saved Claude Code, Codex and Copilot conversations locally
- Shows which private files an agent opened and the task that led to it
- Traces helper agents and what they passed back
- Step-by-step, diagram, by-folder and full-record views
- Per-file Block or Track choices
- Optional hooks that refuse obvious secret reads
- Protection of paths outside projects via protect command
- Secret values stripped from reports
- Runs offline with no account and no AI model
- CLI commands: check, report, init, protect, notify
