CASE STUDY

AgentWrangler is public, and its repo is a filtered export of a private build

OCTOBER 29, 2026 · 7 MIN · AGENTWRANGLER
TL;DR

AgentWrangler, a dashboard that runs on your own machine and shows where your Claude Code tokens go, is now public on GitHub and npm.

  • One command starts the dashboard, which reads the session logs Claude Code already writes and needs no account or cloud backend.
  • Every public change comes from an export script that refuses to push if a scan finds identifying details, pasted transcript text or credentials.
  • The August promise to keep only counts kept blocking useful recommendations, so the ban on user content moved from the app's database to commits and published releases.
The dashboard tour from the repo, run on synthetic data: one made-up heavy week, from Overview to the impact ledger.

AgentWrangler is the token dashboard I said I was building at the end of the two August posts, why you hit your Claude Code limit and where your API bill comes from, and it is now public on GitHub under the Apache-2.0 license and on npm as agentwrangler. I wanted to walk through what it shows you, how the public repo gets built from my private one, and the privacy rule I had to rewrite partway through, since that last part is the piece most worth copying if you build tools like this.

When this post went up, the public repo showed 78 commits, while my private repo had 3,686 between August 21 and October 21. The private history has never been pushed anywhere, so you'll have to take that number on my word.

What the dashboard shows you

You start it with one command:

npx agentwrangler@latest

That starts a small background service (a daemon) and a dashboard at http://127.0.0.1:2929. The daemon reads the session logs Claude Code already writes to ~/.claude/projects, which are JSONL files with one JSON record per line, checking for new lines every 2 seconds and new files every 30. It keeps what it learns in SQLite, a single-file database at ~/.agentwrangler/db.sqlite, and the dashboard and database stay on your machine with no account or cloud backend involved. You need Node 22 to 24.

The pages a new user needs are these:

  • Overview shows how close you are to Claude Code's 5-hour and 7-day usage limits.
  • Sessions lists your costly sessions, and opening one shows which detectors fired on it and what share of its cost each accounts for.
  • Recommendations come from 31 detectors, small rules that each look for one costly pattern, such as paying full price again for context that could have been read from the prompt cache, long sessions never reset with /clear, or the expensive Opus model doing work a cheaper model could do.
  • Track watches the 14 days after you make a change and records the result in an impact ledger, which is allowed to come back inconclusive, because the project's rule is that modeled savings are never counted as achieved.
  • Rate my setup grades your configuration out of 100, and its optional Judge me button asks Claude for a written review through your own claude command-line tool, after a consent screen that shows the text being sent with names, emails, URLs and host names redacted (you can tell it to stop asking while your configuration stays the same).
  • Settings offers five optional guardrail hooks (scripts Claude Code runs around tool calls), from a context-budget warning to a dangerous-command guard, and none of them is installed unless you choose to install it.

How the public repo is built from the private one

The public repo started on August 20 as a placeholder with a planning doc. At the first public release on September 4 it was replaced with a fresh tree, and every change since then has come from one export script, which works in four steps:

  1. A manifest decides what ships. The manifest is a text file of include and exclude rules, and it keeps out the plans and handoff notes the agents worked from, research and design notes, the agent configuration, a review of my own token spend, and the export tooling itself. It also swaps in public versions of CLAUDE.md (the instructions file Claude Code reads) and README.md.
  2. The tree is built from the latest commit only, so nothing uncommitted in my working directory comes along.
  3. Three gates run. An anonymization search for identifying details and a raw-content scan for pasted transcript text abort the export on any hit. Then trufflehog, an open-source scanner for credentials like API keys and tokens, has to pass, and the script fails closed, meaning a failure blocks the push instead of letting it through: a missing trufflehog binary or a request to skip the scan refuses the push.
  4. It never pushes to the public main branch. It pushes a separate branch and opens a pull request, which is why the public history reads as a run of PRs from export/... branches.

Here is that gate as a short Node script, simplified from the project's export script. It needs trufflehog on your PATH:

