
- Claude Code
Harness. An AI helper that works in a folder of files. It writes and fixes code, and some office people use it to build small tools.
Part 4 of 5: Build and run a twin of your shop. Before: Part 3, find the bottleneck and test your bad days. Next: Part 5, hand off the weekly "will we ship?" check.
Answer. Before you buy a machine, test the cheap fixes on the bottleneck in order: cut its setup time, cap the work on the floor, and change which job runs first. Then test overtime, a person, and a machine. Run each one alone on the twin, put them side by side with their costs, and choose the smallest fix that passes the 1.05 Rule.
Time and cost. 30 minutes. Claude Pro or higher; twin-flow and the comparison script are free. Who this is for. Owners, plant managers, and planners who are about to spend money on capacity and want proof first.
Walt has a $420,000 quote for a second HMC. It might be the right call. But Josh's rule for a fix is to never pick the size of the fix before the problem is proven, and to propose "the smallest fix the evidence actually supports." Almost everyone reaches for the big fix first, because a new machine feels serious and a fixture plate does not.
In Part 3 you proved HMC-1 is the bottleneck. Now you test what would help it, cheapest first, and let the numbers and the money decide the order of the conversation. The twin does not pick a winner, and neither does Claude. You do.

What will I learn besides testing fixes?
You will learn five methods for any spending decision, not just machines. Each has a short "why" near the end.
- Cheapest fix first. Remove and simplify before you add people, hours, or machines.
- One change per test. Each fix runs alone against today, then good ones are tested together.
- Scripts do the money math. A small script turns twin results and costs into the same side-by-side page every time.
- The smallest fix the evidence supports. Stop at the first fix that gets you where you need to be.
- The 1.05 Rule. Every dollar spent should come back as at least $1.05.
What do I need before I start?
You need the shop-twin folder from Parts 1 to 3, with version 1 saved in results/v1-today.md. If you have not set up Claude Code and twin-flow yet, follow Install Claude Code and Install twin-flow first (about 15 minutes, once).
- The comparison script: compare_fixes.py. Save it in your
shop-twinfolder. It has no AI in it. It reads a small table of results and costs and draws the side-by-side page. - Your costs for each fix. For the sample, they are in the "Money" section of plant1-floor-notes.pdf: fixture plates $14,000, a Saturday shift $1,900 a week, a machinist $78,000 a year, a second HMC $420,000, and a late order about $1,800.
Safe use. Real costs and wages are sensitive. Check your company's AI rules before you give them to Claude Code. The sample costs are made up. Read the safe use notes.
How do I test cheap fixes before buying a machine?
List the fixes in order with their costs, have Claude test each one alone, check the test files, put the results side by side with the 1.05 Rule, and make the call yourself. Six steps. You plan the list and make the call. Claude builds and runs the tests. The twin and the script do every number.
Step 1. List the fixes in order, with what each one costs
This is the plan, so write it yourself. Josh's order for a bottleneck is the order of how much each fix asks of the business: first take waste out, then add hours, then add people or machines. For HMC-1 at Mesquite Ridge:
- Cut the setup. Quick-change fixture plates take an HMC-1 setup from 2.5 hours to 1 hour 15 minutes. $14,000 one time.
- Cap the work on the floor. Release only a set number of jobs at once, so the floor is not buried. $0.
- Change which job runs first. Run the job with the earliest due date first at HMC-1, instead of first come, first served. $0. (The big Anchor Point stock order, due December 18, was jumping ahead of urgent work.)
- A Saturday shift. The four machinists work Saturday 6:00 am to 2:00 pm. $1,900 a week, about $98,800 a year.
- One more person. A fifth machinist on each shift. $78,000 a year.
- One more machine. A second HMC. $420,000.
Notice that the first three remove waste instead of adding capacity. This is the redesign order Josh teaches: "First we remove and simplify. Only then do we let computers help," and the same goes for money.
Step 2. Have Claude test each fix alone
Paste this prompt with your fixes and costs. For the sample, fill the spots with the six fixes and costs above. Claude makes one test file per fix in whatif/, runs each 20 times against today, tests the setup cut and the job-order rule together if both help, and writes results/fixes.csv. It takes about four minutes.
Test fixes for the bottleneck, cheapest first, one at a time. Compare each one to results/v1-today.md, with 20 runs each.
1. Setup cut: [SETUP CUT]
2. WIP cap: let only a set number of jobs onto the floor at once. Try caps of 8 and 5.
3. Job-order rule: at the bottleneck, run the job with the earliest due date first, instead of first come, first served.
4. If 1 and 3 each help, test them together.
5. A Saturday shift: [SATURDAY]
6. One more person: [PERSON]
7. One more machine: [MACHINE]
Put each test in its own file in whatif/. Never edit shop.yaml or data/orders.csv. If a test needs a changed shop file, make a copy in whatif/ and change only that one thing.
Then write results/fixes.csv with this header and one row per test, starting with a row named today:
fix,on_time_pct,late_orders_per_run,one_time_cost,cost_per_year
The on-time % and late orders come from each test's summary.json. The costs are these, and nothing else: [COSTS]
Show me the table when you are done.
Every test changes one thing, so every difference from today belongs to that one fix (change one thing at a time). Claude reports, for example, that a WIP cap of 8 changes almost nothing, a cap of 5 drops on-time to about 51%, and a fifth machinist does nothing at all, because HMC-1 is the limit, not people.
Step 3. Check that each test changed one thing
Open the whatif/ folder with Claude and spot-check two files. Ask: "Show me the lines that differ between whatif/shop-setup-cut.yaml and shop.yaml." You should see only the two HMC-1 setup times change, from 9,000 seconds to 4,500 (2.5 hours to 1 hour 15 minutes).
Two things to look for, both seen on the sample. First, HMC-1 serves two steps, so a setup cut, a second machine, or a job-order rule must change both steps the same way. Second, Claude changed the setup numbers but left the old note "150 min" beside them. The number is right and the note is wrong, and the next person will read the note. Ask Claude to fix the notes too.
Step 4. Put the fixes side by side with the 1.05 Rule
Now the money. Paste this prompt with your late order cost, the number of weeks your order book covers, and your on-time target. For the sample: 1800, 4, and 90%.
Put the fixes side by side and check each one against the 1.05 Rule: every dollar we spend should come back as at least $1.05.
1. Run: python3 compare_fixes.py results/fixes.csv --late-cost [LATE ORDER COST] --weeks [WEEKS] --out results/fixes.html
Do not change the script and do not do the math yourself. If it stops, show me why.
2. Show me its table.
3. Then list, in plain words:
- the smallest fix that passes the 1.05 Rule and gets us to [TARGET] on time or better, and what it costs
- any fix that does better but fails the rule, and by how much
- any fix that did nothing or made things worse
Do not pick for me. If two fixes are close, say so and show both.
Claude runs compare_fixes.py. It does not do the math itself, which is the point: the script figures each fix's first-year cost, the late-order cost it saves in a year, and how many dollars come back for each dollar spent, the same way every time (why the math goes to a script). If a number in the table is typed wrong, like "85%" instead of 85, the script stops and says which line (make bad data stop the script).

