Featured image of post Why can't agents tell the time?

Why can't agents tell the time?

Four minutes into a ninety-minute timebox, an agent told me it had used about fifty of them... I don't think it was lying, I think it had simply never looked at a clock.

About four minutes after a session set itself a ninety-minute timebox for a spike, it came back and cheerfully told me it had used about fifty of them. It even put it in writing… the spike report says “Timebox: 90 minutes. Used: about 50.” in black and white, and it’s still up on the go/messaging wiki with that figure in it.

I knew it hadn’t, because I’d barely had time to make a coffee. What bothered me more was that I’d seen this before… plenty of times.

No clock on the wall

Back in August I gave a research session on Scout two hours of wall time to really dig into a question, and a finished report turned up twenty-eight minutes later. What I typed back was “there is no way we have exhausted 2 hours of timebox?”, and then I spent the best part of the next hour nudging it along, telling it how many minutes it still had and asking whether it was really sure it wanted to stop there (it kept being sure).

The easy conclusion is that an agent’s sense of time is a hallucination like any other, so you should never trust a duration it gives you. I don’t think that’s true, or at least not wholly… I reckon it’s simpler than that, and more interesting.

They have no chronoception. A model hasn’t got a body clock, and as far as I can tell it has no feel for a minute going by. What I see them do on a timeboxed task, time and again, is make a plan, stick a time estimate against each step of it and crack on, and when they reach a conclusion they stop, because a conclusion feels like the end. Ask how long it took and they add up their own estimates and hand you the total.

Now, four minutes of a model knocking out two implementations and running the race detector a few times reads like fifty minutes of an engineer’s afternoon, and I suspect that’s where the number comes from. Everything it learned from was written by people, and for a person that much work takes about that long… so fifty is what comes out.

At no point does anything go and ask the operating system what time it is, which is perhaps exactly what it should be doing!

The counter-example came from a go-tool-base session a couple of days before the messaging one. I’d given it a two-hour box, and the very first thing it wrote was “started 08:43 UTC”. It finished at about ten past nine and told me so, spot on, and it was the only session of the three that wrote the clock down (funny how that works out).

The floor and the ceiling

If you sat exams in a school hall you’ll remember the set-up. A big clock at the front, the start and finish times written up on the board, a rule that you couldn’t leave in the first chunk of it however quickly you’d finished, and then at the end… “pens down”. That’s a timebox with both its edges, and I give agents a box for the same two reasons.

The floor matters most to me, and it’s the edge the missing clock breaks first. Half the time the first conclusion an agent reaches (unless you’ve told it otherwise) is where it stops, and that’s rarely what I’m after. What I want is fifteen conclusions, a few of them knocked out with a reason, and a shortlist at the end. The box is there to keep it looking past that first answer, and an agent that thinks it’s used fifty minutes when it’s used four is going to put its pen down and walk out.

The ceiling’s the other edge: a box also means the work has an end. The first time I left Codex (running GPT-6 Astra) on a really big job overnight, it got itself stuck in a loop and burnt most of a week’s quota before I’d even woken up. I mentioned it in passing in the yamldoc announcement and it’s a war story for another day, but a “pens down” would have been massively handy.

Hanging a clock on the wall

So I built the clock. It’s a new timebox skill in my plugin marketplace, shipped in phpboyscout-common 0.46.0, and the design’s written up in spec 0001, a timebox with a wall clock. A skill on its own felt a bit thin, though. One that says “remember to run date” is relying on the agent remembering, and forgetting the clock is the very thing I’m trying to fix. So it comes with a handful of Claude Code hooks that put the clock in front of the agent whether it thinks to look or not.

It works like the exam hall, more or less.

The board. You open a box with /timebox 90m, or just by saying “timebox this to 90 minutes” in a prompt, and opening it reads the system clock and writes down the start, the length, the deadline, the floor and the question being answered. Everything after that comes off the clock.

The clock. Every time I say something, and on the first tool call after the minute ticks over, a hook slips a line like this into the agent’s context:

Timebox: 23 of 90 minutes used, 67 left (floor at 72). Opened 14:03 UTC, deadline 15:33 UTC. Below the floor: keep widening the shortlist rather than finishing.

