opencode-lens

opencode-lens is a skill for Claude Code, Codex from wuxiaoqiang12/opencode-lens. It costs 65 tokens per session (7,981 once invoked), scanned B, original, MIT.

A skill for inspecting and controlling running opencode sessions through an MCP connection. It supports status checks, monitoring, prompts, session switching, permissions, and model selection.

In plain words
What is it for?
Use it to monitor or manage active opencode work, continue or stop sessions, approve actions, or change the model used for a message.
Why use it?
It gives you a controlled way to see what local opencode instances are doing and intervene when needed.

Skill for Claude CodeCodex

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.

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

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-lens

README.md
[![agentmods](https://agentmods.dev/badge/skills/wuxiaoqiang12/opencode-lens/skill.svg)](https://agentmods.dev/skills/wuxiaoqiang12/opencode-lens/skill)
Your own site
<a href="https://agentmods.dev/skills/wuxiaoqiang12/opencode-lens/skill"><img src="https://agentmods.dev/badge/skills/wuxiaoqiang12/opencode-lens/skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,981 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
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.00065 $0.07981
Opus 5 $0.00032 $0.03991
Sonnet 5 $0.00013 $0.01596
Haiku 4.5 $0.00006 $0.00798

Measured 5d ago against content hash 74d921ba2e2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade B, and why

opencode-lens scanned grade B with 2 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 5d 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.

If the MCP tools are not present, do ONE quick diagnostic check — `read_file` on the last ~20 lines of `~/.hermes/logs/mcp-stderr.log` — to identify the cause, then immediately report to the user with an actionable fix (

Makes network callslowCapability

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

**Pitfall — never reverse-engineer the lens API via raw commands.** Do NOT use `curl --unix-socket`, `socat`, `nc`, `execute_code`, or any other raw HTTP/shell/Python tool to probe lens socket endpoints, parse socket fil
skill/SKILL.md · 274 lines

How it starts

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

opencode-lens

Use this skill when the user asks to inspect, continue, abort, or approve work running in local opencode instances, or when the user mentions "opencode" in any context that involves controlling or monitoring instances. ALWAYS load this skill via skill_view BEFORE calling any mcp_opencode_lens_ tool — skipping the skill load and jumping to MCP tools directly is a known error that violates the user's workflow preference.

Pitfall — never reverse-engineer the lens API via raw commands. Do NOT use curl --unix-socket, socat, nc, execute_code, or any other raw HTTP/shell/Python tool to probe lens socket endpoints, parse socket files, or discover available API routes. This was corrected explicitly by the user — ALL interaction with lens instances MUST go through the mcp_opencode_lens_* MCP tools. If you need to know what an endpoint returns, call the corresponding MCP tool. The watchdog script (opencode-watch.py) is the ONLY exception — it uses raw sockets internally, but you as the agent must never do so interactively. If the MCP tools are insufficient, tell the user; do not fall back to curl or execute_code.

MCP First

Hermes registers tools with the server prefix mcp_opencode_lens_ when the config key is opencode-lens:

  • mcp_opencode_lens_instances_list to discover active lens instances. It is compact by design and does not include historical sessions arrays.
  • mcp_opencode_lens_sessions_list to list recent session summaries for one instance when the user explicitly asks for historical/session-list information.
  • mcp_opencode_lens_tui_status to read live TUI-oriented status for one instance.
  • mcp_opencode_lens_messages_read to read session messages.
  • mcp_opencode_lens_tui_session_switch to switch the visible TUI session.
  • mcp_opencode_lens_session_create to create a new session (optional title, agent, initial providerID+modelID+variant); returns session_id.
  • mcp_opencode_lens_prompt_send to send prompts. Supports providerID+modelID+optional variant to run a prompt on a specific model (model is per-message in opencode 1.17.x), and force: true to override a busy check. Prompts are non-blocking: the tool returns accepted after queuing, not after the assistant finishes.
  • mcp_opencode_lens_models_list to inspect provider/model IDs before sending a model-specific prompt.
  • mcp_opencode_lens_session_status, mcp_opencode_lens_diff_get, and mcp_opencode_lens_todo_get to inspect state.
  • mcp_opencode_lens_events_wait to wait for changes.

Read the full file on GitHub · 274 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. 5d ago First seen · 274 lines · 65 tokens per session scan B 74d921ba2e2f

Subscribe to this mod's changes

opencode-lens is a skill published in the GitHub repository wuxiaoqiang12/opencode-lens (0 stars, last pushed 2mo ago), licensed MIT. It adds 65 tokens to every session and 7,981 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens