This guide teaches you how to download a coding LLM to your laptop with Ollama and wire it into Claude Code or Codex with a single command. You will end up with a local coding agent that can handle simple tasks for free while keeping proprietary code on your machine.
published apr 17, 2026
Run Your Own Coding Agent on Your Laptop (for Free)
advancedThe Rundown
Who This Is Useful For
- Solo developers and indie founders paying for Claude Code Max or Codex Pro on work that does not need frontier reasoning.
- Students, hobbyists, and new coders who want a working agentic setup to practice on for free.
- Anyone working on proprietary or NDA code who wants the whole loop to stay on their laptop.
What You Will Build
You will build a local Claude Code, Codex, or OpenCode session pointed at a free Ollama model running on your own hardware: the same agent-style interface, zero per-token cost, and nothing leaving your machine.
- A local Ollama coder model selected for your hardware.
- A coding-agent session launched against that local model.
- A larger context window configured for more practical agentic coding.
- An optional OpenCode setup if Claude Code feels too heavy for the model.
What You Need
- Ollama installed. If you do not have it, follow the Ollama install guide first.
- Claude Code signed in and working, or OpenCode from the installer in the OpenCode step.
- A terminal and a project folder you actually want to work in.
- 16 GB of RAM is ideal. 8 GB works with smaller models, and 32 GB+ is better.
Going Further
- Once the basics are working, treat local models as a practice environment, a privacy layer for sensitive projects, and a budget hedge for tasks that do not need frontier reasoning. A high-leverage next move is a hybrid setup: keep Claude Code or Codex as your main agent, but use your local model as a cheap subagent for boilerplate while the frontier model handles architecture and planning.
- Remote-control your local session from your phone by running claude remote-control inside the session and scanning the QR code with the Claude mobile app.
- Put the model on a dedicated machine, such as an old Mac mini or repurposed PC, and use it as an always-on local inference box over your network.
Download the biggest model version you can reasonably fit. Bigger means more reliable tool calls, which is what tends to break small models inside Claude Code.