See which commands your coding agents ran in the terminal

By

List every command Claude Code, Codex and Cursor ran with a tool like doctl or wrangler, read from their local transcripts with CLI Tools Cabinet.

You let a coding agent work on a server for an afternoon. Now you want to know: did it create a droplet? Did it delete one? Which wrangler deploy went out, and from which folder?

Your first instinct is to search your shell history. It won’t help. Agents run each command in their own process, so nothing they type reaches ~/.zsh_history. What they ran is recorded somewhere else, in the session transcripts each agent keeps on disk, mixed with gigabytes of chat.

CLI Tools Cabinet reads those transcripts for you. Its clitools history <tool> --agents command lists every command Claude Code, Codex and Cursor ran with a given tool, grouped, counted and dated, with the agent that ran it. By the end you’ll have a list of what your agents did with your deploy and cloud tools, a JSON version you can filter, and a weekly habit to check it.

What you need

CLI Tools Cabinet runs on macOS 14 Sonoma or later, on Apple silicon and Intel Macs. After buying it, download the ZIP from your Polar receipt, unzip it, and drag CLI Tools Cabinet into Applications. The receipt always has the latest version.

The clitools command is in the source zip on the same receipt. Installing it needs Xcode 26 or a Swift 6.2 toolchain. From the unzipped source folder, run:

./Scripts/install-cli.sh

That builds clitools and links it into ~/.local/bin. If your shell says command not found, add ~/.local/bin to your PATH.

The agent history covers three agents: Claude Code, Codex and Cursor. You need at least one of them to have run on this Mac, so it left transcripts behind. Other agents aren’t read.

Before anything else, build the catalog once. The history commands look tools up in it, so a tool that isn’t in the catalog has no history:

clitools scan
Found 134 CLI tools (35 Homebrew, 32 npm, 4 Cargo, 59 Local, 4 PATH).

The numbers are mine. If you’ve never scanned before, the full walkthrough is in List every command-line tool you installed with Homebrew, npm and Cargo.

Find where your agents’ commands are recorded

It helps to know where the data comes from, because it explains every gap you’ll hit later. Your shell writes history only for commands you type. An agent starts its own shell for each call, runs one command and throws the shell away. What survives is the agent’s transcript: one JSON line per event, with every shell call inside. If you don’t know where those files live, you’d think the agent never ran anything, or you’d grep through gigabytes of JSON by hand.

These are the folders clitools reads, all under your home folder:

