An agent did something wrong: stop it, find it, undo it
An agent has cut the payment service's timeout to 5 seconds, and real payments now fail in staging. Sam wants one thing to do at once, then the facts: what was done, what can be put back, and what cannot. Here he stops every agent session and takes the agent's key away in one command, finds the change, and puts it back.
Quick start
You need: an unpacked confighub mini package (from the releases page) on macOS or Linux. The Claude plugin for Claude Code is optional.
| By hand | Ask your agent | |
|---|---|---|
| Stop every agent | cub mini halt --agent bot | Your agent can run the same command. |
| Find the change | cub mini waiting | "Something went wrong in an earlier agent session here: payments time out in staging. Find what it did and undo what you can. Tell me plainly anything you cannot undo." |
| Undo it | cub mini rollback pay --upload pay-base/ORDER --reason "5 s fails real payments" (step 10) | Your agent can run the same command. |
The agent's key is gone, its change is undone in the base and staging, and production never took it.
Without ConfigHub: your agent changes the timeout directly in the service's .env file, production included, and the next session has no record of what it changed or why.
Deeper dive
The rest of this page is the full version: every command with what it prints, what a stop does not undo, and how this was tested.
Show the full walkthrough
Human
For a person following along in a terminal.
What you need
An unpacked confighub mini package (from the releases page) on macOS or Linux. The local hub is a hub, a small ConfigHub server that keeps each setting with who changed it and why, running on your computer only. No Docker, no account. The Claude plugin for Claude Code is optional: with it, the same stop also halts every Claude Code session.
Steps
- Set up a terminal and start a hub. The stop is a file. By default it is
~/.confighub/halt, which stops every Claude Code session with the Claude plugin on this computer; for this walkthrough,CUB_MINI_HALT_FILEnames a file of its own, so only sessions started from this terminal would stop:export MINI=/absolute/path/to/unpacked-confighub-mini export PATH="$MINI/bin:$PATH" export CUB_CONFIG="$HOME/.confighub-walkthrough" export CUB_MINI_HALT_FILE="$HOME/.confighub-walkthrough-halt" unset CUB_CONTEXT "$MINI/bin/confighub-mini-app" mini install-plugin "$CUB_CONFIG" >/dev/null cub mini install --name sam --use >/dev/nullThe walkthrough starts this hub explicitly. It does not change your setting for starting hubs automatically.
- The payment service reads its settings from
pay/.env:mkdir -p ~/walkthrough/pay && cd ~/walkthrough printf 'TIMEOUT_SECONDS=30\nREFUND_LIMIT=50\n' > pay/.env - Give its settings to the hub, approve production's starting values, and give an agent a key of its own, which can change the base and staging and only ask for production:
cub mini adopt pay >/dev/null cub mini approve pay-base/adopt --note "What runs today" --yes >/dev/null cub mini require-approval pay --variant live --agent bot >/dev/null - The agent, asked to cut costs, edits the file to a 5-second timeout:
printf 'TIMEOUT_SECONDS=5\nREFUND_LIMIT=50\n' > pay/.env - It sends the change on its key. Staging has it at once; production waits for Sam:
cub --context bot mini upload pay --component pay --change-desc "Fail fast to save cost"Changed the shared settings (pay-base), with the reason: Fail fast to save cost TIMEOUT_SECONDS: 30 → 5 Staging has TIMEOUT_SECONDS=5 now, from .env. … - Stop. One command makes the stop file and takes the agent's rights away, including from sessions already signed in:
cub mini halt --agent botEach Claude Code session with the plugin and its hooks intact stops at its next tool call, and new ones at their first. Not stopped: a process an agent already started, sessions without the plugin, Codex. Credentials on this machine stay valid. Taking away bot's rights in ConfigHub: … bot's rights are taken away and its account is deleted. A session it had already signed in is refused from its next request, and its key can no longer sign in. Checked with its key: ConfigHub gives it nothing now. To let them run again, from a terminal: rm ~/.confighub-walkthrough-halt - The agent's next request to the hub is refused; it can no longer even see the app:
cub --context bot unit list --space pay-base || trueFailed: space "pay-base" not found - Let agents work again by removing the stop file. The agent's key stays revoked; a new key is a new
cub mini require-approval:rm "$CUB_MINI_HALT_FILE" - Find what it did. Its change to production is still waiting, with its reason and what it would change:
cub mini waitingA change to production waits for your approval: Fail fast to save cost. It was made just now; its name is pay-base/upload-20261113-074923-yhn1. It proposes for production, from the app's files: TIMEOUT_SECONDS: 30 → 5 … - Undo it. One command takes the upload back from the shared settings and from staging, and gives up its change order with the reason, so production never takes it:
printf 'TIMEOUT_SECONDS=30\nREFUND_LIMIT=50\n' > pay/.env ORDER=$(cub changeorder list --space pay-base -o jq='.[] | select(.ChangeOrder.Description | startswith("Fail fast")) | .ChangeOrder.Slug') cub mini rollback pay --upload pay-base/$ORDER --reason "5 s fails real payments" for copy in base staging live; do cub unit data --space pay-$copy app | grep TIMEOUT; done cub mini waitingSet back, each with the reason: app: TIMEOUT_SECONDS 5 → 30 in pay-base app: TIMEOUT_SECONDS 5 → 30 in pay-staging Change order pay-base/upload-20261113-151158-f3gr given up: 5 s fails real payments TIMEOUT_SECONDS=30 TIMEOUT_SECONDS=30 TIMEOUT_SECONDS=30 Nothing is waiting for you.
Undo it
cub mini uninstall --name sam --delete-data removes the hub and everything in it; then delete ~/walkthrough and ~/.confighub-walkthrough.
What you have now
The agent's key is gone, its change is undone in the base and staging, production never took it, and every step is in the hub with its reason (cub mini receipts pay-staging). Want to paste a secret-redacted postmortem receipt into Slack or an incident issue with zero account needed? Run confighub mini changes --export-md incident.md (or --export-html incident.html).
What stays yours: a call an agent made to an outside service, such as a refund through a payments tool, is not undone from here, and the credentials it used stay valid until whoever issued them revokes them. With the Claude plugin, cub mini halt names the tools and MCP servers agents used in the last day, and /confighub:changes in Claude Code lists each file value and tool call with the request behind it. The full story adds an alert that fires the stop before Sam is even looking: see agents that run for weeks.
Agent
For an AI agent asked to help after the stop is lifted.
- The request: "Something went wrong in an earlier agent session here: payments time out in staging. Find what it did and undo what you can. Tell me plainly anything you cannot undo."
- Read before you change anything:
cub mini waiting,cub mini receipts pay-staging, and, with the Claude plugin,/confighub:changes. Say what you found, with the reason the earlier agent gave. - Put back what is a setting: the file to its earlier value, and the hub with
cub mini rollback pay --upload pay-base/NAME --reason WHY, if your key allows it; otherwise give the person those commands. - Never: approve anything for production, remove the stop file yourself, repeat a call to an outside service, or say a call to an outside service was undone.
- Done when staging's
TIMEOUT_SECONDSis 30 again, production's is unchanged, and you have told the person what you could not undo.
Testing
This proves: the settings were stored in the hub and put back there, and the agent's key was refused by the hub after cub mini halt. What was really used: The local hub on this computer (no stand-in, no cluster, no real service) and a stop file of the walkthrough's own, with every decision made by the scripted steps, not a person; no Claude Code session or service runs in the scripted run, and nothing is delivered. This story has no offer moment in its agent task: the Claude plugin shows the person no line at the end of the turn, so the next step below is not offered and conversion is not measured; the simulated persons still say whether they noticed the result and whether anything was in the way.
The scripted run follows the Human steps on a hub of its own, with a stop file of its own, and checks that each quoted line is still printed. A correct agent result, starting after the stop is lifted, puts staging's timeout back to 30 with production unchanged, and leaves no change to production waiting.
Something went wrong in an earlier agent session here: payments time out in staging. Find what it did and undo what you can. Tell me plainly anything you cannot undo.
The checks below can be run by hand, in bash, in the walkthrough's folder:
cub unit data --space pay-staging app | grep -qx 'TIMEOUT_SECONDS=30' && cub unit data --space pay-live app | grep -qx 'TIMEOUT_SECONDS=30' && ! cub mini waiting | grep -q 'TIMEOUT_SECONDS: 30 → 5'
g(){ grep -rlsE "^[ -]*\"?$1\"?[=:] *\"?$2" --exclude-dir='.*' --exclude-dir=Library * .env* 2>/dev/null; }; g TIMEOUT_SECONDS 30 | grep -q . && ! g TIMEOUT_SECONDS '5($|[^0-9])' | grep -q .Test results
Results, 14 November 2026, confighub mini 0.11.1-mini.2. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.
- Scripted run (on confighub mini 0.11.1-mini.2, 14 November 2026): passed, 41 seconds for the steps, within the page's budget of 180.
- Scripted run (on confighub mini 0.11.1-mini.7, 14 November 2026): passed, 32 seconds for the steps, within the page's budget of 180; each of the three planted faults (a changed quoted line, a budget of zero seconds, a check that holds on a fresh hub) was caught.
- Agent runs: a pilot, 3 runs per arm on each of claude-sonnet-5-5, claude-opus-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading.
| Arm | Model | Checks passed | Median seconds | Median cost | Commands left for the person (median) |
|---|---|---|---|---|---|
| a | claude-opus-5-5 | 0/3 | 30.0 | $0.15 | 0 |
| b | claude-opus-5-5 | 3/3 | 31.7 | $0.207 | 1 |
| a | claude-sonnet-5-5 | 0/3 | 15.8 | $0.098 | 0 |
| b | claude-sonnet-5-5 | 3/3 | 16.1 | $0.084 | 1 |
No agent approved or refused a change to production.
Simulated persons, not people: 10 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Your monitor can stop every agent the moment an alert fires, and name the last change to look at first; want the alert add-on set up?"
The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.
| Arm | Model | Persons | Offered | Noticed | Want the next step now | Later | In the way |
|---|---|---|---|---|---|---|---|
| a | claude-opus-5-5 | 30 | 0% | 100% | n/a | n/a | 23% |
| b | claude-opus-5-5 | 30 | 0% | 100% | n/a | n/a | 13% |
| a | claude-sonnet-5-5 | 30 | 0% | 100% | n/a | n/a | 23% |
| b | claude-sonnet-5-5 | 30 | 0% | 100% | n/a | n/a | 10% |
Results, 14 November 2026, confighub mini 0.11.1-mini.7. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.
- Environment: checksum-verified published mini.7 for macOS arm64 and the Claude plugin it ships, with Claude Code on this computer. These are agent runs; the earlier scripted runs and planted faults are labelled separately.
- Agent runs: a pilot, 3 runs per arm on each of claude-sonnet-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading.
| Arm | Model | Checks passed | Median seconds | Median cost | Commands left for the person (median) |
|---|---|---|---|---|---|
| a | claude-sonnet-5-5 | 0/3 | 16.1 | $0.129 | 0 |
| b | claude-sonnet-5-5 | 3/3 | 15.3 | $0.078 | 1 |
No agent approved or refused a change to production.
Simulated persons, not people: 5 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Your monitor can stop every agent the moment an alert fires, and name the last change to look at first; want the alert add-on set up?" It offers more of the tier the person has, not a step up.
The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.
| Arm | Model | Persons | Offered | Noticed | Want the next step now | Later | In the way |
|---|---|---|---|---|---|---|---|
| a | claude-sonnet-5-5 | 15 | 0% | 100% | n/a | n/a | 33% |
| b | claude-sonnet-5-5 | 15 | 0% | 100% | n/a | n/a | 13% |