yanosh.net

How I use coding agents

Published: 2026-02-03

TL;DR

I use opencode with Ollama Cloud ($20/mo) and Anthropic ($20/mo) as my main LLM providers, plus pay-as-you-go API credits in OpenAI, xAI, Google, and Opencode ZEN. I use the python ddgs library as a websearch tool (gist) and have permissions set to "ask" for edit, webfetch, write, bash, MCP tools, and external directory access. MCPs are disabled by default. I also use a custom .aiexclude plugin to block the agent from reading sensitive files.

What This Post Is

Setting up a coding agent properly involves a lot of decisions: which provider, which permissions, what to expose and what to lock down. I’m sharing my setup and the reasoning behind each choice.

The motivation came from a meeting I organized with the dev team at work. We don’t have company-provided AI accounts, and everyone uses their own subscriptions, API keys, or free plans. I wanted to set some ground rules before bad habits formed. Pasting company code into a web chat is not OK, even if that chat belongs to OpenAI, Anthropic, or Google. I wanted everyone to turn off training on their data, use short-retention privacy options where available, and be aware of the many ways context can leak.

I was surprised by the gap between what I saw online and what happened at work. Only 2-3 people out of about 12 were using coding agents at all. The rest were still copy-pasting into regular chats. Meanwhile, on Hacker News, people were running projects like Gas Town (Steve Yegge’s multi-agent orchestrator for coordinating dozens of coding agents in parallel) and OpenClaw (Peter Steinberger’s autonomous AI agent that runs on your own devices and connects to your messaging apps).

What Is a Coding Agent?

Before I describe my setup, I’ll explain some key concepts. If you already know how agents, tool calls, and MCPs work, go directly to My Setup.

LLM vs. Agent

An LLM (Large Language Model) is a prediction engine. You give it text, and it predicts what comes next, one token at a time. That’s all it does. It doesn’t browse the web, edit files, or remember your last conversation. Text goes in, and text comes out.

Everything else you associate with “AI” comes from software around the LLM: the chat interface, the conversation history, web search, writing code to a file. Even ChatGPT and Claude.ai are wrappers. They format your messages, store the conversation, and send the full context to the LLM on each new turn. The LLM itself has no memory between calls. The chat application makes the conversation look continuous: it replays the entire history every time.

A coding agent goes one step further. It’s software that makes the LLM appear to act: read files, edit code, run commands. But the LLM still only outputs text. When an LLM “decides” to edit a file, it generates tokens in a specific tool-call format. The agent detects that format, does the real action (a file write, a shell command), and returns the result to the LLM as text. The LLM then continues to generate text from that new context.

The LLM doesn’t know that it edits your files. It doesn’t even know that files exist. It produces structured text, and the agent turns that text into actions. As Simon Willison put it (echoing Anthropic’s own definition): an agent is just “a model using tools in a loop.” The model requests an action, the agent does it, and the result goes back to the model. The loop continues until the task is done.

Tool Calls

So how does the LLM “know” which tools are available? The agent adds tool definitions to the system prompt before the conversation starts. Each definition gives the tool’s name, what it does, and which parameters it accepts. Here’s a simplified example:

<tool_description>
<tool_name>bash</tool_name>
<description>Executes a bash command in a persistent shell session</description>
<parameters>
<parameter name="command" type="string" required="true">The command to execute</parameter>
<parameter name="timeout" type="integer" required="false">Optional timeout</parameter>
</parameters>
</tool_description>

When the LLM wants to use a tool, it doesn’t run a command itself. It generates text in a structured format, like this:

<tool_call>
<tool_name>read</tool_name>
<parameters>
{
  "filePath": "/home/user/documents/report.txt",
  "limit": 50
}
</parameters>
</tool_call>

The agent reads the stream of generated tokens and recognizes this pattern as a tool call. The agent then reads the file and adds the content to the conversation, as if the LLM “saw” the file. The LLM continues its response with the file content in its context.

Each provider (for example Anthropic, OpenAI, and Google) has its own format for tool definitions and tool calls.

MCPs (Model Context Protocol)

Agents come with built-in tools: reading files, writing files, running shell commands. But what if you want the agent to control a browser, query a database, or draw a diagram? For that, you use MCP. MCP is a standard protocol that connects external tools to the agent. You run an MCP server (a small program), and the agent sends tool calls to it, the same way as with built-in tools. For the LLM, there’s no difference. It sees the same kind of tool definition. It doesn’t know if the tool runs locally or on a server on the other side of the world.

