export-opencode-sessions

Export OpenCode session histories as JSON or Markdown transcripts.

1|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/brianlan/improved-ai-agent --skill export-opencode-sessions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: export-opencode-sessions
Source: https://github.com/brianlan/improved-ai-agent/tree/main/skills/export-opencode-sessions
Command: npx skills add https://github.com/brianlan/improved-ai-agent --skill export-opencode-sessions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

OpenCode stores session histories in a database, which are difficult to audit, back up, or present to stakeholders. This skill exports matching sessions to individual files for easy archiving and review.

Core Features & Use Cases

  • Export by project directory and time window: finds sessions that match a path and time range and writes one folder per session with raw JSON or transcript Markdown.
  • Flexible output formats and layouts: exports in raw JSON or Markdown transcripts, with options for per-session, tree, or flat layouts.
  • Audit-ready artifacts: generates an index.json summarizing the export for quick audits and traceability.

Quick Start

Run the exporter with a project directory, a start time, an end time, and an output directory to generate per-session artifacts.

Frequently Asked Questions about export-opencode-sessions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I export OpenCode session histories to Markdown transcripts?

Export OpenCode session histories to Markdown transcripts by specifying a project directory, time window, and output directory. The tool matches sessions by path and time range, writing one folder per session containing readable transcript files.

Can I back up OpenCode sessions using ISO timestamps for a specific time range?

You can back up OpenCode sessions using ISO timestamps or epoch milliseconds. The exporter normalizes time inputs automatically, matching sessions within the specified window and generating individual archive files for easy review.

What is the best way to audit OpenCode session data for stakeholders?

Auditing OpenCode session data is best handled by exporting matching sessions to individual files. The tool generates an index.json summarizing the export, providing quick traceability and audit-ready artifacts for stakeholder review.

Does the OpenCode session exporter support flat or tree directory layouts?

The OpenCode session exporter supports multiple directory layouts including per-session, tree, and flat structures. You can choose the layout that best fits your archiving or review workflow when generating the export.

Can I export raw JSON files instead of Markdown transcripts from OpenCode sessions?

You can export OpenCode sessions as raw JSON files instead of Markdown transcripts. The exporter offers flexible output formats, allowing you to select either raw JSON or readable Markdown for each session artifact.

Why does my OpenCode session export require a project directory and time window?

OpenCode session exports require a project directory and time window to accurately filter matching sessions from the database. This ensures only relevant session histories within the specified path and timeframe are extracted for archiving.