← Insights

Mental Models for the AI EconomyFuture of Work

The Tower of Hanoi Is the Best Lesson in Delegation I Know

Recursion is delegation with a contract: you solve n discs only by trusting a sub-call with n − 1. What that teaches about briefing AI agents and teams, with five interactive exhibits.

By George MoreasOctober 18, 202611 min read · interactive

This week I built a Tower of Hanoi for the Lab. I expected a weekend toy. What I got was the clearest picture I have of a skill I use every day and rarely explain well: handing work to someone else, human or agent, without losing control of the outcome.

The puzzle has three pegs and a stack of discs. You can solve it in your head for three discs. For eight you cannot, unless you stop trying to hold the whole plan and start trusting a smaller version of yourself to handle most of it. That trust is the whole trick. It is also exactly what a good brief to a Claude Code subagent, a contractor or a team lead has to earn.

The short version
  • Recursion is delegation with a contract. To move n discs, you hand n − 1 to a sub-call, move one disc yourself, and hand n − 1 off again.
  • The brief is the function call. Outcome, scope, resources, the rule that can’t break, what’s off-limits, and what “done” looks like. Miss one and the sub-call guesses.
  • The obvious move is often wrong. A manager who chases visible progress on the goal loops, stalls or overspends. The numbers below are computed, not estimated.
  • Decomposition doesn’t make the work smaller. It makes it thinkable: the total doubles with every disc, while the top call’s own job stays at one move and two briefs.

The puzzle, in one paragraph

The Tower of Hanoi is a puzzle where you move a stack of discs from one peg to another, one disc at a time, never placing a larger disc on a smaller one. The French mathematician Édouard Lucas published it in 1883 under the pen-name N. Claus de Siam, an anagram of “Lucas d’Amiens,” and sold it with a legend: temple priests moving a tower of 64 golden discs, and the world ending when they finish (the history is summarised here).

Play a round before reading on. The point lands harder in your hands than in my prose.

01 / Try it

Four discs, three pegs, one rule

ABC · goal
Moves
0
Minimum
15
Left, at best
15

Your move.

Move the tower to C, one disc at a time, never a larger disc on a smaller one. Tap a peg to lift its top disc, tap another to drop it; keys 1, 2, 3 or arrows and Enter. “Delegate the rest” finishes optimally from wherever you stopped.

If you solved four discs in fifteen moves, you probably noticed something halfway through. You stopped thinking about individual moves and started thinking in chunks: get the top three out of the way, move the big one, put the three back. That shift is recursion. It’s also the moment a manager stops doing the work and starts directing it.

Recursion is delegation with a contract

Recursion solves a problem by handing a smaller copy of it to a sub-call that you trust to finish. The whole solution for n discs is three lines: move n − 1 discs out of the way to the spare peg, move the largest disc to the goal, move the n − 1 discs back on top of it.

Notice what the top-level call does not do. It does not plan the n − 1 moves. It does not check each one as it happens. It writes two briefs, makes one move with its own hands, and waits. The sub-calls do the same thing one level down, and so on, until somebody is handed a single disc and simply moves it.

02 / The org chart

Every call moves one disc. The rest it delegates.

4A→C3A→B2A→C1A→B1B→C2C→B1C→A1A→B3B→C2B→A1B→C1C→A2A→C1A→B1B→C
ABC · goal
Moving a disc now · hanoi(1, A→B)
  • Goal: disc 1 from A to B.
  • You may use C as working space.
  • Never put a larger disc on a smaller one.
  • Out of scope: disc 2 and up. Don't touch them.
  • Done means: disc 1 stands on B, in order. Report back then.

A leaf: it does the work directly and delegates nothing.

Move 0 of 15 · 3 managers waiting on a report

The recursion tree for 4 discs, laid out so each call sits above the moment it makes its own move. 15 calls, 15 moves: nobody does more than one. Select any node to read the brief it was handed.

Run the chart and watch who is busy. At any moment exactly one node is moving a disc. Every node above it is waiting on a report. For four discs there are fifteen calls and fifteen moves, and nobody, including the top of the chart, makes more than one. Seniority in this org is not doing more of the work. It is owning a larger outcome and being responsible for a better brief.

I spent a long time in enterprise product management before I started building alone, and the failures I remember were rarely failures of effort. They were failures at the boundary between levels: a team handed a goal without the constraint that mattered, or a constraint without the goal. Hanoi makes that boundary explicit. A sub-call is useless if it is told to move three discs but not where to.

The brief is the recursive call

