opencode-export

opencode-export is a skill for Claude Code, Codex from ZelinZhou-THU/opencode-export. It costs 41 tokens per session (651 once invoked), scanned A, original, MIT.

A tool for exporting OpenCode coding-agent sessions as self-contained HTML pages and JSON files. OpenCode sessions are records of conversations and tool activity during software work.

In plain words
What is it for?
Listing sessions, previewing session details, and exporting development histories with metadata, messages, tool activity, and source-code highlighting.
Why use it?
It creates portable records that can be shared, reviewed offline, or kept as backups while preserving the full session content.

Skill for Claude CodeCodex

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

Good fit Listing sessions, previewing session details, and exporting development histories with metadata, messages, tool activity, and source-code highlighting.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/zelinzhou-thu/opencode-export/skill/github.svg)](https://agentmods.dev/skills/zelinzhou-thu/opencode-export/skill)
Your own site
<a href="https://agentmods.dev/skills/zelinzhou-thu/opencode-export/skill"><img src="https://agentmods.dev/badge/skills/zelinzhou-thu/opencode-export/skill/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-export

Your own site · 80×15
<a href="https://agentmods.dev/skills/zelinzhou-thu/opencode-export/skill"><img src="https://agentmods.dev/badge/skills/zelinzhou-thu/opencode-export/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 651 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 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.00041 $0.00651
Opus 5.5 $0.00016 $0.00260
Sonnet 5.5 $0.00008 $0.00130
Haiku 4.5 $0.00004 $0.00065

Measured 1mo ago against content hash 6072875e6d45, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opencode-export 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 1mo 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.

skill/SKILL.md · 67 lines

How it starts

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

What I do

Export opencode session history to portable HTML + JSON archives:

  • list_sessions — discover what sessions exist (by project, time, size)
  • show_session — preview a session's metadata + recent messages
  • export_sessions — generate self-contained HTML (with offline vendor assets) + structured JSON

Output HTML includes: sticky header with session metadata, collapsible tool/reasoning blocks, subagent inlining, lazy syntax highlighting, TOC drawer of user prompts. JSON preserves full content for programmatic analysis.

When to use me

  • User asks to "save / archive / export / back up" their sessions
  • User needs to share AI interaction history (e.g., for TA review, portfolio, audit)
  • User wants to generate a browsable record of a project's development
  • User asks "what sessions do I have" or "show me my session history"

How to use me

Step 1 — Discover what's available:

Call list_sessions with the project directory (omit to auto-detect from CWD). Returns recent root sessions with id/title/date/message_count/tokens.

Step 2 — Preview if user is unsure:

Call show_session with a specific session_id to peek at metadata + recent messages without committing to a full export.

Step 3 — Export when user confirms:

Call export_sessions with:

  • output_dir (required) — where to write files
  • session_ids (optional) — specific sessions, or omit for auto-select by config rules
  • formats (optional) — ["html","json"] (default) or ["html"] only

Returns a summary with file paths. Tell the user where to find index.html to open in a browser.

Example workflow

User: "导出我最近的项目会话给 TA 看"

  1. list_sessions(project_directory="my-project") → see what exists
  2. Tell user: "找到 N 个会话,最近的是 [title] 于 [date],要导出哪些?"
  3. User confirms → export_sessions(output_dir="...", session_ids=[...])
  4. Report: "已导出 X 个会话到 [path],打开 index.html 即可浏览"

Notes

  • Tokens for older sessions are backfilled from step-finish parts; values may be approximate.
  • Secret redaction is automatic (API keys, tokens, passwords masked).
  • Vendor assets (highlight.js, mermaid, katex) are bundled for offline viewing.
  • For programmatic analysis, prefer data/sessions.json over HTML parsing.
  • Large exports (>20 sessions) may take 30+ seconds; the tool blocks until complete.

Read the full file on GitHub · 67 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. 1mo ago First seen · 67 lines · 41 tokens per session scan A 6072875e6d45

Subscribe to this mod's changes

opencode-export is a skill published in the GitHub repository ZelinZhou-THU/opencode-export (2 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 651 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. 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

batch

Execute batch operations on multiple files in parallel. Automatically discovers files, splits into chunks, and processes with parallel worker agents. Use /batch followed by operation and file pattern. For many independent single-turn transforms (translate/rewrite/extract each file into a new file) that can wait…

QwenLM/qwen-code · 102 tokens

batch-api

Prepare a many-file, single-turn transform (translate, rewrite, extract) as a plan and submit it to the asynchronous, half-price DashScope Batch API; results are delivered as new files hours later. Invoke explicitly with /batch-api.

QwenLM/qwen-code · 51 tokens

loop

Create a loop that runs a prompt now and follows up either on a fixed schedule or through self-paced wakeups. Usage - /loop check the build, /loop 5m check the build, /loop check the PR every 30m. /loop list to show jobs, /loop clear to cancel all.

QwenLM/qwen-code · 66 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

mcptoon

Compress MCP tool discovery with the mcptoon CLI. Trigger when a session has a large MCP tool catalog (many servers/tools), when the user mentions token cost, tool discovery, mcptoon, or asks to list/call MCP tools efficiently. Also route here when the user says the MCP tool list is too large, the agent context window…

activeing123/mcptoon · 523 tokens

anyr

Use when reading, searching, creating, or updating Anytype documents (objects, spaces, types, properties, files, chats) from the command line with the configured anyr CLI, including JSON output patterns for scripting.

stevelr/anytype · 46 tokens