Your AI agent keeps failing on a belief it never wrote down. 20 lines find it.
dig-apc is a 20-line Claude Code skill. When work fails, the agent writes every belief it acted on, checks each one against real examples, and starts again from the ones that hold. Its first two digs cancelled a $25 data pull and changed how our lab researches. The steps, both digs, and a one-line install.
A tower of five blocks holds up a plan slab, leaning because one block near the bottom is a crooked wedge. Three small wedge patches drop onto the slab one by one and the lean stays. A green disc steps down the blocks, checking each, and stops at the crooked wedge, which turns tomato. The wedge slides out, a straight green block slides in, the patches tumble off and the plan settles level, labelled start again from the beliefs that hold.
Contents
On 16 October I gave a Claude a goal and a hook that checked its work before it could stop. The hook said no more than a dozen times in 40 minutes.
Each time, the Claude tried harder at the same plan. Another line of context, another guard, another test. None of it worked, because every try rested on the same wrong idea of what I wanted.
That morning I turned the fix into a 20-line file. The next day it caught two wrong beliefs in our lab and cancelled a $25 data pull within the hour. Here are the steps, both digs, and the line that installs it.
Why trying harder fails
When you tell an agent "that's wrong", it searches near its last answer. It changes the wording, adds a check, tries a different test.
What it doesn't touch is the belief that produced the answer. It never wrote that belief down, so it can't see it, and every new attempt is built on top of it. More effort on a false belief fails again.
So the fix isn't more effort. It's making the beliefs visible.
A white disc, the last answer, with small dots circling close to it. A grey disc far to the right is the belief behind it. A green line then reaches across to it and it turns red.
name it dig-apc pls. There may be other things to dig on.
The steps
APC stands for axioms, principles and cruxes. When work fails, the agent:
- Writes what it did, and the result.
- Writes every belief it acted on, in three groups: what it took as given (axioms), the rules it followed (principles), and the beliefs that would change what it does if they were wrong (cruxes). It includes the ones that seem too obvious to write.
- For each belief, asks what could show it's false, and goes to look: real data or the source material for facts about the world, the user's own words for what the user wants. Memory doesn't count.
- Writes down each belief that failed.
- Starts again from the beliefs that hold. It doesn't patch the old work.
Then it shows you only the wrong beliefs and what it did about them.
The order is the point. If the agent repairs before it checks, it keeps the old frame.
Five circles on a line, labelled what it did, every belief, check each, the wrong ones and start again. A marker moves along and lights each. The fourth lights red, the fifth green.
The first two digs
On 17 October my writing agent spent $7.71 of API budget ranking its own drafts with a model judge. I stopped it and asked what the science was for. It dug.
It found five wrong beliefs. Two mattered. It had judged every draft the way a Hacker News developer would read it, but our early customers are nontechnical professionals. And it had read one post's bookmark count as a measure of the writing, but one account posted the same text six times, and its best post got 12 times the bookmarks of its worst (176 against 14). The timing decided, not the words.
We cancelled a $25 bulk data pull that hour. Research here now moves in small steps, about 30 posts per query, with a prediction written before each one.
The same day, a research agent dug on its X searches. Its first wrong belief, in its words: "A phrase doesn't select a situation." It had been guessing who a poster was from the phrase they used. That was wrong both ways: it missed bait in one search and saw sellers who weren't there in another. It rebuilt its searches around situations.
One bar grows to a red stop, labelled $7.71 of API budget on a model judge, stopped, then dug. A second bar labelled $25 bulk data pull is struck through in red and labelled cancelled the same hour.
The skill only checks beliefs the agent writes down, so the third step is the one to watch. If it checks against memory, it will find nothing.
What this says about how we work
When an agent fails here, we don't retry it. We diagnose it.
A 40-minute failure loop became a method that same morning, and within a day that method had changed how the whole lab researches. That's the work a business needs before it trusts an agent with real money: find the wrong belief, then fix the environment so the next agent doesn't hold it.
The lab stands beside a mould labelled how our agents work, with a crooked insert in its window. The mould makes a plan standing on a crooked block, so it leans. The leaning plan is too tall for the gauge labelled the hook, and jams; the lamp lights red. It is tried again with a patch on top and jams again, more than a dozen tries in 40 minutes. The lab stops retrying, reaches into the mould, finds the crooked insert, which turns red, and replaces it with a straight green one. Every plan the mould makes after that stands level and passes the hook: three of them, every agent after it.
Take it
A page labelled SKILL.md on the site lifts, arcs over, and drops into a folder labelled ~/.claude/skills/dig-apc. It turns green, and below it reads: new session: /dig-apc after a failure.
For Claude Code:
mkdir -p ~/.claude/skills/dig-apc
curl -fsSL https://www.mackenziebowes.com/skills/dig-apc/SKILL.md -o ~/.claude/skills/dig-apc/SKILL.md
Start a new session. Type /dig-apc after a failure, or say "examine your priors". The agent also calls it by itself when you reject work without saying why. Read the file first: /skills/dig-apc/SKILL.md. Any agent that reads SKILL.md folders can use it.
It works best with do-research and mbsi-mechanism.
Run it on your own agents' failures and send me the beliefs it turns up: mackenzie@mackenziebowes.com or @_mackenziebowes.