A delegation brief works when it carries every argument the sub-call needs, because the sub-call has no other way to know them. Look at the signature: hanoi(n − 1, from, to, via). Each argument is a line in a brief.

  • To is the outcome. Not the activity, the state of the world when they are done.
  • n − 1 is the scope: exactly which discs are theirs.
  • Via is the working space they may use. The spare peg is a resource, and a sub-call that does not know it exists cannot do the job.
  • The rule, never a larger disc on a smaller one, is the invariant that holds everywhere, at every level.
  • Disc n is out of bounds. It is the one you are keeping. Touch it and the whole plan collapses.
  • Return is the definition of done: the smaller tower stands on the named peg, in order, and the caller can see that without asking.

That mapping is almost literally how agent delegation works now. Anthropic’s Claude Code documentation on subagents describes each subagent as running in its own context window, with its own system prompt and tool access, and returning only a summary to the main conversation. In other words, the sub-call cannot see your head. It sees the brief. The docs also note that subagents can spawn their own subagents, up to three layers below the main conversation by default, which is a recursion tree with a depth limit.

I learned the cost of a bad argument the expensive way. On Ballistica, my game project, I run agents in waves of parallel lanes, each working from a written brief. In one wave, the briefs themselves were wrong six times, and two lanes rediscovered work that had already been closed. The agents did what they were told. The calls had the wrong arguments. The fix was a rule in my own project file: every defect a brief names cites a commit or a file and line, or is labelled unverified until someone checks it. It is the to parameter, enforced. My earlier write-up on the four rules in one CLAUDE.md covers the standing-instructions half of the same problem.

The obvious move is the wrong one

Greedy delegation, making whatever move shows the most visible progress toward the goal, fails on the Tower of Hanoi in a way you can count. It is the clearest example I know of why a manager who measures progress by what’s on the goal peg will get lost.

Start with the very first move. The smallest disc wants to go straight to the goal. For an odd number of discs that is correct. For an even number it is wrong: the optimal first move is to the spare peg, away from where you are trying to go. Send it to the goal anyway and the best you can then do costs one extra move. Small, but it is the shape of the whole problem: the right step sometimes looks like moving backwards.

Now make that instinct a policy and let it run.

03 / The obvious move

A greedy manager against a delegating one

discs
Greedy: “get discs onto C”0 moves
ABC · goal
Recursive: “delegate n − 1”0 moves
ABC · goal

The greedy policy: every turn, make the legal move that leaves the most discs on C, never just undoing the last move (ties go to the first option, A to C). With memory, it also refuses to revisit any position. Both runs are deterministic; the counts are what the code produces, not estimates.

The blind version walks back into a position it has already been in on its ninth move, for every tower size I tested, three to eight discs. It would circle forever. Give it a memory, so it refuses to repeat a position, and the outcome splits by parity. With an odd number of discs it paints itself into a corner and stops. With an even number it gets there eventually: 23 moves against 15 for four discs, 731 against 255 for eight, nearly three times the work.

I see this in product teams constantly. The roadmap that ships the most visible items each sprint looks like progress and keeps undoing itself. The recursive manager looks slower at first, because many of its early moves put discs on the spare peg, on purpose, to clear the way. Clearing the way is the work.

Exponential work, constant management

Decomposition does not reduce the total work of the Tower of Hanoi. The minimum is 2ⁿ − 1 moves whichever way you think about it. What decomposition reduces is how much any single participant has to hold.

Without the recursion, a planner has to reason about the puzzle as one flat space, and that space has 3ⁿ positions, every arrangement of n discs on three pegs. With the recursion, the person at the top makes one move and writes two briefs, at any size. Scroll through the chart and watch the three lines separate.

04 / Scroll to add discs

The work doubles. The manager’s job does not.

1disc
You, the top call
1 move
The whole organization
1 move
Planning it all yourself
3 positions
At one move a second
1 second
110^510^1010^1510^2010^2510^30116324864

One disc: one move. Nothing to delegate yet.

Log scale. Moves are 2ⁿ − 1, the proven minimum; positions are 3ⁿ, every arrangement of n discs on three pegs, which is the space a planner without the recursion has to search. Durations assume one move a second and a 365.25-day year. The 45-disc line compares about 1.1 million years with the roughly 300,000-year age of the oldest known Homo sapiens fossils.

This is the honest version of the claim people make about AI agents. Agents don’t make hard work small. A large job with a clean decomposition is still a large job, and every subagent’s requests count against the same usage limits as the main conversation, according to the same documentation. What a decomposition buys you is that nobody, human or model, has to hold the whole 3ⁿ space in one context. The cost moves from comprehension to coordination, and coordination is what briefs are for.

The legend makes the scale concrete. At one move a second, 64 discs take 2⁶⁴ − 1 seconds: about 585 billion years, roughly 42 times the age of the universe. The Lab version lets you buy faster priests. At a billion moves a second, you still wait 585 years. A faster worker does not rescue a problem that doubles.

Where the analogy breaks

The Tower of Hanoi is a perfect delegation story because its sub-calls never fail, never misread the brief and never disagree. Real delegation does all three, so the metaphor needs three corrections before you use it.

