opencode
Hand simple chores to the OpenCode AI on this computer (free models) to save Claude tokens, then verify the result. Use proactively in every project for simple, self-contained work — finding files or where something is defined, listing/counting matches across many files, summarizing a large file or folder, translating or rewording text, short standalone scripts, boilerplate, sample data, regex or command drafts. Also when the user types /opencode or asks to "use opencode" / "opencode'a yaptır". Not for tasks that need this conversation's context, edits to the user's real files, secrets or personal data, or hard work that must be right.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/kmertkun--claude-opencode-skill)HTML
<a href="/listings/kmertkun--claude-opencode-skill"><img src="/api/listings/kmertkun--claude-opencode-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
These steps run a script from the network that findsafeskills does not scan.
**macOS / Linux**
curl -fsSL https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.sh | bash
**Windows (PowerShell)**
irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
This installs `SKILL.md` and `oc.mjs` into `~/.claude/skills/opencode` and runs `--doctor` to show which OpenCode CLI it found.
To also let Claude use the skill **on its own in every project**, add the rule to `~/.claude/CLAUDE.md`:
curl -fsSL https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.sh | bash -s -- --with-rule
$env:OC_WITH_RULE=1; irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
Requirements: Node 18+ (Claude Code already has it) and OpenCode installed in any of these ways: desktop app, `curl -fsSL https://opencode.ai/install | bash`, Homebrew, or `npm i -g opencode-ai`.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 75 lines
- ---
- name: opencode
- description: Hand simple chores to the OpenCode AI on this computer (free models) to save Claude tokens, then verify the result. Use proactively in every project for simple, self-contained work — finding files or where something is defined, listing/counting matches across many files, summarizing a large file or folder, translating or rewording text, short standalone scripts, boilerplate, sample data, regex or command drafts. Also when the user types /opencode or asks to "use opencode" / "opencode'a yaptır". Not for tasks that need this conversation's context, edits to the user's real files, secrets or personal data, or hard work that must be right.
- ---
- # /opencode — hand simple chores to OpenCode
- OpenCode's CLI is installed on this machine and has free models. Send it the chores, keep the thinking and the real edits for yourself, and always check what it returns.
- Wrapper (Windows, macOS, Linux; needs Node 18+):
- ```bash
- node "<this skill folder>/oc.mjs" [options] "prompt"
- ```
- The skill folder is usually `~/.claude/skills/opencode` (on Windows: `%USERPROFILE%\.claude\skills\opencode`). Run `node oc.mjs --doctor` once if something fails. It shows which OpenCode CLI was found. It searches the desktop app, `~/.opencode/bin`, Homebrew, npm and `PATH`, and the `OPENCODE_BIN` env var overrides the search.
- ## Two modes
- **Read-only (default)**: searches and reads a real folder passed with `--dir`. Each run uses its own agent (`claude-ro`) that only has read/glob/grep/list. Writing, shell, web and MCP actions are denied. Tested on OpenCode 1.x and 2.x: it refused to create files or run commands. No OpenCode config file is changed.
- ```bash
- node oc.mjs --dir "/path/to/project" "Find every file that defines or calls sendInvoice. Reply only with relative paths and line numbers, one per line."
- ```
- **Write (`--write`)**: produces new files. It always runs in a fresh, empty temp folder with auto-approve on, so it may create files and run commands there only. It refuses a `--dir` outside the system temp folder.
- ```bash
- node oc.mjs --write "Create csv_to_json.py that reads input.csv and writes output.json. Only create that one file."
- ```
- Text-only tasks (translate, reword, draft) need neither option. Other options:
- - `--file path` attaches a file (repeatable).
- - `--prompt-file path` reads a long prompt from a UTF-8 file. On Windows PowerShell 5.1, use it whenever the prompt contains double quotes, because 5.1 breaks quotes on native command lines.
- - `--timeout sec` sets the per-model timeout (default 240).
- - `--free-only` skips paid models.
- - `--model id` forces a single model. Use it only when the user names a model.
- ## Model selection (automatic)
- The wrapper picks the chain from the task type and falls back to the next model on error, timeout or an empty answer.
- | `--task` (guessed if omitted) | Guess rule | Chain |
- |---|---|---|
- | `search` | `--dir` given, no `--write` | big-pickle → deepseek-v4.1-flash-free → mimo-v2.6-flash-free |
- | `text` | no `--dir`, no `--write` | deepseek-v4.1-flash-free → big-pickle → mimo-v2.6-flash-free |
- | `code` | `--write` | **paid, cheap:** claude-haiku-5-5 → gpt-5.4-mini, then **free:** big-pickle → deepseek-v4.1-flash-free |
- | `vision` | an image passed with `--file` | nemotron-3.5-super-vl-free → big-pickle |
- Free models come first. Cheap paid models are tried only for code. Expensive models (Opus, Fable, GPT Pro, ...) are never picked automatically. Paid models bill the OpenCode Console credits. When a paid call returns "insufficient balance", the wrapper writes `.no-balance` next to itself and skips paid models for 24 hours. A paid success clears that file.
- The last line of the output reports the `task`, the `model` actually used, and the `mode`. Mention the model in your one-line note to the user.
- ## When to use it
- Delegate:
- - File and code finding: "where is X defined", "which files use Y", "list config files", "find TODOs".
- - Bulk reading: summarizing a big file or folder, counting or listing matches across many files.
- - Text chores: translation, rewording, short summaries.
- - Small standalone outputs (write mode): scripts, snippets, boilerplate, test data, regex or command drafts.
- Keep it in Claude:
- - One quick Glob or Grep that answers in a single call. Delegating takes 5–30 seconds and saves nothing.
- - Anything that needs this conversation's context. OpenCode sees only the prompt, the attached files and the `--dir` folder.
- - Editing the user's real files or running commands on their system.
- - Passwords, tokens, `.env` contents or personal data, because they would go to a third-party model.
- - Hard or high-stakes work.
- ## Rules
- 1. Write a self-contained prompt that states the exact output format ("reply only with paths, one per line").
- 2. Verify before relying on the result. Spot-check found paths (open one or two, or run a quick Grep). Read produced files and run or check the code yourself. Free models make mistakes.
- 3. Bring results into the user's project yourself, with Claude's own tools, after review. Never point `--write` at a real folder.
- 4. Tell the user in one short line that this part was done by OpenCode, and with which model.
- 5. The wrapper already falls back across models. If it prints `FAILED` (exit code 1), do the task yourself.
README.md · README · 101 lines · 7 findings marked
- # claude-opencode-skill
- [](https://github.com/kmertkun/claude-opencode-skill/actions/workflows/test.yml)
- A [Claude Code](https://claude.com/claude-code) skill that hands simple chores (finding files, bulk reading, translation, small scripts) to the [OpenCode](https://opencode.ai) CLI and its **free models**, so Claude spends its tokens on the real work. Claude still checks every result.
- Works on **Windows, macOS and Linux**, with OpenCode **1.x and 2.x**.
- 
- <sub>The demo replays a real run on a small sample project. The text and timings are from that run; local paths and session ids are shortened.</sub>
- ## Install (one command)
- **macOS / Linux**
- ```bash
- curl -fsSL https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 18 on GitHub
- ```
- **Windows (PowerShell)**
- ```powershell
- irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 24 on GitHub
- ```
- This installs `SKILL.md` and `oc.mjs` into `~/.claude/skills/opencode` and runs `--doctor` to show which OpenCode CLI it found.
- To also let Claude use the skill **on its own in every project**, add the rule to `~/.claude/CLAUDE.md`:
- ```bash
- curl -fsSL https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.sh | bash -s -- --with-rule
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 32 on GitHub
- ```
- ```powershell
- $env:OC_WITH_RULE=1; irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 36 on GitHub
- ```
- Requirements: Node 18+ (Claude Code already has it) and OpenCode installed in any of these ways: desktop app, `curl -fsSL https://opencode.ai/install | bash`, Homebrew, or `npm i -g opencode-ai`.
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 39 on GitHub
- ## Usage
- In Claude Code, type `/opencode <task>` or just ask for something simple. You can also call the wrapper yourself:
- ```bash
- node ~/.claude/skills/opencode/oc.mjs --dir . "Where is the login form defined? Reply only with file:line."
- node ~/.claude/skills/opencode/oc.mjs "Translate to English: ..."
- node ~/.claude/skills/opencode/oc.mjs --write "Create csv_to_json.py that ..."
- node ~/.claude/skills/opencode/oc.mjs --doctor
- ```
- ### Two modes
- | Mode | When | What OpenCode can do |
- |---|---|---|
- | **read-only** (default) | `--dir <real folder>` | Only read, glob, grep and list. Writing, shell, web and MCP actions are denied by a per-run agent. Your OpenCode config is not changed. |
- | **write** | `--write` | Creates files and runs commands, but **only in a fresh temp folder**. A `--dir` outside temp is refused. |
- ### Automatic model selection
- | Task (guessed) | Chain |
- |---|---|
- | `search`: `--dir` given | big-pickle → deepseek-v4.1-flash-free → mimo-v2.6-flash-free |
- | `text`: plain prompt | deepseek-v4.1-flash-free → big-pickle → mimo-v2.6-flash-free |
- | `code`: `--write` | claude-haiku-5-5 → gpt-5.4-mini (cheap, paid) → big-pickle → deepseek-v4.1-flash-free |
- | `vision`: image via `--file` | nemotron-3.5-super-vl-free → big-pickle |
- Free models come first. Expensive models are never chosen automatically. With no OpenCode credits, the wrapper remembers it and skips paid models for 24 hours. Use `--free-only` to never try them.
- ### Finding the OpenCode CLI
- `oc.mjs` looks for the CLI in this order and uses the newest working one:
- - **Windows:** the OpenCode desktop app (`%LOCALAPPDATA%\Programs\*opencode*\resources\opencode-cli.exe`), `~/.opencode/bin`, and npm global installs (resolved to the real binary).
- - **macOS:** `/Applications/*OpenCode*.app`, `~/.opencode/bin`, `/opt/homebrew/bin`, `/usr/local/bin`.
- - **Linux:** `~/.opencode/bin`, `~/.local/bin`, `/opt/OpenCode`, `/usr/local/bin`, `/usr/bin`.
- - **All platforms:** anything named `opencode` / `opencode-cli` on `PATH`.
- Set `OPENCODE_BIN=/path/to/opencode` to force a specific binary.
- ## Türkçe
- Claude Code'un basit işleri (dosya bulma, toplu okuma, çeviri, küçük betikler) OpenCode'un **ücretsiz modellerine** vermesini sağlayan bir skill. Böylece Claude, token'larını asıl işe harcar ve her sonucu yine kendisi kontrol eder. **Windows, macOS ve Linux**'ta, OpenCode **1.x ve 2.x** ile çalışır.
- **Kurulum (tek komut):**
- - macOS / Linux: `curl -fsSL https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.sh | bash`
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 86 on GitHub
- - Windows: `irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex`
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 87 on GitHub
- Claude'un skill'i her projede kendiliğinden kullanması için kuralı da ekleyin: bash'te sona `-s -- --with-rule` ekleyin, PowerShell'de komuttan önce `$env:OC_WITH_RULE=1;` yazın.
- **Modlar:**
- - **Salt okunur (varsayılan):** Gerçek klasörlerde yalnızca okuma ve arama yapar.
- - **Yazma (`--write`):** Yalnızca boş, geçici bir klasörde çalışır.
- **Model seçimi:** Önce ücretsiz modeller denenir. Kod işlerinde ucuz ücretli modeller de denenir. Pahalı modeller hiçbir zaman otomatik seçilmez. Bakiye yoksa ücretli modeller 24 saat boyunca atlanır.
- **Sorun giderme:** `node ~/.claude/skills/opencode/oc.mjs --doctor` komutu hangi OpenCode CLI'ın bulunduğunu gösterir.
- ## License
- MIT
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.