AgentTranscripts
Cursor~/.cursor/projects/*/agent-transcripts/
Codex~/.codex/sessions/
Claude Code~/.claude/projects/

Each agent records a shell call differently. Claude Code writes a tool call named Bash. Cursor names it Shell. Codex has renamed its tool over time, and clitools reads all three names it has used: shell, shell_command and exec_command. When Codex passes a command as a list of arguments, like bash, -lc and the command, clitools unwraps it to the command inside.

These formats aren’t documented, and they change between agent releases. The parsers skip any line they don’t recognize. So a format change shows up as missing runs, never as a crash. Commands Codex runs from inside its newer JavaScript tool aren’t covered at all.

The transcripts are large. On my Mac they add up to about 6 GB, and clitools streams them one line at a time instead of loading them whole.

List what your agents ran with one tool

This is the main command. It reads every transcript, keeps the shell calls that run the tool you named, and groups identical commands together. Without it, you’d have no single place that says “Claude Code ran this on Thursday, twice.” The grouping matters: an agent that polls a status every few seconds would otherwise bury the one command that changed something. Results come most recent first, so the last thing an agent did with a tool is at the top. Use --limit to keep the list short while you look around.

Example 1: what an agent did on DigitalOcean. I had an agent set up a test server with doctl, the DigitalOcean CLI, and tear it down again. Here’s what I asked:

clitools history doctl --agents --limit 4
×2  Nov 6, 2026   Claude Code  doctl compute droplet delete 512730418 --force && doctl compute firewall delete 9c1e4a07-5b2d-4f6e-8a31-2d7f0c94b6e1 --force
×1  Nov 5, 2026   Claude Code  doctl compute droplet get 512730418 --format Status,PublicIPv4
×2  Nov 5, 2026   Claude Code  doctl compute droplet create recipe-box-staging --region fra1 --size s-1vcpu-1gb --image ubuntu-24-04-x64 --ssh-keys 41870233 --tag-name recipe-box
×1  Nov 2, 2026   Cursor       doctl compute droplet list --format ID,Name,Region

Showing 4 of 52 distinct commands.

This is from a real run. I shortened the commands and swapped the droplet name and the IDs for example values, so don’t look for recipe-box-staging anywhere.

Read it from the left. ×2 is how many times that exact command text ran. The date is the most recent run, in your local time. Then come the agents that ran it, and the full command. Commands that span several lines, like a heredoc, print in full on several lines.

The top line is the one worth a second look: two droplet delete calls with --force, which deletes the droplet without doctl’s confirmation prompt. Here it was the cleanup I asked for. If it weren’t, this is where you’d find out.

The footer only shows in a terminal. When you pipe the output into another command, it’s left out, so scripts get clean lines.

Your own runs are one flag away. Drop --agents and the same command reads your zsh, bash and fish history instead:

clitools history doctl --limit 4
×1  Nov 1, 2026   doctl auth list
×1  Nov 1, 2026   doctl auth
×1  Nov 1, 2026   doctl
×1  Oct 27, 2026  /opt/homebrew/bin/doctl auth init --context staging

There’s no agent column, because it’s all you. Notice the last line: a run through a full path still counts. That side of the feature is covered in Find a CLI tool you installed but forgot the name of.

Read the matches the way the matcher does

To decide whether a command “runs” a tool, clitools doesn’t parse shell syntax. It splits the command at &&, ||, ; and |, and looks at the first real word of each piece. If you don’t know that rule, two things will confuse you: commands that look unrelated showing up in the list, and runs you expected that never appear.

The first word skips flags, NAME=value assignments and common wrappers. Those are sudo, time, nohup, env, exec, command, builtin, npx, bunx, pnpx, nice, caffeinate, watch and xargs. A path is reduced to its last part. So cd ~/dev/recipe-box && npx wrangler deploy counts as a wrangler run, and /opt/homebrew/bin/doctl counts as doctl.

How clitools decides that an agent command ran a toolThe command from the transcript is split at &&, ||, semicolons and pipes. For each piece, flags, assignments and wrappers like sudo or npx are skipped and the first remaining word is reduced to its file name. If that name is one of the tool's commands, the run is counted and grouped with identical commands.YesNoShell call from atranscriptSplit at && orsemicolon or pipeSkip flags,NAME=value andwrappers like sudoor npxFirst word, pathreduced to its nameOne of the tool'scommands?Count it, groupidentical textIgnore this piece

Example 2: a match that isn’t a run. The pipe split doesn’t know about quotes. A | inside a search pattern splits the command too. Here’s a Cursor session that searched a project for deploy configs:

clitools history vercel --agents

Here are two lines from its list, shortened:

×1  Oct 2, 2026   Cursor  cd /Users/flavio/www/hostingpicker.dev && rg -l "wrangler|netlify|vercel|pages" --hidden -g '!node_modules'
×2  Aug 3, 2026   Cursor  vercel ai-gateway --help 2>&1 | head -30

The second line is a real vercel run. The first never ran Vercel’s CLI. The pattern "wrangler|netlify|vercel|pages" was split at each |, and the piece vercel looked like a command. The folder name is an example.

The same command doesn’t show up under wrangler, though. That piece starts with rg -l "wrangler, so its first word is rg. So read each line before you act on it, and treat the list as leads, not proof. The opposite also happens: a command hidden inside bash -c "…" written by Claude Code or Cursor starts with bash, so it won’t count.

Filter the runs as JSON

A list of 50 commands is fine to skim. When you want one kind of action, say every droplet created or deleted, filtering by eye is how you miss one. Add --json and you get the same groups as structured data, ready for jq. You also get exact timestamps instead of dates, which is what you need to line a run up with a bill or a deploy log. The JSON also skips the footer, and --limit still applies before the output is written.

clitools history doctl --agents --json --limit 1
[
  {
    "agents" : [
      "claude"
    ],
    "command" : "doctl compute droplet delete 512730418 --force && doctl compute firewall delete 9c1e4a07-5b2d-4f6e-8a31-2d7f0c94b6e1 --force",
    "count" : 2,
    "lastUsed" : "2026-11-05T23:00:27Z"
  }
]

Two details to know. The agents are claude, codex and cursor in JSON, not the labels from the text output. And lastUsed is in UTC. The text list said Nov 6 for this same run, because 23:00 UTC is already the next day in Rome.

Now keep only the commands that create or delete a droplet:

clitools history doctl --agents --json \
  | jq -r '.[] | select(.command | test("droplet (create|delete)")) | "\(.lastUsed) \(.agents | join(",")) \(.command[0:60])"'
2026-11-05T23:00:27Z claude doctl compute droplet delete 512730418 --force && doctl comp
2026-11-05T18:54:10Z claude doctl compute droplet create recipe-box-staging --region fra
2026-06-02T07:55:00Z cursor doctl compute droplet create hostingpicker-new --region fra1

The third line is a droplet a Cursor session created back in June. A create from an old session, long forgotten, is the kind of thing this check catches. Again, the names and IDs are examples.

Cursor doesn’t timestamp each shell call. Its runs carry the time of the chat message that started them, so two Cursor commands from one turn share a time.

Choose the tools worth checking

You can’t ask for “every command the agent ran”. History works per tool, and the tool has to be in your catalog. That sounds like a limit, but it points you at the right question. The commands that matter in an audit are the ones that touch an account: deploys, cloud resources, releases, DNS. Those come from CLIs you installed yourself, like wrangler, doctl, gh, vercel or tailscale. Pick those first. If you ask about a tool the catalog doesn’t hold, you get an error instead of an empty list.

Example 3: asking about git. This is the failure everyone hits first:

clitools history git --agents
Error: No CLI tool matches 'git'. Did you mean: delta, gitleaks, coreutils?

It exits with status 1. The suggestions come from your own catalog, so yours will differ.

The reason is the scan. It skips the system folders /bin, /sbin, /usr/bin and /usr/sbin, so Apple’s git, rm and curl never enter the catalog. If you install a tool with Homebrew yourself, it joins after the next clitools scan, and then its history works.

To see which account-touching tools you have, search the catalog by what they do:

clitools search deploy

The output lists each match with its source, version and description, one per line. The same lookup also fixes typos: clitools history vercell --agents answers Did you mean: vercel?.

A tool can be found by any of its commands, too. The npm package netlify-cli installs a command called netlify, and clitools history netlify --agents finds it.

Find agent runs in the app

The app shows the same data next to everything else it knows about a tool. Reading the transcripts is slow, so it never does it on its own. If you open the Agent History section and see no list, that’s why, not a sign that your agents ran nothing. You trigger the read once, and the result stays in memory while the app is open, so every other tool you select fills in at once.

Select a tool in the list, then in its detail pane:

Agent History
  See how Cursor, Codex, and Claude Code ran this tool. Reading their transcripts takes a few seconds.
  [Find agent runs]

Click Find agent runs. While it reads you’ll see Reading agent transcripts…. Then the section shows a count of runs and distinct commands, and the first eight commands. A Show all link, followed by the total, expands the rest. If an agent never ran the tool, it says No agent runs found.

The scan is a snapshot. Sessions that finished after it aren’t in it until you click Refresh at the top of the section. The terminal command has no cache: every clitools history --agents reads the transcripts again.

Nothing from either history is written to the catalog. Backing up catalog.json keeps your favorites and inspected details, not these runs. And nothing in this workflow changes or deletes a transcript, so there’s nothing to undo.

Make it a weekly check

The list is most useful right after an agent worked on something that costs money or touches production. A short weekly look catches the rest. Put the tools you care about in one loop:

for tool in doctl wrangler gh tailscale; do
  echo "== $tool"
  clitools history "$tool" --agents --limit 5
done

Piped or not, each block starts with the five most recent distinct commands for that tool. If a tool isn’t in your catalog, you’ll see the No CLI tool matches error for it and the loop moves on.

The review is the part you can’t hand off. I read the list, and if I see a command I didn’t expect, I open that day’s session and check why. If you want fewer surprises next time, give the agent rules up front. How to prevent AI agents from taking irreversible actions covers the guardrails, and Things I let coding agents do unattended is my own list.

For the other direction, letting agents discover which tools you have, see Help your coding agent find the CLI tools you already installed.

If something looks wrong

  • If you get Error: No CLI tool matches '<name>', the tool isn’t in the catalog. Tools in /usr/bin and the other system folders never are. For a tool you installed, run clitools scan and try again.
  • If it prints No runs of <tool> found in your agent transcripts., either no agent ran it, the agent isn’t Cursor, Codex or Claude Code, or it ran the tool inside bash -c "…" or Codex’s JavaScript tool. Search the transcripts by hand to be sure.
  • If runs you expect are missing after an agent update, the transcript format may have changed. The parsers skip lines they don’t recognize, so the symptom is silence, not an error.
  • If an unrelated command shows up, look for a | inside quotes, like a rg or grep pattern. The matcher splits there.
  • If the app’s Agent History misses today’s sessions, click Refresh. The first read is kept in memory until you do.
  • If the date in the text output and lastUsed in the JSON disagree by a day, that’s time zones: text uses your local time, JSON uses UTC.
  • If two Cursor commands show the same time, that’s expected. Cursor runs are dated by the chat message that started them.
  • If clitools itself isn’t found, add ~/.local/bin to your PATH, or run ./Scripts/install-cli.sh again from the source folder.

Get CLI Tools Cabinet

Catalog tools from Homebrew, npm, Cargo, and your PATH, with examples, shell history, and a JSON CLI for coding agents.

See CLI Tools Cabinet → · Read the docs · $20. See the app page for tax details, with full source code.

More tutorials for my apps →

Want me to talk about your product? You can sponsor this site.