Returns need checking. In Hanoi, “done” is visible: the tower is on the peg or it isn’t. In real work, a sub-agent reports success in the same confident tone whether or not it succeeded. Define the check before you delegate, and run it on what comes back. I wrote about this in agent evaluation before shipping; the short version is that a final-state check beats a status message.

Sequential is not parallel. Hanoi’s two sub-calls cannot run at the same time; the second needs the first to finish and the big disc to move. Plenty of real work is like that. Spawning ten agents on a dependent chain produces ten agents waiting, or worse, ten agents guessing. Parallelise the independent branches only.

The person at the top still signs. The recursive manager’s one move is the move nobody else may make. In my experience that is usually the decision with consequences: the merge, the send, the spend. More sub-calls mean more returns to review, which is the bottleneck I described in More Agents. One Person Who Signs Off.

Write your next brief as a function call

A good delegation brief is a function call with every argument filled in, plus a return value you can check. Pick one task you will hand off this week, to an agent or a person, and run it through the builder.

05 / Take this with you

Write the recursive call: a delegation brief

7/7 arguments

Every argument is there. Now it’s a call, not a hope.

GOAL
The checkout page shows the correct tax for Florida addresses.

YOUR SCOPE
src/lib/tax.ts and its tests. The bug, and only the bug.

YOU MAY USE
Read anything in the repo. Run bun test. Create a scratch branch.

NEVER BREAK
Existing passing tests stay passing. No new dependencies.

DO NOT TOUCH
The payment flow, the Stripe calls, the database schema.

DONE MEANS
A failing test for the Florida case that now passes, and the full suite green.

REPORT BACK WITH
Files changed, the test output, and anything you noticed but did not fix.

If something outside your scope is blocking you, stop and tell me what and why. Don’t work around it.
Assembled in your browser from what you type; nothing is sent anywhere or saved. Each field maps to an argument of the Hanoi call. The closing escalation line is always added: a sub-call that hits a wall should say so, not improvise.

Three habits keep this honest. Write the brief so it would work if you were unreachable until the work is done, because for a subagent you effectively are. Keep the “disc n” line explicit; the thing you are not delegating is the thing most likely to get touched. And if you notice yourself writing a brief for work you could not describe the result of, stop: you are not ready to delegate it, and no amount of ambitious prompting will fix an outcome you haven’t named.

You can’t move n discs alone. You can write the call that moves n − 1.

The full puzzle, with three to ten discs, a hint engine that works from any position, and the recursion drawn live as it runs, is in the Lab: Tower of Hanoi.

FAQ

What is the Tower of Hanoi?

A puzzle published by Édouard Lucas in 1883. You move a stack of discs from one peg to another using a third peg, one disc at a time, and never place a larger disc on a smaller one. It is a standard first example of recursion because the solution for any number of discs is defined in terms of the solution for one fewer.

Why does the Tower of Hanoi take 2ⁿ − 1 moves?

To move n discs you must move the n − 1 above the largest disc twice, once out of the way and once back on top, plus one move for the largest disc itself. So the count doubles and adds one with each disc: 1, 3, 7, 15, 31. That gives 2ⁿ − 1, and it is provably the minimum.

How is recursion like delegating to an AI subagent?

A recursive call receives a smaller version of the problem with explicit arguments and returns a result. A subagent works the same way: it runs in its own context, sees only what you put in its brief, and hands back a summary. If the brief is missing the outcome, scope or constraints, the subagent has to guess, just like a function called with missing arguments.

Should I split every task into subagents?

No. Decomposition pays when a task has independent parts or would flood one context with material you will not reuse. It costs coordination: each subagent needs a brief, uses its own requests, and returns work you must check. Dependent steps gain little from parallel agents. Small tasks you can describe and verify in one sitting are usually faster done directly.

What should a good delegation brief include?

The outcome as a finished state, the exact scope being handed over, the resources the worker may use, the one rule that must not break, what is out of bounds, and a definition of done you can check without asking. Add the shape of the report you want back and an instruction to stop and escalate when blocked rather than work around it.

Sources

Checked October 2026. Move counts, durations and the greedy results are computed by the puzzle code that powers these exhibits, which is tested against a brute-force search.

  1. Tower of Hanoi — Wikipedia (Lucas, 1883; the 64-disc legend; 2⁶⁴ − 1 moves)
  2. Create custom subagents — Claude Code Docs
Share
Mental Models for the AI Economy

Get the next essay the day it publishes.

A few a month, written from real builds. Unsubscribe in one click.

George Moreas
About the author
George Moreas

Performance marketing and search leader who builds — 15+ years in digital growth and product (AT&T/DirecTV, Microsoft, Employbridge, Site Impact), now running his own properties with AI. These essays are field notes from that loop: what AI actually changes about work, product, and the economics underneath. Based in South Florida.

Keep reading