Skip to content
minimachine.
← The path
Step 06 · Foundations Easy · 12 min

🤖Installing the agent (very early)

Claude Code or OpenCode, in five minutes. The trick: install it now, so it configures the rest of the machine for you.


Here’s the least intuitive secret of this whole journey: you install the code agent before everything else.

Most tutorials have you configure the machine for three hours, network, firewall, services, then install the AI at the end, like a reward. We do the opposite. You set up the agent now, while the system is still bare, and it’s the agent that will help you hook up Tailscale, Cloudflare, Ollama and the whole shebang. You go from “I’m typing commands I don’t understand” to “I describe what I want, I review, I approve.”

Claude Code or OpenCode: which one?

Both are excellent command-line code agents. They read your project, write files, run commands, and loop until it works. These are the two this guide follows at parity : but they’re not the only ones. The difference between them fits in one sentence:

  • Claude Code : Anthropic’s agent. You plug into the Claude models (the best on the market for code in 2026). Ultra-simple setup, top reliability on long tasks. Paid (subscription or API).
  • OpenCode : the open-source agent. Same spirit, but you choose your engine: Claude, GPT, or a local model via Ollama. Perfect if you want 100% local or to juggle providers.

And if you want to explore more widely, the landscape is rich in 2026, they all work on the same principle (read, write, run, loop):

  • Gemini CLI : Google’s command-line agent, plugged into the Gemini models. Generous free usage.
  • Codex CLI : OpenAI’s agent, backed by the GPT models.
  • Aider : a much-loved open-source agent, built around git (every change = a clean commit), compatible with just about any model, local ones included.
  • Cline / Roo Code : agents that live inside VS Code rather than in the terminal, if you’d rather stay in your editor.
  • Cursor, Windsurf : full code editors, built around AI, for anyone who wants an all-in-one experience.

The common prerequisite: Node and a clean terminal

Both agents run on Node.js. We install it cleanly with nvm (version manager) rather than with the system package, to avoid permission headaches.

# Install nvm (Node version manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# Reload your shell (or close/reopen the terminal)
source ~/.bashrc
# Install the latest Node LTS
nvm install --lts
node -v   # should show v22.x or newer

Install and launch

The CLI installs with npm, globally:

npm install -g @anthropic-ai/claude-code

Launch it from any folder:

claude

On first launch, it opens your browser to log you in (Anthropic account, Pro/Max subscription, or API key). Once authenticated, you’re inside the agent. Type a request in plain language and watch it work.

Your first real move: have it configure the machine

This is where the magic happens. Rather than chaining system commands yourself, you ask. Here’s a first concrete mission, to copy almost verbatim once into the agent:

Describe the goal, not the commands

In the agent, write something like:

“We’re on a brand-new Ubuntu 24.04. I want you to help me finish the basic config: automatic security updates, a ufw firewall that lets only SSH through, and zram for swap. Explain each step before running it, and don’t run anything with sudo without showing me the command first.”

Review the plan before approving

The agent will propose a plan and commands. Read them. That’s the heart of the craft: you no longer type, you review. If a command looks fishy, ask “why that one?” before accepting.

Let it execute, keep your hand on the wheel

You approve step by step. On an error, the agent reads the message, understands, and fixes it. You’ve just configured your machine by chatting.

Lay the foundations of memory right away

Before you leave, create the file the agent will read at every session: a CLAUDE.md (Claude Code) or AGENTS.md (OpenCode) at the root of your project. Two lines are enough to start, we dig into the topic in Memory files.

cd ~/mon-projet
cat > CLAUDE.md <<'EOF'
# Machine context
- Mini-PC Ubuntu 24.04, use: personal dev workshop.
- Always show sudo commands before running them.
- No secret in plain text in the code.
EOF