Step 5. Read the side-by-side page
Open results/fixes.html in your browser (double-click it). Each row is one fix: its on-time bar, the change from today, late orders, first-year cost, money saved, dollars back per dollar spent, and a pass or fail on the 1.05 Rule. You can open the sample page to see it.

Step 6. Choose the smallest fix the evidence supports
Claude lists the candidates, but the prompt tells it not to pick. You decide, with the people who will live with it. On the sample, the evidence reads like this:
- The setup cut and the job-order rule together reach 92.2% on time for $14,000, and pass the 1.05 Rule at $4.35 back for every dollar. This is the smallest fix that gets past 90%.
- The Saturday shift reaches 90.4%, but costs $98,800 a year and returns $0.52 per dollar. It fails.
- The second HMC reaches 98.9%, the best number on the page, but returns $0.23 per dollar in its first year. It fails the rule today. It may pass in a year if the order book grows, and you will know, because you can run the twin again.
- A fifth machinist returns nothing. A WIP cap of 5 makes things much worse.
Write the call on one page: the fix you chose, the numbers behind it, what you ruled out and why, and the date you will check it with the twin again. Josh asks four questions of any improvement: can you describe it on one page, does the team own it, can you measure it, and will it pay for itself in 90 days? On the sample's numbers, the plates plus the rule save about $60,840 a year, so the $14,000 comes back in under three months.

