One command installs an open source coding agent that runs on your own hardware. Point it at a local model and nothing you write ever leaves the device. Setup takes under five minutes.
A client hands you their codebase. The contract says their data stays with you. Then you open your AI coding tool, and every file you touch gets shipped to a server you do not control.
Most operators never see the gap. The signed NDA sits in one folder. The cloud AI sits in the stack. Both are true at the same time, and nobody notices until an auditor asks where the code goes.
There is a coding agent that closes that gap. It runs on your machine. Wire it to a local model and the whole loop stays offline. Free, open source, one line to install.
What OpenCode Is
OpenCode is an open source AI coding agent you run in your terminal, your IDE, or a desktop app. It does the same job as the cloud tools you already know. It reads your repository, writes and edits code, and works through multi-step tasks on its own.
The difference is where the model lives. Connect a hosted model when you want raw speed. Connect a local model and the agent never phones home.
Under the hood it behaves like the paid agents. It loads the right language server for your project, so it navigates a real codebase instead of guessing at file names. You can run several agents in parallel on the same project when you want one exploring while another builds. If you work with a developer or a contractor, you can share a link to a session so they see exactly what the agent did. None of that changes the privacy math. With a local model, all of it happens on your machine.
The project has passed 160,000 stars on GitHub, with around 900 contributors and roughly 7.5 million developers using it each month as of July 2026. It supports more than 75 model providers, and the maintainers state plainly that it does not store your code or your context. Those numbers are not the point on their own. They tell you this is a maintained project with a real community behind it, not a weekend experiment you are trusting with client work.
The privacy question comes down to one thing: where the model runs.
| Setup | Where your code goes |
|---|---|
| Cloud coding tool (default) | Every file and prompt to the vendor's servers |
| OpenCode with a hosted model | Prompts to that one model provider, nothing to OpenCode |
| OpenCode with a local model | Nothing leaves the machine |
Why This Matters If You Sign Contracts
If you handle client code, hold sensitive business logic, or work anywhere near a regulated field, cloud AI is a contract problem. The workflow that makes your team fast is the same workflow moving other people's data offsite.
Legal, health, and finance clients write that restriction straight into the agreement. Do not route our data through third-party AI. Then the tool you code with does exactly that, quietly, every session.
You do not have to pick between speed and privacy here. You keep the agentic workflow. You keep the data on your side of the wall.
Is A Free Local Tool Actually Good Enough?
Yes, for most day-to-day work, and that is the whole reason to look at it. The agent behavior is real. It reads the repo, plans changes, and edits files across a project. On a capable machine with a solid local model, it handles the bulk of what you would otherwise send to the cloud. The hard, frontier-model tasks are where the tradeoff shows up, and that is covered in the limits below.
Setup: Three Steps To Your First Run
Step one: install it
Copy one line into your terminal.
Copy this.
curl -fsSL https://opencode.ai/install | bash
Prefer a package manager? Any of these work.
Copy this.
npm i -g opencode-ai@latest brew install anomalyco/tap/opencode
If you have an old build lying around, remove anything older than version 0.1 before installing so the two do not collide.
Step two: pick where the model runs
This choice is the entire privacy decision, so make it on purpose.
If you want it fully offline
Install Ollama, pull a local model such as Llama 3, and point OpenCode at it. Now the agent runs against a model sitting on your own hardware. Nothing you type, and nothing it reads from your repo, leaves the device. This is the setup for NDA work and regulated data.
If you want speed first
Connect a hosted provider like Claude or GPT instead. Your prompts go to that provider and only that provider. OpenCode itself stays out of the loop, but understand the tradeoff: this is not the private setup. Use it when the code is not sensitive and you want the strongest model.
Step three: open your project and start read-only
OpenCode ships with two agents. Plan is read-only and looks without touching. Build has full access and makes changes. Start in plan every time on a new repo. You want to see how it reasons before you let it write.
Done. The agent is running on your hardware, and you decided exactly what it can reach.
Copy This First Prompt
Paste this into plan mode on a real repository. It gives you a useful read without risking a single file.
Copy this.
You are reviewing this repository in read-only mode. Do not change any files. List the five areas where the code is most fragile or most unclear. Give the file path for each one. Keep the whole answer to one screen.
Read what it hands back. If the map looks right, that is your signal the agent understands the project well enough to trust with edits.
If it ever starts editing while you meant it to observe, stop it and type this: "You are in read-only mode. Undo that change and only report. Do not write to any file." Then move to build mode yourself, deliberately, once you are ready for it to act.
Where Business Owners Actually Use It
Client code under NDA. The agreement said keep our code in-house. With a local model, you can, and the tool that codes with you no longer breaks the clause.
Regulated projects. Health and finance codebases that legally cannot touch an outside server now have an agent that never sends them to one.
Your own edge. The pricing engine or the routing logic that makes your product work is the last thing you want sitting on someone else's machine. Local means it stays where it belongs.
Cost with no lock-in. OpenCode ships with models built in and connects to more than 75 providers, so you are not forced onto a single paid subscription to get agentic coding. If you are paying cloud AI fees today, some of that spend is optional.
Work with no connection. A plane, a locked-down client network, an office with the internet cut. A local model keeps running when the cloud tools go dark, so a dropped connection stops being a reason your team stops shipping.
Honest: The Limits You Should Know
Local models are weaker than frontier ones. A model running on your laptop will not match a top hosted model on the hardest tasks. For that work you may still reach for a cloud model, and the moment you do, data leaves the device. Always know which mode you are in.
Hardware sets the ceiling. Good local performance wants a recent machine with real memory. On a thin, older laptop, local models crawl, and the experience will frustrate you.
Hosted mode is not private mode. Connecting Claude or GPT sends your prompts to that provider. Only the local-model setup is fully offline. Do not let the tool's privacy reputation blur that line for you.
It is a tool, not a compliance program. Running local strengthens your data story. It does not, by itself, satisfy an audit or a certification. Pair it with the policy you actually operate under.
The desktop app is young. It is in active beta and moves fast. Expect the occasional rough edge and keep the terminal as your reliable path.
Close
If you only do one thing this week, install OpenCode, connect a local model, and run the read-only prompt on one real repository. One, not five.
Watch it map the code with nothing leaving your machine. If your hardware cannot keep up, you found that out in ten minutes and you move on with no cost. If it can, you just removed a clause from every client contract you sign from here on.