For you, the location of the tool matters. Some MCPs run entirely on your machine, for example Playwright for controlling a browser, or tmux for controlling a terminal session. Others, like context7, send parts of your prompt to external servers to get documentation. The LLM decides what to send to the tool, and the agent forwards it. That data can go to a third party with a different privacy policy than your LLM provider. Be careful about which MCPs you install and when you enable them.

Context Enrichment

An LLM only knows what you put in the prompt. To work well on your project, it needs context. Besides typing in the chat, there are several ways to give it context.

Rules (AGENTS.md) are files that the agent loads automatically at the start of each chat session. Think of them as a briefing document for the agent. If you work on a project often, you don’t want to repeat the same facts every session. For example: it’s a PHP project with CakePHP 5, user search is in a separate plugin, and you prefer tabs over spaces. You write these facts once in an AGENTS.md file, and the agent reads them at the start of every session. You can put an AGENTS.md file in each directory, so different parts of your codebase can have different rules. Read more in the opencode docs on rules.

Skills (SKILL.md) solve a different problem: context you only need sometimes. The agent always loads rules, but it loads skills only when they’re needed. For example, I have a youtube-summarizer skill that tells the agent how to extract a transcript with yt-dlp and then write a summary. I don’t have to explain the process each time I want a video summary.

In opencode, the agent can load skills automatically. The agent gives the LLM a tool, and the LLM uses that tool to load the skill text when it recognizes the need. This method isn’t fully reliable. Vercel’s engineering blog found that without explicit instructions, agents loaded the skill only 44% of the time. For this reason, most agents also let you start a skill manually with a slash command. Read more in the opencode docs on skills.

Commands are shortcuts for prompts you use often. They support argument injection, shell output injection, and file references, so you can create reusable workflows. For example, the built-in /init command in opencode tells the agent to create an AGENTS.md file for your project. Read more in the opencode docs on commands.

Why a TUI?

Most coding agents run inside IDEs: VS Code extensions, JetBrains plugins, and so on. That’s fine for many people, but I prefer a TUI (Terminal User Interface). The terminal is a very flexible interface because it’s just a stream of text. You can access it over SSH, run it inside a Docker or Podman container, pipe its output, and write scripts around it.

Because of this flexibility, sandboxing is easy. I can put opencode in a container or VM, connect over SSH, and let it work on a task without supervision (sometimes called YOLO mode). The container is my safety net. If the agent does something destructive, the damage stays inside the sandbox. I use YOLO mode for research tasks and small scripts where I don’t want to approve every single action.

YOLO mode has a real risk: prompt injection. If you ask the agent to fetch a web page and that page contains hidden instructions (“ignore your previous instructions and…”), the agent can obey them. Prompt injection is a growing concern, and many new services now offer sandboxes for agents.

Opencode also has a web version and an option for integrating into an IDE if you prefer not to use the terminal.

Provider-Agnostic Agents

A big advantage of opencode is that it isn’t tied to a single provider. Out of the box, Claude Code only works with Anthropic’s models. A provider-agnostic agent lets you use Anthropic, OpenAI, Google, open-weights models, and local models through the same interface, with the same tools, rules, and skills. Opencode supports 75+ LLM providers, including local models. You can compare models on the same task or use a cheaper model for simple work. When you hit rate limits, you can change to a different provider.

My Journey - from Chat to Agent

I’d been following AI since 2021-2022, and at the time I was taking deep learning courses, reading papers and watching the field evolve. When ChatGPT launched, I wasn’t surprised, but I wasn’t a heavy user either. I was mostly treating it as a better search engine for technical questions.

I got hooked on local inference. When Meta released Llama and Georgi Gerganov built llama.cpp for running it on consumer hardware, I was excited by the opportunity to run AI on my own machine. I set up Ollama on my home server and started experimenting. It was painfully slow: 30-40 seconds to the first token, then 1-5 tokens per second, but it was completely private. Privacy has always mattered to me. It’s why I switched to Linux and open source, why I self-host everything I can, and why I was a very late adopter of Facebook. I’ve never liked not having control over my data.

Eventually, speed and quality won out. Cloud providers like Anthropic offered a noticeably better experience. I set up OpenWebUI with LiteLLM so I could try different models while keeping conversations stored locally (not just in the cloud). I read the privacy policy of every provider I use. Most APIs store data for up to 30 days (not super private, but better than forever). At that time, I bought credits from Anthropic, OpenAI, Google, and xAI.

Then tool-calling models arrived, and with them the first coding agents. In October 2025, I tried Claude Code. I was surprised that an LLM could change files on my machine, list directories, run bash commands and fix mobile layouts on a personal project. But Claude Code was closed-source and locked to Anthropic’s models. I wanted to understand how it worked under the hood, and I wanted the freedom to use different providers (the same flexibility I’d had with OpenWebUI and LiteLLM, but for a coding agent). That’s what led me to opencode: an open-source alternative that supports dozens of providers and whose internals I could actually inspect.

