Problem
The web bulk export (POST /api/export) produces Markdown files that are missing
several fields visible in the UI for each conversation:
Per-message metadata line — the UI shows token counts (input, output, cached)
for each AI bubble in the workspace view, but the exported Markdown omits them
entirely.
Frontmatter — the following aggregated fields shown in the UI tab summary are
absent from the exported frontmatter:
workspace_name (human-readable, URL-decoded folder name)
total_input_tokens
total_output_tokens
total_cached_tokens
total_cost_usd
This violates the "what you see is what you get" principle: content clearly
visible in the browser disappears in the exported file.
Fix
- Extract
tokenCount from each raw bubble in cursorDiskKV and include
inputTokens, outputTokens, cachedTokens in the per-bubble data
structure, then render them as _In: X / Out: Y / Cached: Z_ in the
Markdown metadata line.
- Aggregate the above into
total_input_tokens, total_output_tokens,
total_cached_tokens for the frontmatter.
- Derive
total_cost_usd from the composer's usageData.cost /
usageData.estimatedCost field.
- Always include
workspace_name (URL-decoded display name) in the frontmatter
alongside the existing workspace slug.
Affected file
api/export_api.py
Problem
The web bulk export (
POST /api/export) produces Markdown files that are missingseveral fields visible in the UI for each conversation:
Per-message metadata line — the UI shows token counts (input, output, cached)
for each AI bubble in the workspace view, but the exported Markdown omits them
entirely.
Frontmatter — the following aggregated fields shown in the UI tab summary are
absent from the exported frontmatter:
workspace_name(human-readable, URL-decoded folder name)total_input_tokenstotal_output_tokenstotal_cached_tokenstotal_cost_usdThis violates the "what you see is what you get" principle: content clearly
visible in the browser disappears in the exported file.
Fix
tokenCountfrom each raw bubble incursorDiskKVand includeinputTokens,outputTokens,cachedTokensin the per-bubble datastructure, then render them as
_In: X / Out: Y / Cached: Z_in theMarkdown metadata line.
total_input_tokens,total_output_tokens,total_cached_tokensfor the frontmatter.total_cost_usdfrom the composer'susageData.cost/usageData.estimatedCostfield.workspace_name(URL-decoded display name) in the frontmatteralongside the existing
workspaceslug.Affected file
api/export_api.py