// publish-gate.mjs, simplified from AgentWrangler's export script.
// Run: node publish-gate.mjs <folder> [--push] [--skip-scan]
import { spawnSync } from "node:child_process";

const args = process.argv.slice(2);
const folder = args.find((a) => !a.startsWith("--")) ?? ".";
const push = args.includes("--push");
const skipScan = args.includes("--skip-scan");

function die(message) {
  console.error(message);
  process.exit(1);
}

if (skipScan) {
  if (push) die("Refusing to push with the secret scan skipped.");
  console.log("Secret scan skipped; nothing will be pushed.");
} else {
  const scan = spawnSync("trufflehog", ["filesystem", folder, "--fail", "--no-update"], { stdio: "inherit" });
  if (scan.error) die("trufflehog is not installed; refusing to continue.");
  if (scan.status !== 0) die("The secret scan found something; nothing was pushed.");
  console.log(push ? "Gates passed; safe to push the branch and open a PR." : "Gates passed.");
}

The project's publishing runbook says changes land on the private main branch first, because a fix made only on the public side gets overwritten by the next export. No hook enforces that, but the script has a check mode that exits with an error when the two trees have drifted apart.

Why the app now stores some message text, and where the privacy rule went

The August posts said AgentWrangler would keep only counts, and inside the project that rule was called SEC-101. It kept getting in the way. The project's architecture decision record on the subject (ADR-112, part of its written log of design choices) lists it as the most frequent reason recommendations came out less useful than they should have been, hit more than a dozen times, and sums the problem up as "the data is in the transcripts but SEC-101 discarded it." One example was the investigation prompt a user could copy from a recommendation card, which ended up giving Claude less information than the card itself was showing.

The diagnosis in the ADR is that the rule treated two different risks as one. Message content kept in your own local database sits right next to the transcripts Claude Code already stores in ~/.claude, so it adds no new exposure and can be deleted whenever you like, while content that slips into a commit or a published release is out in the world for good, which is why the second risk is the one worth guarding.

So the decision, accepted on September 19, kept the ban and moved it: no raw user content in any commit or published artifact. A September 25 amendment removed the content restrictions inside the app and kept the secrets filter, so the database now also stores shell-command text that has passed through that filter and short excerpts of error messages, and the privacy doc describes the filter as best-effort pattern matching. The same doc lists the few features that do reach out, such as Judge me, along with what triggers each one.

The new rule is enforced in three places, so one missed check doesn't let content through:

  • A pre-commit hook, a script git runs before it accepts a commit, scans for raw content on my machine.
  • A CI check (continuous integration, the checks that run on every change) runs the same scan, so a commit made with the hook skipped is still caught.
  • The export script aborts on any hit before the trufflehog gate even runs.

The ADR also records its own limits. The transcript scan is a heuristic, which means it looks for the shape of transcript text rather than proving none is there, so a short real transcript pasted into the docs or test fixtures could slip past it. It also says the decision has to be reopened if AgentWrangler ever adds a sync, backup or telemetry feature, since the argument above only holds while no such feature exists.

How the daemon protects your machine

The daemon listens only on 127.0.0.1, the loopback address that only your own machine can reach. Because a web page you visit could still try to send requests to it (cross-site request forgery, or CSRF), every write request has to pass an origin check and carry a token the daemon generates fresh each time it starts. AgentWrangler never forwards your Claude login token, it strips ANTHROPIC_API_KEY from the environment of any claude it launches, and the server refuses one-click "apply this recommendation" outright, so you copy a prompt and make the change yourself.

What the tool has not proven yet

The savings figures are models that haven't been checked against anything outside the project. The tool has been validated locally on Windows, and its macOS permission prompts haven't been tried on a real Mac yet.

If you try it, start with the README's first five minutes, then make one change and let Track tell you whether it helped.

Trust belongs in the schema, not the application.
The operating principle behind every project here. A rule the database enforces can't be forgotten in a hurry. Constraints, denied-by-default access, append-only logs — the controls that hold are the ones the system won't run without.