Why opencode?

Opencode is an open-source coding agent and an alternative to Claude Code. It has over 95,000 GitHub stars and 650 contributors, and over 2.5 million developers use it monthly. It supports many providers (including unofficial support for Anthropic monthly plans) and has a very active community on GitHub. An active community matters a lot for an open-source project that you depend on.

My initial motivation was curiosity. I wanted to understand what a coding agent actually sends to the API: which system prompts, which tool definitions, and what data goes to third parties. So I set up mitmproxy and configured the environment variables HTTPS_PROXY and NODE_EXTRA_CA_CERTS (opencode is built with Node.js/Bun) to intercept the traffic.

To my surprise, something was sending telemetry. It turned out to be a third-party PHP LSP, so I turned off all LSPs. I also noticed that opencode shipped in YOLO mode by default (no permission prompts for editing or writing files), while Claude Code asked for permissions. That difference made me want to dig deeper into how “open” opencode really was.

Because I had the source code, I could use the coding agent to explore its own codebase. I had a bug where pasting strings that looked like image file names didn’t work: the text just didn’t appear. I asked opencode to find where in its own code this was happening. It traced the issue to a broken check in the image-detection logic for vision-capable models. I patched it, built the fix locally, found the existing GitHub ticket, and posted my solution.

My Setup - Providers

Ollama Cloud ($20/mo): Zero data retention, access to open-weights models. I nearly canceled this subscription because most open models were falling behind Anthropic and OpenAI. Then Moonshot released kimi-k2.5. I now use it instead of Sonnet for many tasks, and sometimes even instead of Opus. Beyond coding, it understands context and intent well, and that makes it feel smart. In the first few days after release, providers like Fireworks had rate-limiting issues from the demand, so it wasn’t just me. Ollama Cloud also has generous usage policies. I haven’t been able to hit the 5-hour or weekly quotas. Besides coding, qwen3-vl through Ollama is my go-to for image recognition.

Anthropic ($20/mo): Claude remains my primary model for coding. Sonnet for everyday work, Opus when I need deeper planning, harder debugging, or more nuanced problem-solving.

Pay-as-you-go: OpenAI, xAI, Google, Opencode ZEN. These are my fallbacks. I use them when I’ve exhausted my hourly or weekly limits, or when I want to try a specific model. Opencode ZEN is from the team behind opencode. It acts as a proxy for multiple providers at the same prices, so it’s a convenient single point of access. Google occasionally releases interesting models worth trying, like Nano Banana.

A note on the privacy tradeoff: I can’t run competitive models locally. The choice was either send some data to the cloud or don’t use LLMs at all. I chose LLMs, but with all privacy precautions in place.

To configure providers in opencode, run /connect in the TUI, choose the provider, and follow the steps.

(If you’re just getting started, $20/mo at Anthropic is enough. You can also enable extra usage in your account settings. After you hit your plan’s included usage limit, you continue at standard API rates on a pay-as-you-go basis.)

My Setup - Privacy & Permissions

This is the most important section of this post. Getting the tools to work is easy. The hard part is making sure that they don’t leak your data.

Update your privacy settings at every provider. In each provider’s privacy settings, disable training on your data and disable data retention where possible. Each provider has different settings. Anthropic also offers a zero-retention API arrangement if you contact their sales team with your use case.

Choose providers deliberately. Read the privacy policy of every provider before you use it. Prefer providers with zero data retention (Ollama Cloud, Opencode ZEN) or a maximum of 30 days.

Set all permissions to “ask”. This is the most important configuration choice. Here’s why each permission matters:

Disable MCPs by default. There are two reasons. The first is privacy: context can leak to third parties. The second is efficiency: MCP tool definitions use many context tokens (see Anthropic’s guide on advanced tool use). Enable an MCP when you need it. Opencode lets you do this in the middle of a session.

I currently have 3 MCP servers configured:

Never let LLMs read files with passwords, API keys, or any other sensitive data. I built a plugin, .aiexclude, that works like .gitignore for AI. List file patterns in a .aiexclude file, and the plugin blocks the agent from reading, writing, editing, or accessing those files, even through bash commands. I used the coding agent itself to build the plugin.

My Setup - Tools, Skills, Plugins

Websearch tool: I use DuckDuckGo in my browser and wanted the same in my coding agent. The python ddgs package provides DuckDuckGo search without an official API and supports a few other search providers too. Here’s my custom tool implementation.

Skills I use:

