Skip to content
Back to search

opencode

SkillWorks with Claude CodeGitHub

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/kmertkun--claude-opencode-skill/badge.svg)](/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

i

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
  1. ---
  2. name: opencode
  3. 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.
  4. ---
  5. # /opencode — hand simple chores to OpenCode
  6. 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.
  7. Wrapper (Windows, macOS, Linux; needs Node 18+):
  8. ```bash
  9. node "<this skill folder>/oc.mjs" [options] "prompt"
  10. ```
  11. 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.
  12. ## Two modes
  13. **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.
  14. ```bash
  15. 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."
  16. ```
  17. **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.
  18. ```bash
  19. node oc.mjs --write "Create csv_to_json.py that reads input.csv and writes output.json. Only create that one file."
  20. ```
  21. Text-only tasks (translate, reword, draft) need neither option. Other options:
  22. - `--file path` attaches a file (repeatable).
  23. - `--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.
  24. - `--timeout sec` sets the per-model timeout (default 240).
  25. - `--free-only` skips paid models.
  26. - `--model id` forces a single model. Use it only when the user names a model.
  27. ## Model selection (automatic)
  28. The wrapper picks the chain from the task type and falls back to the next model on error, timeout or an empty answer.
  29. | `--task` (guessed if omitted) | Guess rule | Chain |
  30. |---|---|---|
  31. | `search` | `--dir` given, no `--write` | big-pickle → deepseek-v4.1-flash-free → mimo-v2.6-flash-free |
  32. | `text` | no `--dir`, no `--write` | deepseek-v4.1-flash-free → big-pickle → mimo-v2.6-flash-free |
  33. | `code` | `--write` | **paid, cheap:** claude-haiku-5-5 → gpt-5.4-mini, then **free:** big-pickle → deepseek-v4.1-flash-free |
  34. | `vision` | an image passed with `--file` | nemotron-3.5-super-vl-free → big-pickle |
  35. 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.
  36. 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.
  37. ## When to use it
  38. Delegate:
  39. - File and code finding: "where is X defined", "which files use Y", "list config files", "find TODOs".
  40. - Bulk reading: summarizing a big file or folder, counting or listing matches across many files.
  41. - Text chores: translation, rewording, short summaries.
  42. - Small standalone outputs (write mode): scripts, snippets, boilerplate, test data, regex or command drafts.
  43. Keep it in Claude:
  44. - One quick Glob or Grep that answers in a single call. Delegating takes 5–30 seconds and saves nothing.
  45. - Anything that needs this conversation's context. OpenCode sees only the prompt, the attached files and the `--dir` folder.
  46. - Editing the user's real files or running commands on their system.
  47. - Passwords, tokens, `.env` contents or personal data, because they would go to a third-party model.
  48. - Hard or high-stakes work.
  49. ## Rules
  50. 1. Write a self-contained prompt that states the exact output format ("reply only with paths, one per line").
  51. 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.
  52. 3. Bring results into the user's project yourself, with Claude's own tools, after review. Never point `--write` at a real folder.
  53. 4. Tell the user in one short line that this part was done by OpenCode, and with which model.
  54. 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
  1. # claude-opencode-skill
  2. [![test](https://github.com/kmertkun/claude-opencode-skill/actions/workflows/test.yml/badge.svg)](https://github.com/kmertkun/claude-opencode-skill/actions/workflows/test.yml)
  3. 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.
  4. Works on **Windows, macOS and Linux**, with OpenCode **1.x and 2.x**.
  5. ![demo](docs/demo.gif)
  6. <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>
  7. ## Install (one command)
  8. **macOS / Linux**
  9. ```bash
  10. 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
  11. ```
  12. **Windows (PowerShell)**
  13. ```powershell
  14. irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
  15. ```
  16. This installs `SKILL.md` and `oc.mjs` into `~/.claude/skills/opencode` and runs `--doctor` to show which OpenCode CLI it found.
  17. To also let Claude use the skill **on its own in every project**, add the rule to `~/.claude/CLAUDE.md`:
  18. ```bash
  19. 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
  20. ```
  21. ```powershell
  22. $env:OC_WITH_RULE=1; irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex
  23. ```
  24. 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
  25. ## Usage
  26. In Claude Code, type `/opencode <task>` or just ask for something simple. You can also call the wrapper yourself:
  27. ```bash
  28. node ~/.claude/skills/opencode/oc.mjs --dir . "Where is the login form defined? Reply only with file:line."
  29. node ~/.claude/skills/opencode/oc.mjs "Translate to English: ..."
  30. node ~/.claude/skills/opencode/oc.mjs --write "Create csv_to_json.py that ..."
  31. node ~/.claude/skills/opencode/oc.mjs --doctor
  32. ```
  33. ### Two modes
  34. | Mode | When | What OpenCode can do |
  35. |---|---|---|
  36. | **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. |
  37. | **write** | `--write` | Creates files and runs commands, but **only in a fresh temp folder**. A `--dir` outside temp is refused. |
  38. ### Automatic model selection
  39. | Task (guessed) | Chain |
  40. |---|---|
  41. | `search`: `--dir` given | big-pickle → deepseek-v4.1-flash-free → mimo-v2.6-flash-free |
  42. | `text`: plain prompt | deepseek-v4.1-flash-free → big-pickle → mimo-v2.6-flash-free |
  43. | `code`: `--write` | claude-haiku-5-5 → gpt-5.4-mini (cheap, paid) → big-pickle → deepseek-v4.1-flash-free |
  44. | `vision`: image via `--file` | nemotron-3.5-super-vl-free → big-pickle |
  45. 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.
  46. ### Finding the OpenCode CLI
  47. `oc.mjs` looks for the CLI in this order and uses the newest working one:
  48. - **Windows:** the OpenCode desktop app (`%LOCALAPPDATA%\Programs\*opencode*\resources\opencode-cli.exe`), `~/.opencode/bin`, and npm global installs (resolved to the real binary).
  49. - **macOS:** `/Applications/*OpenCode*.app`, `~/.opencode/bin`, `/opt/homebrew/bin`, `/usr/local/bin`.
  50. - **Linux:** `~/.opencode/bin`, `~/.local/bin`, `/opt/OpenCode`, `/usr/local/bin`, `/usr/bin`.
  51. - **All platforms:** anything named `opencode` / `opencode-cli` on `PATH`.
  52. Set `OPENCODE_BIN=/path/to/opencode` to force a specific binary.
  53. ## Türkçe
  54. 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.
  55. **Kurulum (tek komut):**
  56. - 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
  57. - Windows: `irm https://raw.githubusercontent.com/kmertkun/claude-opencode-skill/main/install.ps1 | iex`
  58. 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.
  59. **Modlar:**
  60. - **Salt okunur (varsayılan):** Gerçek klasörlerde yalnızca okuma ve arama yapar.
  61. - **Yazma (`--write`):** Yalnızca boş, geçici bir klasörde çalışır.
  62. **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.
  63. **Sorun giderme:** `node ~/.claude/skills/opencode/oc.mjs --doctor` komutu hangi OpenCode CLI'ın bulunduğunu gösterir.
  64. ## License
  65. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.