Start With OpenCode: Set It Up, Change One Line, and Undo It | Heidelberg AI Curriculum
T08-L01
Start With OpenCode: Set It Up, Change One Line, and Undo It
Step by step, with a screenshot for every step: install OpenCode Desktop, pick a free model, have it explain a small page, change one line, see exactly what changed and take it back.
A colleague left you a small search page. In the lab it finds reagents; in a company it finds stock. It only matches the start of a name, so "buffer" finds nothing, although Tris buffer and HEPES buffer are on the list.
The fix is one line. In this book you set up OpenCode and let it find, change and undo that line, one step and one screenshot at a time. You are at Level 1 User: you work on your own copy, so only you are affected if something goes wrong.
After this you can
Install OpenCode Desktop, open a project folder and choose a free model that keeps no copy of your prompts.
Set up the safety net (Git) so that Undo really restores your files.
Use Plan to have OpenCode explain code without changing it, and Build to make one narrow change.
Read the change in the Review panel and check it against a before-and-after table.
A Windows or Mac computer you may install software on. If IT controls installs on your work computer, ask them to install OpenCode and Git.
Notepad or TextEdit, and a web browser.
About 75 minutes: 15 to read, 60 to do. Steps 1 to 6 take 20 minutes, once.
Last verified 25 September 2026. OpenCode Desktop is free, and so are its built-in models. The default one, Space Bunny Free, keeps none of your prompts. Most other free models may use them for training. All of them run in the US. Details for experts at the end of this book.
The idea in one page
OpenCode works in one folder. Unlike a chat assistant, it opens, changes and runs the files in the folder you give it. It asks before it touches anything outside that folder.
Plan explains, Build changes. In Plan, OpenCode can only read. Ask there first, then switch to Build for the change.
The Review panel shows what really changed: removed lines in red, added lines in green. Trust it more than OpenCode's own summary.
Git is the way back. It's a free program that keeps saved versions of a folder. OpenCode's Undo needs it, and it has to be in the folder OpenCode first opens it. Step 8 shows how.
before
Ask narrowly: the file, what happens now, what you want instead (with one example) and what must stay the same.
Watch it once (2 minutes)
The pointer shows every button this book uses, in the order you'll use them. It was recorded live with the free model and the same made-up page.
Step 1: Install OpenCode Desktop. Go to opencode.ai/download and choose Desktop. Windows: pick x64 (almost every PC). Mac: pick Apple silicon, or Intel if Apple menu → About This Mac names an Intel processor. Run the download and start OpenCode.
You should see: the home screen with Projects on the left.
Step 2: Make your OpenCode folder and add it. In File Explorer (Windows) or Finder (Mac), create a folder OpenCode in Documents. In OpenCode, click the folder icon with a plus next to Projects, choose the new folder and confirm.
You should see:OpenCode in the Projects list. (This picture is from later, when a second project has been added.) This folder is your workbench: you'll keep every project inside it and use it only to prepare them.
Step 3: Start a session on the workbench. Click OpenCode in the Projects list, then New session at the top right. A session is one conversation about one project.
You should see: a large message box, with OpenCode named below it.
Step 4: Choose the free model. Click the model name under the message box and choose Space Bunny.
You should see:Space Bunny Free under the message box. It keeps none of your prompts; stay with it.
Step 5: Turn on the Plan/Build switch. Press Ctrl+, (Cmd+, on a Mac) to open Settings. Under Preferences, turn on Show agent. Leave Auto-accept permissions off. Click Back to app.
You should see:Build with a small arrow under the message box. Click it to switch to Plan; Ctrl+. does the same.
Step 6: Learn the eight parts of the screen.
Home: projects and sessions (Ctrl+B).
Session tab: one per open session. Closing it doesn't delete the session.
⋯: rename, export or delete the session.
Review panel (Ctrl+Shift+R).
Message box: Enter sends, Shift+Enter adds a line.
+: attach a file or a picture.
Mode: Plan or Build.
Model.
On a Mac, use Cmd wherever this book says Ctrl. Grey lines such as Used 1 Read only list what OpenCode did; you can let them pass.
Worked example: fix the reagent finder, step by step
"When I search 'buffer', I want Tris buffer and HEPES buffer instead of 'Nothing found'. Everything else stays as it is."
Choose tools
OpenCode with Space Bunny, Plan and Build, Git for Undo, the Review panel and your browser. That's all this change needs.
Build it: prepare the project
Step 8: Create the page. Inside your OpenCode folder, create a folder reagent-finder. In Notepad or TextEdit, paste the text below and save it there as index.html. In Notepad, set Save as type to All files; in TextEdit, choose Format → Make Plain Text first.
You should see: double-click the file and your browser shows Reagent finder with four reagents. If Windows opens it as text, the name ends in .txt: in File Explorer's View menu, turn on File name extensions and rename it.
Step 9: Set up Git from the workbench. Go to your OpenCode workbench session (not a reagent-finder one), check the mode says Build, and send:
Set up Git in the folder reagent-finder so changes there can be tracked and undone:
create a Git repository inside reagent-finder and save its current files as the first version.
Do not change any file.
You should see: "Initialized a Git repository in reagent-finder", within half a minute. If it says Git isn't installed: on Windows, install Git for Windows from git-scm.com with its default choices; on a Mac, click Install when macOS offers the command line developer tools. Restart the computer, then repeat this step.
Step 10: Open reagent-finder as its own project. Add the reagent-finder folder with the folder-and-plus icon (as in step 2). Click it in Projects, then New session.
You should see: a branch label such as master or main under the message box. That means Undo will work.
If you see No Git instead: Undo won't restore files here. Go to the first item in What goes wrong.
Understand it
Step 11: Ask for an explanation in Plan. Switch the mode to Plan and send:
Read index.html. Don't change anything yet.
Explain in plain English, pointing to the exact lines:
1. where the page reads what I type,
2. which line decides whether an item is shown,
3. where it writes the result.
Then tell me why searching "buffer" finds nothing.
You should see: an answer within seconds that points to the line with startsWith, meaning "the name begins with what I typed". Your wording will differ. To check it, search the file for startsWith with Ctrl+F in your text editor.
Mia also notices that an empty search box shows every item. She adds to her sentence: keep that, the order and the Nothing-found message.
Build it: make and check the change
Step 12: Ask for the narrow change in Build. Switch the mode to Build and send:
Change index.html so the search finds the text anywhere in the name,
not only at the start. "buffer" must find R01 and R04.
Change only the line that decides whether an item is shown.
Keep the item list, the order, the "Nothing found." message and the
show-everything-when-empty behaviour exactly as they are.
Show me the changed line.
You should see: a reply showing one changed line with includes, meaning "the name contains what I typed". Build edits files in the project without asking first.
Step 13: Read the change in the Review panel. Click the rightmost icon at the top right of the session.
You should see:Files Changed 1 and +1 −1, with line 25 in red (before) and green (after). If more lines changed, ask: "Why did you change these other lines? Revert everything except the matching rule."
Step 14: Check before and after. Reload the page in your browser and fill in the last column.
You type
Before
After
tris
R01
R01
buffer
Nothing found
R01, R04
BUFFER
Nothing found
R01, R04
(empty box)
all four
all four
R01
Nothing found
Nothing found
You should see: "buffer" now finds both buffers, and the last two rows haven't changed.
Step 15: Undo. Press Ctrl+P, type undo and press Enter on Undo.
You should see: your request back in the message box, and "buffer" finds nothing again after a reload. Close and reopen the Review panel: it now says No file changes yet.
Step 16: Redo. Press Ctrl+P, type redo and choose Redo.
You should see: after a reload, "buffer" finds both buffers again.
What it taught Mia: three lines were enough to judge the change, and the empty-box row protected a behaviour she'd almost forgotten.
Company: the product finder
Jonas runs a stockroom. His page lists four products, and "mug" finds only "Mug lid, blue". He does steps 7 to 16 with a folder product-finder and these four lines in place of the reagents:
One session per task. Start a new one with New session or Ctrl+Shift+S; long sessions get slow and vague.
Point at a file by typing @ and part of its name.
Answer permission questions. Before OpenCode goes outside the project folder, it asks. Allow once if you expected it; Deny if you didn't, then ask why.
Undo leaves the file changed.Symptom: after Undo the page still behaves the new way; a new session shows No Git. Fix: OpenCode opened the folder before it had Git. Change the line back (or ask Build to). Copy the folder inside OpenCode under a new name, set up Git in the copy (step 9) and add the copy as a project (step 10). To remove the old one, open Settings → Projects, click ⋯ and choose Close.
The Review panel is empty or out of date.Symptom: it only says Track, review, and undo changes in this project, or still shows an undone change. Fix: empty means no Git (see above); out of date means close and reopen it.
Plan refuses to change the file.
Fix: that's Plan doing its job ("switch agents" means switch the mode). Switch to Build and send "Go ahead and make that change now."
Asking for "better".Symptom: "Improve the search" returns a rewritten page. Fix: name the file, one example, the expected result and what must stay the same.
Trusting the reply instead of the Review panel.Symptom: the reply says "only line 25", the panel shows +7 −3. Fix: ask why each extra line changed and have it revert them.
Checking the old page.Symptom: the change "didn't work". Fix: reload the page, and make sure it's the file from the project folder.
Use a small page or script of your own that almost does what you want, or change the reagent finder to search the shelf as well as the name.
Set up (20 min, first time only): steps 1 to 6.
Structure it (5 min):"When I ___, I want ___ instead of ___."
Choose tools and prepare (10 min): put the file in a new folder inside OpenCode, then steps 9 and 10. Write your before-and-after table with five inputs, one of which must not change.
Understand it (10 min): step 11 with your file.
Build it (15 min): steps 12 to 16.
Exit check
What you hand in: your before-and-after table of five inputs, a screenshot of the Review panel showing the change (Windows+Shift+S, or Cmd+Shift+4 on a Mac), and one sentence on how you undid and redid it.
It passes when all five results match, including the one that must not change, the Review panel shows only the line you asked for, and Undo brought the old behaviour back.
Rule to remember
Explain in Plan, change in Build, read the Review panel, and keep Git as the way back.
Details for experts
Checked on 25 September 2026. You don't need this to follow the book; it's for setting things up or answering a colleague.
What
Details
What it means for you
Version
OpenCode Desktop 2.0.16 on Windows 11. It updates itself. Downloads exist for Windows, macOS and Linux.
Older 1.x versions look different: the Plan/Build switch was always visible, and Undo was typed as /undo.
Free models
Eight free models run on OpenCode Zen, OpenCode's own service in the US. Space Bunny Free keeps no copy of prompts and isn't trained on them. The NVIDIA Nemotron models don't link what you send to you. Others, such as Big Pickle, MiMo and Muse Spark, may learn from your prompts while they're free.
Space Bunny is the safest free choice, and it still sends everything to a US service: send only made-up or approved data. Free models can disappear or change without notice.
Permissions
Inside the project folder most actions are allowed. Reaching outside it asks first. Allow always lasts for the current session. Files named .env, where programs often keep passwords, are blocked.
Found through Ctrl+P; no shortcut of their own. Before each change OpenCode saves a hidden copy of the files, and it needs Git to do that.
No Git, no restored files. Settings → Shortcuts lets you give Undo a key.
Why Git comes first
The Desktop app starts a helper program that keeps running after you close the window. It checks a folder for Git the first time it opens it and keeps the answer until the computer restarts.
That's why the workbench sets up Git before you open a new folder.
Shortcuts
Ctrl+B home, Ctrl+Shift+S new session, Ctrl+. Plan/Build, Ctrl+' model, Ctrl+Shift+R Review panel, Ctrl+U attach, Ctrl+` terminal. Cmd on a Mac.
The terminal is a window for typed commands; you don't need it at Level 1.
Next steps
/init writes a short project description into AGENTS.md, which OpenCode reads at the start of every session. The model list also connects paid models or your institute's own model (Custom OpenAI-compatible provider).
Use a terminal, desktop app, or IDE extension to work with coding agents.
Before choosing
Bring your own provider access and monitor its token usage.
Watch and read
Learn 80% of OpenCode Desktop in 20 Minutes! | Full Beginner Tutorial
Learn 80% of OpenCode Desktop in 20 Minutes! | Full Beginner TutorialThanh-y David Nguyen
T08-L01: Follow a beginner's tour of OpenCode Desktop setup, model selection and Plan/Build before making your first small change. Undo/Redo coverage and current free-model terms are not established.
The FBI just arrested an OpenAI engineer for spying...
The FBI just arrested an OpenAI engineer for spying...Video · Fireship · Oct 14, 2026
Fireship reports that the FBI arrested Abdul Raman Alphazan, a 35-year-old Saudi national and OpenAI engineering lead on the Agents platform, for allegedly bugging the company's executive conference room. According to the criminal complaint, Alphazan used an internal agent to research meeting rooms and capacities, then between September 24 and 30 used his wife's ChatGPT account to learn how to build a Wi-Fi-enabled audio recording device with an encrypted SD card from a $23 Seed Studio microcontroller. He concealed it in toilet paper and plugged it into a USB port behind the TV in the conference room on September 28. OpenAI's technical surveillance countermeasures team found it after about 48 hours; OpenAI says it used its own models to analyze the device, and investigators matched a MAC address to the wife's ChatGPT history and used security footage showing him near the room. He was fired and arrested on October 9 and charged with one count of federal wiretapping. The complaint does not allege espionage or name a principal, but his bio lists him as an investor at a Riyadh VC firm next to a prince whose father is a senior Saudi intelligence official.