opencode

opencode is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 52 tokens per session (2,870 once invoked), scanned D, original, MIT.

An open-source terminal-based AI coding agent that can read and change code, run commands, and use tools. Its settings, commands, agents, and skills are stored as text configuration, and it can work with cloud or local AI models.

In plain words
What is it for?
Use it for interactive terminal coding, scripted or continuous-integration tasks, custom commands and agents, model routing, tool permissions, and HTTP-based integrations.
Why use it?
It lets developers choose their AI model and share agent behavior through project files instead of tying the workflow to one provider or editor.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md; mentions OpenCode.

Good fit Use it for interactive terminal coding, scripted or continuous-integration tasks, custom commands and agents, model routing, tool permissions, and HTTP-based integrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/opencode
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill opencode
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opencode

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencode/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/opencode)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/opencode"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencode/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opencode

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/opencode"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,870 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.02870
Opus 5.5 $0.00021 $0.01148
Sonnet 5.5 $0.00010 $0.00574
Haiku 4.5 $0.00005 $0.00287

Measured 10d ago against content hash 25a38e326845, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

opencode scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo pacman -S opencode # Arch

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://opencode.ai/install | bash
ai/opencode/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/anomalyco/opencode

官网 / 文档: https://opencode.ai | 配置 Schema: https://opencode.ai/config.json | TUI Schema: https://opencode.ai/tui.json

许可证: MIT 版本: 迭代快,以本机 opencode --version 为准(2026-10-11 上游最新 Release 为 v1.19.0)

注意: OpenCode 迭代非常快,命令、配置字段与模型名称请以你当前版本的 opencode --help、TUI 内 /help 及在线 JSON Schema 为准。

概述

OpenCode 是一个以终端为核心的开源 AI 编码智能体(区别于 IDE 内联补全),可读代码、改代码、跑命令、调用工具,自主完成多步开发任务。核心理念是「模型无关 + 配置即代码」:

  • 模型无关:基于 AI SDK 与 Models.dev 支持 75+ 提供商,云端(Claude/GPT/Gemini/Qwen)与本地(Ollama/LM Studio/llama.cpp)自由切换。
  • 权限系统:每类工具(edit/bash/read/webfetch 等)可设 allow/ask/deny,支持按命令、路径的细粒度规则。
  • 上下文与成本可控:自动压缩(compaction)、工具输出裁剪(prune)、小模型分流(small_model)。
  • 配置即代码:opencode.json、AGENTS.md、自定义命令/Agent/Skill 都是纯文本,可提交进 Git、团队共享。
  • 三种形态:TUI(终端交互)、CLI(opencode run 脚本化/CI)、Server/SDK(opencode serve 暴露 HTTP API)。
  • Git 快照:/undo、/redo 依赖项目为 Git 仓库,可随时撤销 AI 改动。

安装

# 一键安装脚本(最简单)
curl -fsSL https://opencode.ai/install | bash

# 包管理器
npm install -g opencode-ai          # Node 生态(npm/bun/pnpm/yarn)
brew install anomalyco/tap/opencode # macOS/Linux 官方 tap(更新最及时)
scoop install opencode              # Windows
sudo pacman -S opencode             # Arch
mise use -g opencode
nix run nixpkgs#opencode

opencode --version                  # 验证

Windows 推荐在 WSL 中使用;TUI 在 WezTerm/Alacritty/Ghostty/Kitty 等现代终端渲染更佳。


快速上手

cd your-project        # 建议是 Git 仓库(/undo /redo /快照依赖 Git)
opencode               # 启动 TUI

TUI 内常用斜杠命令:

/connect    # 接入模型提供商(粘贴 API Key;或选 OpenCode Zen 网关)
/models     # 选择当前模型
/init       # 生成项目级 AGENTS.md(让 OpenCode 了解你的项目)
/undo /redo # 基于 Git 快照撤销/重做 AI 改动
/share      # 生成会话分享链接
/help       # 查看全部命令

也可用环境变量提供密钥(如 ANTHROPIC_API_KEY、OPENAI_API_KEY),启动时自动识别。

CLI / 无头模式(脚本与 CI)

opencode run "为 utils.ts 补充单元测试并运行"      # 单次执行
opencode run -m anthropic/claude-sonnet-4-5 "重构登录模块"
opencode serve --port 4096                         # 启动 HTTP Server(配合 SDK)

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago Changed · +9 lines 25a38e326845
  2. 1mo ago First seen · 227 lines · 52 tokens per session scan D 13ba0ff2b548

Subscribe to this mod's changes

opencode is a skill published in the GitHub repository znlgis/opengis-skills (72 stars, last pushed 5d ago), licensed MIT. It adds 52 tokens to every session and 2,870 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it D with 3 findings (asks for root, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

gpt-image-gen

MUST read before generating images. Prompt-crafting guide for gpt-image-2.5 covering tool routing (native imagegeneration server tool vs the generateimage tool), model and quality selection, prompt structure, exact text rendering, reference-image editing, transparent assets, output formats, and multi-turn refinement.

code-yeongyu/senpi · 66 tokens

tmux-manual-qa

Run a single manual tmux-based QA scenario for the todo continuation feature against the real CLI (./pi-test.sh) in an interactive TUI. Captures scrollback, asserts deterministic pass/fail count markers, and cleans up test fixtures. Use only for the manual-qa milestone features.

code-yeongyu/senpi · 66 tokens

coding-agent-extension-worker

Implements a single feature in the pi-mono todotools builtin extension work. Use for refactoring, continuation runtime, config resolver, prompt builder, test authoring, golden snapshots, CHANGELOG entries, and harness helpers. Does NOT do manual tmux QA.

code-yeongyu/senpi · 61 tokens

bun-1-4

Read before a js eval cell that installs a package, spawns a server or PTY, or starts a long run, and before any bun -e, script, server, CLI, test, bundle, or package-management work: this session's eval js kernel runs Bun 1.4+ (this skill is present only when it does). Bun 1.4 ships builtins that replace 15+ npm deps…

code-yeongyu/senpi · 173 tokens

ahk-test

Design, write, and run behavior-focused tests for an objective or existing code. Writes test files only and reports evidence. No tasks created, no harness tracking.

enmanuelmag/agent-harness-kit · 36 tokens

ahk-review

Preview a code review against ticket/objective alignment, with deep semantic (name-vs-behavior) analysis. No tasks created, no harness tracking.

enmanuelmag/agent-harness-kit · 35 tokens