Build Your Own Stuff › Chapter 2

Put an AI agent on it.

A chatbot writes you code and you copy-paste it somewhere. An agent lives on the server, opens the files itself, runs the commands itself, sees the error itself, and fixes it. That difference is the entire ballgame.

Why this is different from what you've used

If your AI experience so far is a chat window, you have been playing with one arm tied behind your back. The chat window can't see your files. It can't run anything. It guesses at what your setup looks like, hands you a block of code, and you paste it in and it doesn't work because it guessed wrong, and you paste the error back in, and around you go.

An agent closes that loop. Claude Code runs in the terminal on your server. It reads your actual files. It runs the actual command. It sees the actual error message and fixes it, and then runs it again to check. You describe the outcome you want in plain English and it does the loop until the thing works.

A chatbot loop versus an agent loop With a chatbot, you are the one who carries every step: you copy the code out, run it yourself, read the error yourself, and paste it back. With an agent, it writes, runs, reads the error and fixes it on its own, and only comes back to you when the thing works. CHATBOT — YOU ARE THE LOOP It writes code in a chat window YOU copy it, paste it, run it YOU read the error, paste it back ↻ around and around It never sees your actual setup AGENT — IT IS THE LOOP You describe the outcome It opens the real files · runs it It sees the real error · fixes it ✓ it comes back when it works You are out of the loop, on purpose
The difference isn't that the agent is smarter. It's that it closes its own loop. You stop being the courier who ferries errors back and forth.

I want to be blunt about what this makes possible, because it sounds like hype and it isn't: I do not write code. Not a line. Everything I run — the monitoring, the client sites, the daily podcast pipeline that publishes at four in the morning without me — was built by describing what I wanted, checking the result, and asking for changes. The skill is not programming. The skill is knowing what you want and being able to tell when you didn't get it.

Install it

SSH into your server (chapter one), then run this:

# install it
curl -fsSL https://claude.ai/install.sh | bash

# start it
claude

The first time it starts, it'll ask you to log in. You have two options, and the choice matters:

OptionHow it billsBest for
Claude subscription
(Pro or Max)
Flat monthly fee. Generous usage limits, and when you hit them you wait rather than pay more. Almost everyone. Predictable, and you never get a surprise bill. This is what I use for building.
API key
(pay as you go)
Per million words in and out. No ceiling unless you set one. Automated things that run without you watching. Covered properly in chapter four.

Start with the subscription. Log in, and you're talking to an agent that is standing inside your server.

Your first hour

Don't build anything yet. Spend an hour letting it show you around. Type these, literally, one at a time:

Those four prompts do the entire chapter-one security checklist, and you learn what each thing is while it happens. That's the pattern for everything from here on: describe the outcome, ask it to explain as it goes.

Add this sentence to everything

"Explain what you're doing in plain English as you go, and tell me what could break." It costs you nothing and it converts every task from a black box into a lesson. Six months of this and you will understand your own infrastructure better than you expect.

Three habits that make it dramatically better

1. Use git, even for junk

Git is a time machine for your files. Every time the agent changes something, git remembers the version before. When you break something at midnight — and you will — git is the difference between "roll it back, thirty seconds" and "the whole evening is gone."

You don't need to learn git. You need to say "commit this before you start" and "undo the last change" and let the agent drive. But have it on from day one.

2. Run it inside tmux

Normally, if your SSH connection drops, whatever was running dies with it. tmux keeps the session alive on the server, so you can close your laptop mid-task, walk away, reconnect later, and it's still going. Install it (apt install tmux), start a session with tmux new -s work, and reconnect with tmux attach -t work. Small thing, enormous quality-of-life gain.

3. Ask for the boring stuff too

The agent is just as happy to write your backup script, your monitoring alert, and your documentation as it is to build the exciting feature. The boring stuff is what keeps the exciting stuff alive. I learned this the hard way, which is the only way anyone learns it.

The one thing that will annoy you

By default, the agent stops and asks permission before running commands. This is correct and good — you do not want an AI running delete everything because it misunderstood you. But after the fortieth time it asks whether it may please be allowed to list the files in a folder, you will start clicking "yes" without reading, and that is the exact moment safety turns into theater.

The fix is not to turn permissions off. The fix is to tell it precisely which commands are safe to run without asking — read a file, list a directory, check status — while still stopping for anything that deletes, sends, or spends money.

That's the next chapter, and it's the most valuable one in this guide.

← Chapter 1: Get a server Next: Teach it how you work →