You can download an archive of my custom skills here. I also occasionally use skills from Anthropic’s official skills repository: the PDF and XLSX skills, and the skill-creator skill for building new skills.

Plugins: The .aiexclude plugin described in the Privacy & Permissions section.

My Setup - Configuration

All of the settings above are in the configuration file. Here’s my opencode.json, trimmed to the interesting parts:

{
  "$schema": "https://opencode.ai/config.json",
  "small_model": "ollama-cloud/ministral-3:14b",
  "share": "disabled",
  "lsp": false,
  "autoupdate": "notify",
  "mcp": {
    "playwright-cdp": {
      "type": "local",
      "command": [
        "node",
        "/srv/ai/mcp/playwright/node_modules/@playwright/mcp/cli.js",
        "--cdp-endpoint=http://localhost:9222"
      ],
      "enabled": false
    },
    "tmux": {
      "type": "local",
      "command": [
        "node",
        "/srv/ai/mcp/tmux/build/index.js"
      ],
      "enabled": false
    },
    "excalidraw": {
      "type": "local",
      "environment": {
        "EXPRESS_SERVER_URL": "http://localhost:3000",
        "ENABLE_CANVAS_SYNC": "true"
      },
      "command": [
        "node",
        "/srv/ai/mcp/mcp_excalidraw/dist/index.js"
      ],
      "enabled": false
    }
  },
  "agent": {
    "build": {
      "prompt": "{file:/srv/ai/open_code/system_prompt_long.md}"
    },
    "plan": {
      "prompt": "{file:/srv/ai/open_code/system_prompt_long.md}"
    }
  },
  "keybinds": {
    "leader": "alt+a"
  },
  "permission": {
    "edit": "ask",
    "bash": "ask",
    "webfetch": "ask",
    "websearch": "ask",
    "lsp": "ask",
    "codesearch": "ask",
    "doom_loop": "ask",
    "external_directory": "ask",
    "tmux_*": "ask",
    "playwright-cdp_*": "ask",
    "excalidraw_*": "ask"
  },
  "experimental": {
    "disable_paste_summary": true,
    "openTelemetry": false
  },
  "provider": {
    "ollama-alternative": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (Alternative)",
      "options": {
        "baseURL": "http://127.0.0.1:11434/v1"
      },
      "models": {
        "kimi-k2.5:cloud": {
          "name": "kimi-k2.5:cloud",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        },
        "qwen3-vl:235b-cloud": {
          "name": "qwen3-vl:235b-cloud",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        }
        // ... plus deepseek-v3.1, devstral-2, mistral-large-3,
        // glm-4.7, minimax-m2.1, cogito-2.1, and others
      }
    }
  }
}

Some details about this configuration:

Installing opencode

There are several ways to install opencode. Use the one that suits you:

curl (the quickest way to start):

curl -fsSL https://opencode.ai/install | bash

npm:

npm install -g opencode

brew (macOS/Linux):

brew install opencode

There’s also a desktop app in beta for macOS, Windows, and Linux.

Building from source is what I do. It gives me full control over what runs on my machine, and I can audit changes between releases. To build from source:

  1. Install Bun (I use a Podman container with Bun pre-installed, because Bun’s own installer is also a downloaded shell script).
  2. Clone the source:
    git clone https://github.com/anomalyco/opencode
    
  3. Check out the tag for the version you want, or use the dev branch for the latest version.
  4. Install dependencies:
    bun install
    
  5. Build:
    bun packages/opencode/script/build.ts --single
    
  6. Find the binary at packages/opencode/dist/opencode-linux-x64/bin/opencode (replace opencode-linux-x64 with your platform).

What This Changed For Me

I’ve been a developer for about 13 years. For the last 4-5 of those, I was losing interest. The work had become repetitive: setting up CMS input fields for yet another page section, creating ACF fields, wiring up models, controllers, and view logic in the same patterns I’d built a hundred times before. The problems weren’t hard, just tedious.

Coding agents made the work interesting again. I had a backlog of project ideas I’d been sitting on for years, but the thought of writing the same CRUD scaffolding one more time kept me from starting. Now I can hand that work to the agent and focus on the parts I enjoy: architecture, design decisions and the creative work.

The way I think about work changed too. I used to plan in my head, jot down notes, and then start writing code. Now I write my idea directly into the agent’s chat. To explain what I want clearly enough for the LLM to act on it, I have to think through the details. It’s like rubber duck debugging, except that the duck also writes the code.

I recently completed a client website where AI wrote almost all of the code. I bootstrapped the core WordPress functions file, then told the agent what to build and how. I reviewed all of the generated code and sometimes edited it by hand. Without coding agents, I would have had to write all of it myself, and honestly, it would have felt like a burden.