What does good look like?
Good is a table where every row changed one thing, every number came from the twin or your cost list, and the choice is yours. Answer key, sample data (answer-key shop file, 20 runs each; late order $1,800; 4-week order book; 13 order books a year).
| Fix | On time | Late orders per run | First-year cost | Back per $1 | 1.05 Rule |
|---|---|---|---|---|---|
| Today | 80.9% | 4.40 | $0 | baseline | |
| Setup cut (fixture plates) | 85.9% | 3.25 | $14,000 | $1.92 | pass |
| WIP cap 8 | 81.1% | 4.35 | $0 | pass, tiny gain | |
| WIP cap 5 | 50.9% | 11.30 | $0 | no gain, much worse | |
| Earliest due date first on HMC-1 | 86.5% | 3.10 | $0 | pass, costs nothing | |
| Setup cut and earliest due date first | 92.2% | 1.80 | $14,000 | $4.35 | pass |
| Saturday day shift | 90.4% | 2.20 | $98,800 | $0.52 | fail |
| Fifth machinist | 80.9% | 4.40 | $78,000 | $0.00 | fail |
| Second HMC | 98.9% | 0.25 | $420,000 | $0.23 | fail |
A shop file you drafted yourself lands within about half a point on each row. In our build, the setup cut and the job-order rule together gave 92.0%.
What can go wrong?
These came up on the sample. Each fix goes into the test files or the prompt.
- Two changes in one test. A test that adds a Saturday and cuts setups at once cannot tell you which one helped. One file, one change, then combine only the ones that each helped.
- A shared machine changed on one step only. HMC-1 serves two steps. A second machine set on one step only is a twin error, and a setup cut on one step only is half a fix. Check both.
- Old notes beside new numbers. The setup cut copy said 4,500 seconds with a note that still read "150 min." Fix the notes, because people read notes.
- The cap is set too tight. A WIP cap is a good idea that can starve the bottleneck. At 5 jobs, on-time fell from 80.9% to 50.9%. Test more than one cap.
- The best number wins the room. 98.9% looks great on a slide. At $420,000 it returns 23 cents on the dollar this year. Read the whole row.
- Claude picks for you. The prompt says "do not pick for me." If the reply says "you should buy," ask it to list the options instead. The decision is yours.
How do I check the answer?
Check the test files, then the math, then the call.
- Each file in
whatif/differs fromshop.yamlin one thing, on every step that shares the machine. - The today row in
fixes.csvmatchesresults/v1-today.md. - The page was made by
compare_fixes.py(the reply says it ran the script), not written by Claude. - One row by hand: setup cut saves (4.40 minus 3.25) times 13 order books times $1,800, which is $26,910 a year, against $14,000.
- Someone who will live with the fix has read the one-page call.
Why does this way work?
It works because it puts the decision in the right order: prove the problem, try the cheap fixes, count the money, and only then reach for the big one.
Cheapest fix first. Setup time at the bottleneck is pure waste: the most important machine in the shop, standing still while a fixture is swapped. Cutting it is the "remove and simplify" step, the same move as cleaning up before you automate. A job-order rule costs nothing but a decision. Buying capacity to carry waste is automating a broken process with steel instead of software.
One change per test. Each fix runs alone against the same today, so its effect is its own. Then the ones that helped are combined and tested again, because two fixes do not always add up (change one thing at a time).
Scripts do the money math. Claude reads and explains well, but the money math must come out the same every time, so a small script does it. The page looks the same for every decision, which makes decisions easy to compare later (what deterministic means).
The smallest fix the evidence supports. A smaller fix is faster to try, cheaper to undo, and leaves money for the next problem. If it is not enough, the twin will say so, and you climb one rung.
The 1.05 Rule. "Every dollar spent should return at least $1.05." It is a simple floor, not a full business case, and it stops a good feeling from spending money that does not come back. You set the late order cost and the target; the script only applies them, which is giving AI your priorities instead of letting it guess them.
Frequently asked questions
Does this mean we should never buy the machine?
No. It means buy it when the evidence says so. On the sample, the second HMC fails the 1.05 Rule this year. If the order book grows, rerun the twin with the new orders and the answer may change. The twin lets you see that day coming.
Where do the late order cost and the fix costs come from?
From the people who own them. On the sample, Luis Ramos, the controller, gave the late order cost (expedited freight, overtime, and scorecard hits) and the quotes. If you do not know a number, use a range, run the script twice, and see whether the answer changes.
Why does the job-order rule help so much?
At Mesquite Ridge, a 60-piece stock order due December 18 was released early and ran ahead of urgent orders under first come, first served. Earliest due date first holds it back until urgent work is done. Many shops have an order like that.
Why is the 1.05 Rule measured over the first year?
Because it is simple and fair to every option: one-time costs and yearly costs are both counted for one year. For a machine that lasts ten years, you can also look at more years. The script shows the money, so you can do that math with your controller.
Can I test fixes that are not on this list?
Yes. A second operator on the bottleneck at lunch, moving a part to a different machine, or a different shift start can all be tested the same way: one change, one file, 20 runs, compared with today. Add the row and its cost to fixes.csv.
Take this with you
Two prompts, a script, and the ladder.
1. Test the fixes, cheapest first. Fill in your fixes and costs.
Test fixes for the bottleneck, cheapest first, one at a time. Compare each one to results/v1-today.md, with 20 runs each.
1. Setup cut: [SETUP CUT]
2. WIP cap: let only a set number of jobs onto the floor at once. Try caps of 8 and 5.
3. Job-order rule: at the bottleneck, run the job with the earliest due date first, instead of first come, first served.
4. If 1 and 3 each help, test them together.
5. A Saturday shift: [SATURDAY]
6. One more person: [PERSON]
7. One more machine: [MACHINE]
Put each test in its own file in whatif/. Never edit shop.yaml or data/orders.csv. If a test needs a changed shop file, make a copy in whatif/ and change only that one thing.
Then write results/fixes.csv with this header and one row per test, starting with a row named today:
fix,on_time_pct,late_orders_per_run,one_time_cost,cost_per_year
The on-time % and late orders come from each test's summary.json. The costs are these, and nothing else: [COSTS]
Show me the table when you are done.
2. Put them side by side with the 1.05 Rule using compare_fixes.py.
Put the fixes side by side and check each one against the 1.05 Rule: every dollar we spend should come back as at least $1.05.
1. Run: python3 compare_fixes.py results/fixes.csv --late-cost [LATE ORDER COST] --weeks [WEEKS] --out results/fixes.html
Do not change the script and do not do the math yourself. If it stops, show me why.
2. Show me its table.
3. Then list, in plain words:
- the smallest fix that passes the 1.05 Rule and gets us to [TARGET] on time or better, and what it costs
- any fix that does better but fails the rule, and by how much
- any fix that did nothing or made things worse
Do not pick for me. If two fixes are close, say so and show both.
3. The ladder. For any bottleneck: cut the setup, cap the work, change the job order, then add hours, then add a person or a machine. Climb only as high as the evidence needs.
What's next?
- Part 5: Hand off the weekly "will we ship?" check, the last step: turn this into a Monday check someone else can run, with an approval stop.
- Part 3: Find the bottleneck and test your bad days, the step before.
- Part 1: Draw the box and write your shop file, the start of the series.
- Compare supplier quotes the same way every time, the same "AI explains, script decides the math" split for buyers.
- Clean up before you automate, the idea behind the fix ladder.