← Back to blog

Hermes session export unifies across HTML, Markdown, QMD, and HuggingFace

hermessessionsexportclihuggingface
Hermes session export unifies across HTML, Markdown, QMD, and HuggingFace

Nous Research's Teknium announced Hermes Agent session export across six formats on July 7[^1]. The feature ships as three merged PRs totaling 3,901 additions across 23 files -- HTML, Markdown, QMD (Quarto), JSONL, trace (Claude Code JSONL), and prompt-only variants -- all behind a single hermes sessions export --format command with shared filters, --redact scrubbing, and optional direct upload to private HuggingFace datasets.

Six formats, one command

The PR cluster lands a unified export surface replacing what was previously a fragmented set of subcommands and half-implemented ideas. The single entry point is hermes sessions export <path> --format <format>:

Format Use Case PR
jsonl Machine-readable, programmatic analysis #60186
md Human-readable Markdown with YAML frontmatter #60186
qmd Quarto documents for publishing/reporting #60186
html Standalone single-file transcript with sidebar nav #60492
trace Claude Code JSONL for HuggingFace Trace Viewer #60507
--only user-prompts Prompt-only (no assistant/tool output), JSONL or md #60492

The full export surface is documented in the Hermes sessions user guide[^2] in both English and Chinese (zh-Hans).

PR breakdown

#60186 -- Markdown/QMD export, unified filters, --redact (1,397 lines)

PR #60186 by teknium1 landed the new session_export_md.py formatter (salvaged from contributor @web3blind's #59542) and rewired the entire export surface onto the shared _add_session_filter_args / build_prune_filters system. The same AGE grammar (5h, 2d, 1w, ISO dates) and 20+ filter flags (--model, --provider, --min-messages, --min-cost, --branch, --chat-id, and more) that prune and archive use now apply to export.

Key design decisions from the PR body:

  • Markdown and QMD output includes YAML frontmatter (session metadata), per-message headings, tool-call JSON blocks, and a SHA-256 verification footer.
  • A companion manifest JSONL is written alongside multi-session exports for batch verification.
  • --redact runs redact_session_data() in force mode through both messages and segments, with fail-closed behavior (redaction errors block the export entirely).
  • Both md and qmd refuse stdout output (filesystem-only by design) and refuse unfiltered bulk (must target a single session or pass specific filters).
  • --delete-after-verified is gated behind --yes + single --session-id + post-write hash/count verification.

9 files changed: hermes_cli/session_export_md.py (+279), hermes_cli/main.py (+243/-37), hermes_state.py (+78), tests (+734), and docs (+62 across EN and zh-Hans).

#60492 -- HTML and prompt-only export (1,549 lines)

PR #60492 added --format html and --only user-prompts, completing the format surface. The HTML renderer was salvaged from @simplast's #30481 (8 commits, authorship preserved). It produces a standalone single-file document with embedded CSS, SVG icons, collapsible tool output sections, a system-prompt header, and a multi-session sidebar with real-time search.

The prompt-only renderer (session_export.py, salvaged from @catbearlove1-lang's #57683) outputs one JSONL record per user prompt -- session id, 1-based index, timestamp, text, and message/event ids -- excluding all assistant, tool, and system content. This is useful for dataset curation, fine-tuning prep, or auditing what was sent to the model.

7 files changed: session_export_html.py (+849), session_export.py (+317), main.py (+102/-1), tests (+226), and docs (+52).

#60507 -- Trace export + HuggingFace upload (955 lines)

PR #60507 adds --format trace which converts Hermes sessions to Claude Code JSONL format (with text, tool_use, and tool_result blocks linked by uuid/parentUuid) for the HuggingFace Agent Trace Viewer. The --upload flag pushes the trace directly to the user's private hermes-traces dataset on HuggingFace.

A new agent/trace_upload.py module (+398 lines) handles the OpenAI-format-to-Claude-Code-format conversion, with forced secret redaction. The huggingface-hub dependency is loaded lazily through tools/lazy_deps.py -- installed on first use, not at Hermes install time.

Safety defaults from the PR:

  • --upload creates the dataset private unless --public is passed.
  • Missing HF_TOKEN prints guided setup instructions instead of failing silently.
  • Redaction errors block the export entirely (fail closed).
  • Trace redaction is ON by default; --no-redact is the explicit opt-out.
  • --dry-run on all formats, including trace.

7 files changed: agent/trace_upload.py (+398), hermes_cli/main.py (+142/-2), tests (+379), and docs (+34).

Community salvage pattern

All three PRs follow the same salvage pattern: a community contributor wrote the initial implementation as a standalone subcommand, and teknium1 restructured it onto the unified --format surface. The original commit authorship is preserved via cherry-pick. @simplast (#30481, HTML), @web3blind (#59542, Markdown), and @catbearlove1-lang (#57683, prompt-only) each contributed working code that predated the unified architecture.

This pattern lets the project accept focused community contributions without fragmenting the CLI into one-off subcommands. The contributor keeps authorship credit; the project gets a consistent hermes sessions export --format interface.

Engagement

Teknium's announcement tweet[^1] accumulated 483 likes, 229 bookmarks, 48 retweets, and 113,423 impressions in the first ~11 hours. The 229 bookmarks against 483 likes (47% bookmark-to-like ratio) suggests a high proportion of operators saving the reference for later use rather than casual scrollers liking and moving on.

[^1]: Teknium. "Hermes Agent can now export your agent sessions." X. July 7, 2026. [^2]: Hermes Agent docs. "Sessions user guide." Nous Research.

Termagotchi
_

Ryan Underdown

Autodidact. Rarely listens to advice.

Follow on X @catamarammed or GitHub @underdown