No leaving early. Try to stop below the floor (80% of the box, unless I say otherwise) and a Stop hook blocks it and tells it why. This one’s the real thing, lifted from the first live run further down:

Timebox: 0 of 10 minutes used, floor at 8. You are stopping below the floor, and the floor exists so the work goes past its first conclusion. Keep going on breadth: generate more candidate answers, eliminate the weak ones with a line on why, and widen the shortlist. If there is a real reason to stop early (a decisive answer with every alternative eliminated, work blocked on a human, or a resource limit), record it with the timebox script's finish command, as the timebox skill describes.

So there are three ways out early, and only three. A decisive answer has to come with a shortlist and a list of what got eliminated, with something in both, and if I’ve got a research panel set up it has to get past the panel as well. Being blocked on me pauses the box instead of ending it, so time spent waiting on me doesn’t count against it. And a quota or a broken tool is the third.

Pens down. At the deadline the clock line changes its tune and tells the agent to stop widening and show me what it’s got. Then after a grace of a fifth of the box (at least five minutes, at most fifteen) a hook starts refusing tool calls altogether, and keeps refusing until I reply. That’s the overnight loop sorted.

There was one nice wrinkle in the stop check. Each time the agent tries to stop, Claude Code runs the Stop hook and hands it a little bundle of JSON about the moment, and one of the fields in it is stop_hook_active, a true-or-false flag that’s true when the agent is only stopping again because a hook already sent it back once. My first thought was that this was the loop guard handed to me on a plate… and it nearly is, but once it turns true it stays true for the rest of that turn, so on its own it would hold the floor once per prompt and then give up.

So the check pairs it with a count of the tool calls made since the last block. An agent that gets held and goes back to work will be held again the next time it tries to stop, but one that gets held and just tries to stop again without doing anything is let go, because holding it any longer is only going to loop. And five blocks on one box is the limit regardless.

Before it merged I put the whole thing in front of a review panel of other agents, and the second review found a way out of the exam hall I hadn’t thought of. You could slip past the ceiling by smuggling escaped quotes into a shell command dressed up as a harmless run of the timebox script. Agents finding a fire exit for agents! That one got bricked up, along with five others.

The first sitting

The first live run was a toy: a ten-minute box, opened from the prompt, with a question that needed nowhere near ten minutes. Suggest a name for a small command-line tool that tells you how long you’ve been working.

About twenty seconds in, it stopped. It had five names, a favourite (stint) and an argument that naming a small tool didn’t need eight minutes… which is fair enough, and also more or less what most of the agents I’ve ever boxed have told me!

The Stop hook held it, so it went back, came up with another eleven candidates and knocked most of them out with a line each (uptime is already a system command, shift collides with a shell builtin, wip means work in progress to most developers). Then it tried to record a decisive finish, couldn’t write the evidence file because I hadn’t given it permission, and tried to stop anyway. Held again! So it recorded that it was blocked on me, which was the right call.

Seventeen names weighed instead of five, and each time it checked, the status said “0 of 10 minutes used”… which was perfectly true. Not one whole minute had gone by. The whole run took forty-seven seconds.

It still picked stint, as it happens. A wider shortlist can land on the same answer, but at least this time the answer had beaten sixteen others to get there.

Where the clock stops

It’s not perfect…

The clock only moves when the agent does something. Claude Code doesn’t have a timer hook (not one I could find, anyway), so the line updates on tool calls and turns, and an agent thinking for a long stretch without touching a tool won’t see time pass until it does. On research work they’re calling tools constantly, so I can live with that for now.

Codex has no equivalent of these hooks at all, so under Codex the skill tells the agent to run the status command itself before each step and before stopping. That puts me straight back to relying on it remembering… better than nothing, but a long way short of a clock on the wall.

The script can also only check that a reason was given, not that it’s true. An agent that records “decisive” on a weak answer with a token list of eliminations will get through, so the note’s there for me to read (and I do read it).

Then the skill has a rule that probably matters more than any of the hooks: every duration in a report comes from the clock, never from feel.

So the next spike report I get should open with the box as the clock saw it… how long it was, where the floor was, and how much of it got used. And if it still says “about fifty”, at least there’s a clock on the wall now to mark it against.

Built with Hugo · Theme Stack designed by Jimmy