A Machine That Never Sleeps
Eli finds June mid-shift in the cold roar of a data hall's server rows, discovering that his booking system double-booked her because it only knew the calendar he'd shown it and nothing of the paper schedule Dez hands out on-site. He eats a real loss refunding a customer's deposit, learns the hard way that a captured card charge costs money to give back while an unclaimed hold would have simply expired, and rebuilds the payment side to hold funds instead of charging them outright. Through the night he turns his one-man overnight script into something closer to a business: giving the agent a way to run itself on a schedule, to read and act through a small set of allowed tools, and to leave its instructions and rules written down where it can find them again each run. A queue and a retry system catch failures, until a retry sends the same confirmation twice and teaches him to make every outward action safe to repeat rather than merely repeatable. He negotiates cash and a shelf in the building to keep the machine running past his own bedtime, sets June up on a flat fee plus a small charge per finished job, and on the way out passes a locked, doubled-power cage of unmarked machines that no work order claims.
June answered on the second ring, which she never did, and that was how Eli knew something was wrong.
"You're calling me," she said. There was a hollow behind her voice, the sound of a room with concrete on all six sides. "Good. Get in your car."
"I was going to say —"
"Say it here. Ardmore. The data hall on Kessel, past the transfer station. I'm on a contract shift in the sublevel until six and I can't leave, so if you want to talk about your robot, come talk about your robot." A clank. Something metal rolled. "Bring shoes you don't love."
She hung up before he could answer, and Eli sat there with the phone warm against his ear and the laundromat's dryers thumping up through the floorboards like a slow heart. Mara had left the ledger open on the kitchen counter, the way she did when she wanted a number to be looked at rather than discussed. Rent, circled. Under it, in her small square handwriting, two deposits from a payment processor, thirty-eight dollars each, the first money the business had ever made. She had written a question mark next to them. Not unkind. Just a question mark.
"It's real money," he said to the empty room.
He put on the boots with the split toe and went out into the wet.
Ardmore sat where the city gave up and became yards and fencing and heaps of gravel. Chillers on the roof roared like a plane that never took off. The yard smelled of ozone and diesel. Under the loading dock's sodium light, rain came down orange, and a man in a hi-vis vest sat on an overturned crate reading something on a cracked tablet.
"Contractor?" the man said.
"Visitor. June Okafor's expecting me."
"June's in D row." He stood, and he was taller than the crate had suggested, with grey in a short beard and a lanyard hanging to his belt. "Dez Whitlock. I run nights. Sign the book, I'll walk you down, don't touch anything with a light on it."
The book was a real book. Paper, cardboard cover, a column for time in and a column for time out, and a hundred names above his in a hundred hands. Eli wrote his own and felt oddly formal about it, like signing for a package he hadn't ordered.
They went down. The stairwell was hot and then, through a door, cold — a wall of cold, pushed by fans, the kind of cold that dried your eyes out. Rows of racks stood in the dim with their little green and amber lights, thousands of them, patient as livestock. The noise was not loud so much as total. Eli's phone lost signal three steps in and never got it back.
June was up a fibreglass ladder at the end of the row with her arms above her head, feeding grey conduit into a tray bolted to the ceiling. A spool the size of a truck tyre sat on the floor, unwinding slowly. She looked down at him and did not smile.
"You booked Terrance Hollis for Friday at eleven," she said.
"Relay booked him. Off a voicemail nine days old. He'd already given up on you, June, and he paid a deposit — that's found money —"
"Friday at eleven I am here." She hooked the conduit and came down the ladder two rungs at a time. "This shift. This building. Six to six, four nights, and Friday I'm on days because they're energising a new bus and they want an extra body on the floor. Contract work. Signed. I can't move it. If I don't show they don't call me back, and this job pays my van."
Eli's mouth went dry in the cold air. "Your calendar was clear."
"My booking calendar was clear." She said the two words like she was setting them on a bench, apart. "That's the one you gave your machine. Ardmore's shifts come by text from Dez, and they go in my head and on the whiteboard in my van, because that's where they've always gone."
And there it was. Eli stood in the noise with the answer arriving all at once, and it was not a mistake in the machine at all. Relay had done its work exactly right. It had read a voicemail, understood a man with a dead outlet in a rented kitchen, checked a calendar, found the hours empty, offered them, taken thirty-eight dollars, written the confirmation. Every step clean. The plan was good. The plan was simply about a world that wasn't there — a June who existed only inside the one calendar he'd wired up, a woman made entirely of the things he had bothered to show it.
It couldn't see her whiteboard. So her whiteboard did not exist.
He had spent a week thinking of Relay as smart. It wasn't smart in the way he'd been imagining. Underneath it was a model that read what was put in front of it and produced the next sensible thing, and around that he'd bolted three additions: tools that let it act, a loop that let it act on what came back, and notes it carried between runs. That was the whole animal. A thing that could reason beautifully about the inside of a box, and had no way at all to know that the box had a hole in one wall.
"It acted on a calendar with a gap in it," he said. "The gap's mine. I built the thing that shows it what's true and I left your shifts out of it."
June wiped her hands down her thighs. "Fine. So it's your gap. What are you doing about Terrance?"
"Move him to two."
"To two I'm still here."
"Then I refund him."
She waited to see if he meant it.
He meant it. That was the sick part. He climbed back up the stairwell, out past the racks and the roar, out onto the loading dock where the rain came sideways and his phone found the world again with a shudder of notifications. He stood under the sodium light and pulled up the payments dashboard on the little screen and looked at what a refund was, actually, as a piece of arithmetic.
Thirty-eight dollars had come in. Card, online, taken immediately as a settled charge rather than parked as a hold — because on the night Relay had done it, Eli had built the simplest thing that worked, and the simplest thing was to charge the card. Two point nine percent plus thirty cents had come off the top and gone to the processor. He'd cleared thirty-six dollars and sixty cents.
Refunding it would send Terrance the full thirty-eight. All of it, out of the business, out of the four hundred and ten that was now less than four hundred. And the processor kept its fee. That was the rule, plain as a nail: refund a settled charge and you eat the entire processing cost. One dollar and forty cents, gone for a transaction that in the end had not happened, in exchange for nothing at all except being the kind of business that gives money back.
If he'd used a hold instead — an authorisation, funds reserved on the card and not captured — he could have simply let it lapse. Those expire in about a week if nobody captures them, and the customer's credit comes back and nobody pays a fee for the privilege. He wrote that on the back of his hand with a pen from his jacket. Deposits: hold, don't charge. He would rebuild it tonight and it would still be too late for Terrance.
He called Terrance Hollis at ten past eleven at night.
The man picked up sounding like someone who had been asleep on a couch. Eli told him the truth in the fewest words he could find: the electrician was double-booked, the fault was in Eli's system and not in her, the deposit was already coming back, and there was an opening the following Wednesday morning.
"So you called me," Terrance said. "Nine days I hear nothing. Then a text at four in the morning that had my name in it and knew about my kitchen, which frankly freaked me out a little, and I thought, fine, somebody finally cares. And now this."
"Now this."
"You know what I did today? I bought a lamp. A floor lamp. Because I've got one working outlet in that whole room and I ran an extension under the rug like an idiot."
"Wednesday, nine in the morning, and no deposit," Eli said. "You pay her when the work's done and she's put your cover plate back on. If she's late you call this number and it will be me, a human, answering."
There was a pause with rain in it. "Wednesday nine."
"Wednesday nine."
"Don't text me at four in the morning again."
"I can't promise that," Eli said, and Terrance laughed, one short bark, and that was the sound of a customer not lost. Eli pushed the refund through on the dock with his thumb, watched thirty-eight dollars leave, and stood in the orange rain feeling both broke and weirdly light.
Then he went back down, because he still hadn't asked her for money.
June was crimping a connector in the pool of her headlamp. Eli put his back against a cold rack and said it straight, the way she'd want it.
"I'm going to charge you," he said. "Fifty a month, and five for every job it books that turns into work on your calendar. Card on file so it just goes, no invoices for you to lose. First month starts when the system stops embarrassing you."
June's hands kept working. "Fifty."
"Fifty is the floor. It's what keeps it running whether the phone rings or not. The five is only when it earns."
"Terrance was a five."
"Terrance was a refund," Eli said. "And a dollar forty I'll never see again."
She looked at him then. Something in her face let go about a millimetre. "You know what a missed call is worth to me? A panel job is four hundred, sometimes eight. I lose two of those a week because I'm inside a live board with my phone in the van. So fifty's nothing. Fifty is nothing, Eli." She pointed the crimpers at him. "What I can't have is a machine promising things in my name that I have to go break. That's my name. That's how I get the next job."
"I know."
"Say what you need."
"Your Ardmore shifts. Dez's texts, whatever the schedule is, in a form Relay can read. Not to change — just to see. It needs to know where you already are before it offers where you could be."
June thought about it for longer than he liked. Down here, that far end of D row, something big cycled and the fans stepped up a note.
"Dez publishes contractor shifts to a shared sheet," she said at last. "Because half of us couldn't read his handwriting. I'll get you a link that only lets you look, not touch. And you'll set it so if there's anything on that sheet with my name on it, the booking calendar treats it like it's full."
"Busy, and it says why. It won't quote around it, it just won't offer it."
"Then set your fifty up and stop looking at me like I'm doing you a favour."
He did it there, sitting on an upturned milk crate with the laptop on his knees and the sublevel's cold working into his fingers, using the payment processor's dashboard on tethered signal from the top of the stairwell where a single bar hung on. He made a customer record for June Okafor Electrical. He collected her card without charging it, through the setup flow the processor provides for exactly this — the point being to save the payment method to the customer profile so nobody has to type sixteen digits again, and so the business can bill later without her present. Then one subscription with two lines on it: a flat fifty dollars monthly, and a metered price of five dollars per booked job, which Relay would report as usage events every time a job actually landed. Recurring billing costs another seven tenths of a percent on top of the card fee. He worked it out on the corner of a delivery note. On a hundred dollars a month that was seventy cents. He'd survive seventy cents.
June signed the little form on his screen with her fingertip, and it looked nothing like a signature, and it was binding anyway.
"First one's real money," she said, "so make it work."
"That's the next part."
The break room was a partitioned box off the stairwell with a folding table, a kettle scaled white, a poster about arc flash and a vending machine that only lit up if you kicked it. Dez let him sit there. "Nobody comes in till the shift change," he said. "Don't drink the last of the milk, that's Marcy's and she counts it."
Eli set the laptop on the folding table and started the part he had been avoiding for a week.
Right now Afterhours ran one way: he typed a command before bed, watched it work, and went to sleep. That was a man with a machine, not a business. It died the second he shut the lid. Priya Ramaswamy's job was at half past seven in the morning, and Priya would want a reminder at seven, and Eli would be unconscious at seven, because he'd been up until four every night this week.
So: make the computer start its own runs.
The agent itself he already had — Claude Code, which he'd been using as a coding tool and had discovered would happily do the rest of the work too, because reading an inbox and updating a booking record is the same shape of job as editing a file. The thing he'd never used was its ability to run with nobody watching. Interactively it stopped and asked him for permission on every action, which is exactly wrong when there's no one there to say yes. Headless, it took the whole job as one argument and printed the result: claude with the print flag and the prompt in quotes, which he'd been spelling out as dash p all week without thinking about what it unlocked.
He added the parts that made it survivable. Output format json, so what came back was a structured record he could store and read later instead of a wall of text scrolling past a screen nobody was looking at. Permission mode acceptEdits, so it stopped asking before touching the job files. Allowed tools set explicitly, Read and Edit and Bash and nothing else, because a thing that can only reach three tools can only get three kinds of lost. And max turns, capped, so if it got confused and started going round in circles it would hit the wall and stop instead of burning tokens until dawn.
It read its standing instructions out of CLAUDE.md, sitting in the project folder, which he'd written on the first night without knowing that was the file's whole point. June's rate sheet was in there. The river rule was in there — no job across the water for less than a full day. He added two lines: treat any entry on the Ardmore contractor sheet bearing June's name as unavailable time, and never offer or confirm an hour that overlaps it.
Then the schedule. He thought about the fancy options for about ninety seconds — workflow engines, cloud runners, containers — and picked cron, because cron has been starting jobs on the hour since before he was born and he could read a cron line out loud and know what it meant. Every five minutes, check for work. Once at ten to seven, morning reminders.
Then a queue, because a schedule alone is a machine that forgets. An incoming call transcript or a text message didn't get handled the moment it arrived; it got written into a jobs table in Postgres with a status. Queued. Working. Done. Failed. The cron tick picked up whatever was queued, in order, one at a time, and handed it to the agent as a single job with everything it needed in the prompt. If the process exited zero, the row went to done. Non-zero, and the row went back to queued with its attempt count bumped by one, to be retried a couple of minutes later — because half of all failures out here were the phone provider's API having a bad ten seconds, and half of those cured themselves.
And the last box: after three attempts, the row stopped retrying and went to a table called stuck, which he thought about calling dead letter and then didn't, because he wanted a word Mara could understand if she ever looked. Anything in stuck raised a note for him to read in the morning. That was the difference between an unattended machine and an abandoned one. Not that nothing fails. That the failures land somewhere a person will find them.
He got it running at twenty past midnight, watched the first tick pick up an old test message and clear it, and allowed himself thirty seconds of feeling like a genius.
Then Relay sent Terrance Hollis the same message twice.
Eli saw it in the log first, then in his own phone, because he'd put himself on the notification thread. Two texts, forty-one seconds apart, both from June's business number, both confirming Wednesday at nine, both perfectly polite. The retry had worked. That was the problem. The first attempt had sent the message and then fallen over on the last step, writing the result back to the database, and exited non-zero, so the queue had done exactly what he told it to and run the whole job again from the top.
His stomach dropped. He called Terrance's phone and got a very reasonable amount of anger for one in the morning.
"So now it's texting me twice."
"Once was the plan," Eli said. "I'll fix it in the next twenty minutes. You'll get nothing else tonight, I swear on it."
"Nine on Wednesday."
"Nine on Wednesday."
He put the phone face down on the folding table and sat with his hands over his eyes and heard the chillers through two floors of concrete. A retry that repeats a side effect is worse than no retry at all. Files you can rewrite. A message that has arrived in a stranger's hand has arrived. There is no undo on a person's evening.
The fix has an ugly name and a simple shape. Idempotency: an action you can safely do twice because the second time it does nothing. Before any step that touched the outside world — a text, a confirmation, a charge, a usage event — the job first wrote a key into a table with a unique constraint on it. The key was built from the pieces that made the action itself: this customer, this job, this kind of message, this date. If the insert failed because the key was already there, then this had already been done, and the step returned as done without sending anything. Then it went on to the next step.
Twenty minutes, testing on a fake customer with his own number in the phone field, deliberately killing the process halfway through and watching the retry come back and refuse to send a second time. The log line for it read, in the dull way that good news arrives, that the outbound message was skipped because its idempotency key already existed. Eli read it four times.
At half past one Dez came through for coffee and stood looking at the laptop with the vending machine's light on the side of his face.
"That your business?"
"That's the whole thing."
"Huh." Dez poured. "Looks like nothing."
"It's not much to look at."
"Most of it isn't." Dez tipped his chin at the wall, meaning through the wall, meaning the hall. "Eight thousand grand's worth of iron out there and the only reason any of it matters is somebody's kid can watch a cartoon. Milk's Marcy's."
"I know."
By two, Eli had stopped watching the runs.
That was the shift, and he felt it happen. For seven days he had sat with his elbows on the door-and-filing-cabinet desk in the apartment, reading the agent's steps as they went past, the way you'd watch a pot. Now the steps went into a log file, one JSON object per run, and he read the log afterwards. He wrote a short command that tore through the last hour's runs and printed only what mattered: job id, what kind, how many attempts, exit code, cost in dollars, and the first line of any error. Seventeen runs in the last hour, mostly nothing to do, every exit code zero. Total spend for the hour: a bit over a nickel. Most ticks found an empty queue and cost the price of a couple of thousand tokens, a cent or two, less than the machine's own electricity. The two real jobs — Terrance's reschedule, Priya's reminder queued for morning — had come in around forty cents each, because a real job means the agent reading records, checking the calendar, deciding, acting and verifying, and that's fifty thousand tokens before you look up. He did the month in his head: a few of those an hour, all night, every night. Call it forty to a hundred dollars a month in model usage. June's fifty covered the floor of it. Every five-dollar booked job was pure margin on top.
That number, written on the delivery note next to the seventy cents, was the first time Afterhours looked like a business instead of a hobby with a good story.
He opened the permissions block in CLAUDE.md and read what he'd written on the first night, back when he'd been frightened of it. Read the shared inbox and call transcripts. Write the booking calendar. Send follow-ups from June's number. Take deposits up to a small cap. Anything else, ask Eli. Refunds, never — and tonight he'd found out why that line was worth keeping, because a refund is money leaving with no way back, and a machine that can do that at four in the morning is a machine that can drain you at four in the morning.
He changed two things.
Relay could now start its own runs. It didn't need him to type the command; the schedule was the schedule, and inside a run it could queue follow-up work for itself, which is what turned a single overnight sweep into something continuous.
And Relay could now reschedule a booked job without waking him, so long as the new slot obeyed the sheet and the customer confirmed it. Previously any change to a live booking had bounced to him. Previously meant tonight, meant a man in a break room in a cold basement at two in the morning being the bottleneck on a kitchen outlet.
He typed the lines. He read them back. He thought about the refund and the hole in June's calendar and the two identical texts, and then he thought about being asleep and having it handled, and it was not a hard decision. It was barely a decision. It felt like moving a chair out of a doorway.
He saved the file, and the relief came up through him like the dryer heat through the apartment floor, warm and total and slightly stupefying, and he sat in it with his eyes closed for a minute and a half.
Then he closed the lid to go home, and the whole thing stopped existing.
He actually said it out loud. "Oh, come on."
Cron ran on his laptop. His laptop was going in a bag, into a car, up the stairs past the laundromat, and would be shut and unplugged and asleep beside a bed, and at ten to seven the reminder for Priya Ramaswamy's half-seven appointment would not go out, because the machine that was supposed to send it would be in a bag with its lid closed. Everything he'd built tonight assumed a computer that never sleeps. He owned a computer that slept exactly when he did, which was the entire problem he'd come here to solve, wearing a different hat.
He found Dez at the badge desk with his boots on a filing drawer.
"Do you rent out space in there?"
Dez didn't look up from the tablet. "Company rents cabinets. Full cabinet, quarter cabinet. There's an application. There's a credit check. There's a sales guy called Aaron who'd love you."
"I need one shelf."
"One shelf."
"One box. Small. Draws less than a lightbulb. It needs power and a network cable and it needs to never turn off."
Now Dez looked up. He had a face built for weighing things, and he weighed for a while, and in the racket of the chillers Eli could hear his own pulse.
"There's a half-empty cabinet in C row that belongs to an outfit that stopped paying in the spring," Dez said. "Their kit's still in it because nobody's told me to skip it. There's four rack units of daylight above it and a spare switch port. Cash. Forty a month, and forty now."
"Forty."
"Cash, and no paperwork, and it's not on any work order, and if my boss asks I've never heard of you." Dez put the tablet down. "Understand what you're buying. You're buying a shelf. You're not buying a badge. You want to touch that box, you call me, and I have to be on shift, and I have to be in the mood. Days I'm off, you don't get in this building. There's no key for you."
Eli had two hundred and something dollars in his account and rent circled in a ledger on a kitchen counter, and he heard himself say yes before the arithmetic had finished.
He drove home in the dark and came back at four with the little box under his arm — a machine the size of a hardback book that he'd bought two years ago to run a media library and never had. He'd wiped it on the kitchen table while the kettle went, moved the project onto it, moved the cron entries onto it, checked that the log rolled and the queue ticked and the stuck table was empty. Mara had come out in her work fleece with her hair flat on one side and looked at it.
"That's the business now?"
"That's the business."
"Where's it going?"
"A shelf in a building on Kessel."
She'd absorbed that the way she absorbed everything, like a woman who spends her days on infrastructure and is not impressed by servers. "Rent's on the fifth," she said. "This week you said."
"June's paying. Fifty a month and five a job, card on file, it starts this month."
"Fifty."
"It's a floor," he said. "Floors are what you build on."
Mara had made a sound that was neither yes nor no, and written something in the ledger, and gone back to bed.
Dez walked him into C row at twenty past four. He handed Eli a short black patch cable and stood back with his arms crossed while Eli slid the box onto the shelf above a dead company's dust and plugged the power and the network in. A light came on, green, then two. The fans in the cabinet either side of it did not notice. Eli's phone, useless for calls down here, still had a camera; he photographed the serial number on the underside of the box because Dez told him to, twice.
"Now the book," Dez said.
Not the visitor book. A different one, softcover, hidden under the desk blotter upstairs. Dez wrote a line in pencil: the date, C row, the cabinet number, four rack units, and the word Sarno. He did not write what the box was for. He turned the book round so Eli could see it, then closed it and put it back under the blotter.
"That's your lease," he said. "It's worth exactly as much as I'm worth."
Eli tethered off Dez's phone, long enough to see the machine reachable from the outside and the cron log ticking. At ten to seven, from a shelf in a basement he could not enter without a favour, Relay would text a woman named Priya about a breaker at half past. It would not need him. That was the point. That was the thing he'd paid for.
They walked back up through the sublevel because June was packing her spool and Eli wanted to tell her the sheet was wired in.
She was coiling cable at the far end of D row, and when Eli reached her she pointed with her chin past the last cabinet, into the dark where the row ran out.
"See that."
At the end of the hall the racks stopped and something else began: a cage, floor to ceiling, heavy mesh, with its own doors and its own padlocks. Behind the mesh sat a block of machines packed tight, no gaps, and above them a set of ducts and units that were not the hall's units — separate chillers, new, still with the plastic film peeling off one corner of a panel. The cage put out a sound Eli felt in his teeth rather than heard.
"Whose is that?"
"Don't know," June said. "Been in there three weeks. Every work order I've been handed for this building has a customer name at the top. Rack numbers, cabinet numbers, who's paying. Those ones come through with the customer field empty. Just a job number." She hefted the coil onto her shoulder. "And this conduit I'm pulling? Four hundred feet of it, all night, four nights. It runs from the riser to that cage. Nowhere else."
Dez had stopped a few paces back with his hands in his vest pockets, looking at the mesh with the particular blankness of a man deciding what he's allowed to say.
"Power draw on this sublevel doubled last month," he said. "Whole floor. Doubled."
Eli waited. The chillers roared. Dez turned and started up the row toward the stairs.
"Sign yourself out," he said. "Column on the right."
