Cover of First-Class

First-Class

First-Class

Building for humans and agents alike

A tool a human can drive alone and an agent can drive alone, across the same surface.

  • About 48 minutes, reads in one sitting
  • 12 chapters
  • Intermediate, aimed at people who build and ship developer tools

Most tools are built for humans, and then an agent gets bolted on the side. A second API, a flag, a special mode that does half of what the real product does. This book says that is backwards. First-class means a human drives the tool alone, an agent drives the tool alone, the same commands both ways, with neither one the special case the other gets translated into.

It is the short, stubborn book of 0xLeif's four-book set, and the one the others are arguing for. It comes from building, not theory: small Swift libraries and developer tools, the ones that aged well because the core was clean enough that anything could call it. It is short on purpose. Read it in one sitting.

When a human had to type every line, writing the code was slow, and the slowness was doing a hidden job.

Read this if

  • For you if you build CLI tools or developer tooling and an agent is going to drive them soon.
  • For you if you are bolting an agent onto a human-first tool and watching it choke.
  • For you if you want a clear definition of what first-class for both actually requires.
  • For you if you think about where the human goes once agents write most of the code.

What you take away

  • The four things a tool needs so an agent is a real user: structured output, discoverable commands, errors that guide the next step, non-interactive and deterministic runs.
  • Why building for both is not double the work: one core, exposed twice, with no new logic to get correct.
  • The heuristic for order: hard novel core, build it first and expose it after; straightforward core, design for both from the first commit.
  • How specs act as the contract between human and agent, and how spec-sync keeps code and spec honest in CI.
  • Why risk should stay static and deterministic while confidence should come live from the agent that did the work.
  • Why code got cheap, trust got scarce, and what that does to review, testing, and the human's job.

A sample

Start reading

The opening, free. The whole book is free too, this is just where to begin.

Introduction

This is the short, stubborn book of the four, and the one the others are really arguing for.

Most tools are built for humans, and then an agent gets bolted on the side: a second API, a flag, a special mode that does half of what the real product does. I think that is backwards. The claim here is simple. A tool should be first-class for both. A human should be able to drive it without an agent, and an agent should be able to drive it without a human, across the same surface, with no second-class door.

I came to this from building, not from theory. I make small Swift libraries and developer tools, and the ones that aged well were the ones where the core was clean enough that anything could call it. When agents showed up, those tools were already ready. The ones that were not are the ones I keep apologizing for.

If the Field Guide is the method, and Building Agents and Open Source Tooling are the evidence, this is the thesis they all serve. You do not need the other three to use this one. It is here to change how you look at the next tool you build or pick: ask whether it treats a human and an agent as the same kind of citizen, and watch how much follows from the answer.

It is short on purpose. Read it in one sitting.

Both citizens

A lot of my tooling comes from one idea: humans and agents are going to use the same tools.

So here's the definition the whole book runs on, up front and plain: first-class means a human drives the tool alone, an agent drives the tool alone, the same commands both ways. Not two products. One tool, two kinds of user, neither one the special case the other gets translated into.

When I say first-class, I mean it the way a programmer means it: a real, supported participant the tool was actually built for, not a guest it tolerates. Not a flight upgrade. A first-class user is one the tool was designed around, with a real way in. Not one that has to be translated into somebody else's shape first.

There can be agent-first tools, built only for agents. There can be human-first tools, built only for people. The interesting case, the one almost nobody is building for, is the tool that's both at once. That's what I mean by first-class for both, and what the rest of the book means too. It's a stricter thing than agent-first: agent-first only has to serve the agent, while first-class-for-both has to serve a person and an agent across the same surface without either side getting a worse version. Right now we mostly have human-first projects and we're bringing agents into them. The agent shows up late, to a tool that was built for somebody else, and we hope it figures the thing out.

What we actually need is human-and-agent-first projects. Built that way from the start.

"Human-first with agents bolted on" is the default because it's the path of least resistance. You already have the tool, it already works for you, and when an agent comes along the easy move is to wrap a little glue around the thing you've got. It works, kind of. You took a tool that was designed around a human's eyes and a human's hands and you asked a process with neither to pretend it had both. What that costs an agent (the hang on a prompt, the output it can't read, the relearning every run) gets its own chapter later. Here it's enough to say the agent ends up papering over a gap on every line that assumed a human.

So flip the assumption. Build the tool so it works first-class either way. That's the definition from the top, restated as a build instruction: you don't have a real product and an "API mode" stapled on the side, and you don't have a CLI and a separate agent shim that drifts out of sync the first time you change anything. Both are real users. Both are supposed to be there.

And here's the part that matters most to me. When the agent is a first-class user, the tool can actually help it, instead of making it guess at all the commands and how things work. A human can muddle through a confusing tool. They'll read the README, try a thing, read the error, try another thing, ask a coworker. An agent muddling through is just expensive guessing. A tool that was built for the agent tells it what's possible, hands it output it can use directly, and fails in a way that says what to do next.

This is the same tool humans want. Discoverable commands, output you can trust, errors that tell you what went wrong. The agent just can't paper over the gaps the way a human can, so building for the agent forces you to close them. Designing for both makes the software better.

People hear "build for agents too" and assume it means two products, or a compromise where each side gets a worse version of what it wanted. It's one good core with a step where you expose it to both. That's not double the work, and the next chapter shows why.

The reason I keep coming back to this is that the agents are only going to do more over time, not less. Today they fumble through human tools. Tomorrow they're doing a real share of the work, and the share goes up. If the tools we build now assume a human is always there to handle the prompt, read the screen, click the button, we're building a future on top of an assumption that's getting falser every month.

There's a bigger version of this argument too. We've had a decade of code written entirely by humans, and now AI is writing code on top of all of it, and at some point that mix tips. The tools are what decide whether that goes well or badly. That's a whole chapter on its own: the bridge.

For now the claim is just this: humans and agents will use the same tools. So build them for both, as equal first-class citizens, from the start.

A simulated panel

What the panel said

Every review below was written by an AI model role-playing a reader, 15 of them across three models. No human has reviewed this one yet, and we are not going to pretend otherwise. The model that actually wrote each review is on the card.

Human reviews

From actual people

This space is for real readers. It is empty on purpose. The panel above is a simulation, and calling it anything else would break the one rule these books are built on. Real reviews land here as people send them.

No human reviews yet. They show up here as real readers share feedback.