opencode

opencode is a skill for Claude Code, Codex from chemany/Mente. It costs 15 tokens per session (1,829 once invoked), scanned A, a copy of opencode, MIT.

A guide for using OpenCode, an open-source command-line coding agent that can work with different AI providers. It explains how to delegate implementation, refactoring, reviews, and longer coding tasks to it.

In plain words
What is it for?
Use it to build features, refactor code, review pull requests, fix issues in batches, or run parallel coding tasks.
Why use it?
It helps you hand off coding work and monitor tasks that may take a long time or need separate working directories.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for hermes-agent. Also seen: mentions Codex; built for hermes-agent; mentions OpenCode.

Good fit Use it to build features, refactor code, review pull requests, fix issues in batches, or run parallel coding tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chemany/mente/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 chemany/Mente --skill opencode
Clone the repo
git clone --depth 1 https://github.com/chemany/Mente

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/chemany/mente/opencode.svg)](https://agentmods.dev/skills/chemany/mente/opencode)
Your own site
<a href="https://agentmods.dev/skills/chemany/mente/opencode"><img src="https://agentmods.dev/badge/skills/chemany/mente/opencode.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,829 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod 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.00015 $0.01829
Opus 5 $0.00008 $0.00915
Sonnet 5 $0.00003 $0.00366
Haiku 4.5 $0.00002 $0.00183

Measured 3d ago against content hash 8184aa8e3788, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

opencode scanned grade A with 0 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

94% identical to opencode — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/autonomous-ai-agents/opencode/SKILL.md · 219 lines

How it starts

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

OpenCode CLI

Use OpenCode as an autonomous coding worker orchestrated by Hermes terminal/process tools. OpenCode is a provider-agnostic, open-source AI coding agent with a TUI and CLI.

When to Use

  • User explicitly asks to use OpenCode
  • You want an external coding agent to implement/refactor/review code
  • You need long-running coding sessions with progress checks
  • You want parallel task execution in isolated workdirs/worktrees

Prerequisites

  • OpenCode installed: npm i -g opencode-ai@latest or brew install anomalyco/tap/opencode
  • Auth configured: opencode auth login or set provider env vars (OPENROUTER_API_KEY, etc.)
  • Verify: opencode auth list should show at least one provider
  • Git repository for code tasks (recommended)
  • pty=true for interactive TUI sessions

Binary Resolution (Important)

Shell environments may resolve different OpenCode binaries. If behavior differs between your terminal and Hermes, check:

terminal(command="which -a opencode")
terminal(command="opencode --version")

If needed, pin an explicit binary path:

terminal(command="$HOME/.opencode/bin/opencode run '...'", workdir="~/project", pty=true)

One-Shot Tasks

Use opencode run for bounded, non-interactive tasks:

terminal(command="opencode run 'Add retry logic to API calls and update tests'", workdir="~/project")

Attach context files with -f:

terminal(command="opencode run 'Review this config for security issues' -f config.yaml -f .env.example", workdir="~/project")

Show model thinking with --thinking:

terminal(command="opencode run 'Debug why tests fail in CI' --thinking", workdir="~/project")

Force a specific model:

terminal(command="opencode run 'Refactor auth module' --model openrouter/anthropic/claude-sonnet-4", workdir="~/project")

Interactive Sessions (Background)

For iterative work requiring multiple exchanges, start the TUI in background:

terminal(command="opencode", workdir="~/project", background=true, pty=true)
# Returns session_id

# Send a prompt
process(action="submit", session_id="<id>", data="Implement OAuth refresh flow and add tests")

# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")

# Send follow-up input
process(action="submit", session_id="<id>", data="Now add error handling for token expiry")

# Exit cleanly — Ctrl+C
process(action="write", session_id="<id>", data="\x03")
# Or just kill the process
process(action="kill", session_id="<id>")

Read the full file on GitHub · 219 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. 3d ago First seen · 219 lines · 15 tokens per session scan A 8184aa8e3788

Subscribe to this mod's changes

opencode is a skill published in the GitHub repository chemany/Mente (11 stars, last pushed 3mo ago), licensed MIT. It adds 15 tokens to every session and 1,829 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to opencode, differing in 3 lines, and is treated as a copy.