ykononov.com / Vibe coding from scratch: bb, Claude Code, Codex, and OpenCode / Module 03
How to install Claude Code, Codex, and OpenCode on any OS
Claude Code, Codex, and OpenCode: installing, signing in, and checking that it all works.
Each agent installs with a single terminal command; you then start it and sign in to your account through the browser. Claude Code: curl -fsSL https://claude.ai/install.sh | bash. Codex: curl -fsSL https://chatgpt.com/codex/install.sh | sh. OpenCode: curl -fsSL https://opencode.ai/v2/install | bash. On Windows, install Git for Windows first.
Why the agents come first
bb doesn’t ship with any agents. It finds the ones already installed on your computer and uses their existing sign-in. So the order is agents first, then bb. If you do it the other way around, nothing breaks. The agent list in bb will just be empty until you come back to this module.
Install the ones you have access to. One is enough to keep going, and you can add the others at any time.
Setup is the same three things for every agent: paste the install command, start the agent, and sign in through the browser. Allow about five minutes per agent.
winget install --id Git.Git -e
git --version.sudo apt install git curl.Claude Code
You need a Claude Pro subscription or higher. If you don’t have one, skip this step.
- Paste the install command into the terminal and wait for it to finish.
curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://claude.ai/install.sh | bash
- Close the terminal and open a new one so the system picks up the newly installed program.
- Start the agent:
claude
- On first launch it asks you to choose a theme and sign in. Pick the option to sign in with your Claude account: your browser opens, you approve access there, and then you return to the terminal.
- When you see a box for typing a message, the installation is done. Type
hello, make sure the agent replies, and quit with the/exitcommand.
claude doctor command checks the installation and tells you what to fix. The most common problem is a “command not found” message for claude right after installing. Opening a new terminal window almost always fixes it.Codex
You need a ChatGPT account, and for serious work, the Plus plan or higher.
- Install it:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
curl -fsSL https://chatgpt.com/codex/install.sh | sh
- Open a new terminal window and run:
codex
- Choose Sign in with ChatGPT and confirm the sign-in in your browser.
- Say hello to the agent, make sure it replies, and close it by pressing Ctrl + C twice.
codex doctor.OpenCode
OpenCode is an open-source agent that isn’t tied to any one company. It’s useful for two reasons: it works with models from a range of model providers, and it offers a set of free models so you can try it without a subscription.
- Install it:
curl -fsSL https://opencode.ai/v2/install | bash
curl -fsSL https://opencode.ai/v2/install | bash
There’s no one-command installer for Windows. The route that works goes through npm: first install Node.js (the LTS version from nodejs.org), then open a new PowerShell window and run:
npm install -g @opencode/cli
- Open a new terminal window and run:
opencode
- Type
/connectand choose where the models come from: OpenCode’s free ones, the OpenCode Go plan, or your ChatGPT or GitHub Copilot subscription. - Type
/modelsand pick a model. The free ones are marked Free. - Ask any question, make sure the agent replies, and quit.
Free models
As of late November 2026, OpenCode lists about ten free models. The most notable:
| Model | What it is |
|---|---|
| DeepSeek V4.1 Flash Free | A fast model from the Chinese company DeepSeek. A good choice for small edits and for reviewing another agent’s code |
| Big Pickle | The model OpenCode offers by default |
| MiMo-V2.6-Flash Free | A fast model from Xiaomi |
| Nemotron 3.5 Free | Nvidia’s models, including a variant that understands images |
The same models will show up in bb once you select the opencode agent in the prompt box. Three caveats. They’re free “for a limited time”: the list changes, and a model can disappear or start costing money. Some free models are unavailable in certain countries. And the model provider may use what you send to a free model to improve it, so don’t send anything you wouldn’t want someone else to see.
opencode-ai package. That’s version 1; don’t install it. I’ve checked the version 2 installation on Windows only against the documentation, not hands-on. One last thing: the website says the free models work without an account, while the documentation says you need an OpenCode Console account. If /connect asks you to sign up, that’s expected.If OpenCode doesn’t install on the first try, don’t spend your evening on it. It plays a supporting role in this course, and you can come back to it later.
Checking your work
Before installing bb, let’s make sure the agents are in place. Open a new terminal window and run the commands for the agents you installed, one at a time. Each should reply with a version number.
claude --version
codex --version
opencode --version
If you see “command not found” or “is not recognized” instead of a version, that agent’s installation didn’t finish. Go back to its step and run the install command again. You can also paste the whole error message into a regular chatbot and ask what to do. Chatbots are still very good at that.
- At least one agent replies with a version number
- I started that agent and signed in through the browser
- The agent answered my “hello” in the terminal
- Windows: Git for Windows is installed
Review questions
Why do you install the agents before bb?
bb finds agents that are already installed and uses their existing sign-in. bb doesn’t ship with agents and doesn’t sign in to accounts for you. One installed agent is enough; you can add the others later.
What do you have to do with each agent after installing it?
Start it in the terminal and sign in to your account through the browser. You sign in once, in the terminal. If you skip this step, the agent shows up in bb’s list, but the very first conversation ends with an authentication error.
Right after installation, the terminal says the claude command isn’t found. What do you do first?
Open a new terminal window and run the command again. A terminal window that was already open doesn’t know about a program you just installed. Most of the time, opening a new one is all it takes.
What do you need to install on Windows before anything else?
Git for Windows. The native version of bb doesn’t work without Git for Windows, and the agents use it to run commands.
This page covers a single module. The interactive version of the course has steps, quizzes, and checklists that save your progress.
Open this module in the course →By Yury Kononov, Chief Technology Officer. The course is free and licensed under CC BY 4.0. Updated 2026-11-28. Contact the author: @ykononov.