skills/export-chat-history/SKILL.md
Export and share AI chat sessions from Claude Code, Cursor, or Conductor. Lists sessions across providers, exports to markdown, publishes as a GitHub Gist. Use when the user asks to export, share, backup, or review chat history.
npx skillsauth add razbakov/skills export-chat-historyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Three-step workflow: discover sessions across providers, select one, export and share via GitHub Gist.
Prerequisites: jq, gawk, gh (GitHub CLI, authenticated).
Detect which providers have session data on this machine, then list recent sessions from all of them.
# Check which providers exist
[ -d ~/.claude/projects ] && echo "claude-code"
[ -d ~/.cursor/projects ] && echo "cursor"
ls ~/.claude/projects/ 2>/dev/null | grep -q "conductor-workspaces" && echo "conductor"
Stored as JSONL at ~/.claude/projects/{project-path-with-dashes}/*.jsonl.
Path mapping: /Users/me/Projects/foo becomes -Users-me-Projects-foo.
# List all project directories
ls ~/.claude/projects/ | grep -v conductor
# List recent sessions for a project with summaries
i=1; for f in $(ls -t ~/.claude/projects/{project-dir}/*.jsonl | head -20); do
dt=$(stat -f '%Sm' -t '%Y-%m-%d %H:%M' "$f" 2>/dev/null || date -r "$f" '+%Y-%m-%d %H:%M')
size=$(du -h "$f" | cut -f1)
msg=$(jq -r 'select(.type == "user") | .message.content | if type == "string" then . elif type == "array" then map(select(.type == "text") | .text | select(startswith("<system-reminder>") | not) | select(length > 5)) | first // empty else empty end' "$f" 2>/dev/null | head -1 | cut -c1-120)
printf "%3d) %s | %5s | %s\n" "$i" "$dt" "$size" "${msg:-(automated/system)}"
i=$((i + 1))
done
JSONL line types: user (user messages), assistant (Claude responses with text/tool_use), system (turn duration stats), attachment, permission-mode, file-history-snapshot.
Same JSONL format, stored at ~/.claude/projects/-Users-{user}-conductor-workspaces-*/*.jsonl. Use the same listing command with the conductor project directory.
Stored as plain text at ~/.cursor/projects/{project-name}/agent-transcripts/*.txt.
# List recent Cursor transcripts
i=1; for f in $(ls -t ~/.cursor/projects/{project-name}/agent-transcripts/*.txt | head -20); do
dt=$(stat -f '%Sm' -t '%Y-%m-%d %H:%M' "$f" 2>/dev/null || date -r "$f" '+%Y-%m-%d %H:%M')
size=$(du -h "$f" | cut -f1)
msg=$(grep -m1 '<user_query>' "$f" | sed 's/<[^>]*>//g' | cut -c1-120)
printf "%3d) %s | %5s | %s\n" "$i" "$dt" "$size" "${msg:-(empty)}"
i=$((i + 1))
done
Present the numbered list from Step 1 to the user. Ask them to pick a number. Map the number back to the file path. Save the absolute file path — do not rely on ls -t order later, as file modification times shift between steps.
If the user provides a search term instead of a number:
# Search across sessions by keyword
grep -rl 'search-term' ~/.claude/projects/{project-dir}/*.jsonl
Two-stage pipeline: jq extracts conversation, gawk collapses consecutive tool-only turns.
jq -r '
if .type == "user" then
.message.content |
if type == "string" then "\n## User\n" + . + "\n"
elif type == "array" then
map(select(.type == "text") | .text | select(startswith("<system-reminder>") | not)) | join("\n") |
if . != "" then "\n## User\n" + . + "\n" else empty end
else empty end
elif .type == "assistant" then
.message.content |
if type == "string" then "\n## Assistant\n" + . + "\n"
elif type == "array" then
( [.[] | select(.type == "text") | .text] | join("\n") ) as $text |
( [.[] | select(.type == "tool_use") | .name] ) as $tools |
( $tools | group_by(.) | map(if length > 1 then "\(.[0]) ×\(length)" else .[0] end) | join(", ") ) as $toolsummary |
if ($text | length) > 0 and ($toolsummary | length) > 0 then
"\n## Assistant\n" + $text + "\n\n> " + ($tools | length | tostring) + " tools: " + $toolsummary + "\n"
elif ($text | length) > 0 then
"\n## Assistant\n" + $text + "\n"
elif ($toolsummary | length) > 0 then
"\n> " + ($tools | length | tostring) + " tools: " + $toolsummary + "\n"
else empty end
else empty end
else empty end
' "$SESSION_FILE" | gawk '
/^> [0-9]+ tools:/ {
match($0, /^> [0-9]+ tools: (.+)/, m)
n = split(m[1], arr, ", ")
for (i = 1; i <= n; i++) {
if (match(arr[i], /(.+) ×([0-9]+)/, p)) {
tools[p[1]] += p[2]
} else {
tools[arr[i]] += 1
}
}
pending = 1
next
}
/^$/ && pending { next }
{
if (pending) {
total = 0; summary = ""
for (t in tools) total += tools[t]
PROCINFO["sorted_in"] = "@val_num_desc"
for (t in tools) {
if (summary != "") summary = summary ", "
summary = summary (tools[t] > 1 ? t " ×" tools[t] : t)
}
print "> " total " tools: " summary
print ""
delete tools
pending = 0
}
print
}
END {
if (pending) {
total = 0; summary = ""
for (t in tools) total += tools[t]
PROCINFO["sorted_in"] = "@val_num_desc"
for (t in tools) {
if (summary != "") summary = summary ", "
summary = summary (tools[t] > 1 ? t " ×" tools[t] : t)
}
print "> " total " tools: " summary
}
}
' > /tmp/session-export.md
# Cursor transcripts are already readable text, just add a header
echo "# Cursor Session Export" > /tmp/session-export.md
echo "" >> /tmp/session-export.md
cat "$SESSION_FILE" >> /tmp/session-export.md
After exporting, read /tmp/session-export.md and generate:
Use these as {title} and {description} in the header and gist description below.
Extract metadata from the JSONL and prepend to the export. Available fields on assistant messages: .message.model, .version, .entrypoint, .cwd, .gitBranch, .slug, .message.usage.output_tokens. Duration from system messages with .subtype == "turn_duration".
dt=$(stat -f '%Sm' -t '%Y-%m-%d %H:%M' "$SESSION_FILE" 2>/dev/null || date -r "$SESSION_FILE" '+%Y-%m-%d %H:%M')
msgs=$(jq -r 'select(.type == "user")' "$SESSION_FILE" 2>/dev/null | wc -l | tr -d ' ')
asst_msgs=$(jq -r 'select(.type == "assistant")' "$SESSION_FILE" 2>/dev/null | wc -l | tr -d ' ')
tools=$(jq -r 'select(.type == "assistant") | .message.content | arrays | .[] | select(.type == "tool_use") | .name' "$SESSION_FILE" 2>/dev/null | sort | uniq -c | sort -rn | head -5)
model=$(jq -r 'select(.type == "assistant") | .message.model // empty' "$SESSION_FILE" | sort | uniq -c | sort -rn | head -1 | awk '{print $2}')
version=$(jq -r 'select(.type == "assistant") | .version // empty' "$SESSION_FILE" | sort -u | tail -1)
entrypoint=$(jq -r 'select(.type == "assistant") | .entrypoint // empty' "$SESSION_FILE" | sort -u | head -1)
cwd=$(jq -r 'select(.type == "assistant") | .cwd // empty' "$SESSION_FILE" | sort -u | head -1)
branch=$(jq -r 'select(.type == "assistant") | .gitBranch // empty' "$SESSION_FILE" | sort -u | head -1)
output_tokens=$(jq -r 'select(.type == "assistant") | .message.usage.output_tokens // 0' "$SESSION_FILE" | paste -sd+ - | bc)
total_duration=$(jq -r 'select(.type == "system" and .subtype == "turn_duration") | .durationMs // 0' "$SESSION_FILE" | paste -sd+ - | bc 2>/dev/null || echo 0)
duration_min=$(echo "scale=1; ${total_duration:-0} / 60000" | bc 2>/dev/null || echo "?")
cat <<HEADER > /tmp/session-header.md
# {title}
> {description}
| | |
|---|---|
| **Date** | $dt |
| **Model** | $model |
| **Harness** | Claude Code $version ($entrypoint) |
| **OS** | $(uname -s) $(uname -m) |
| **Project** | $cwd ($branch) |
| **Turns** | $msgs user · $asst_msgs assistant |
| **Output** | $output_tokens tokens |
| **Duration** | ${duration_min}m |
| **Top tools** | $(echo "$tools" | awk '{printf "%s ×%s, ", $2, $1}' | sed 's/, $//') |
---
HEADER
cat /tmp/session-header.md /tmp/session-export.md > /tmp/session-final.md
mv /tmp/session-final.md /tmp/session-export.md
Always create a private gist without asking. Share the URL with the user.
gh gist create /tmp/session-export.md --desc "{title}"
# Count user messages in a session
jq -r 'select(.type == "user")' session.jsonl | wc -l
# List all tool calls in a session
jq -r 'select(.type == "assistant") | .message.content | arrays | .[] | select(.type == "tool_use") | .name' session.jsonl | sort | uniq -c | sort -rn
# Find sessions mentioning a topic
grep -rl 'deploy' ~/.claude/projects/{project-dir}/*.jsonl
development
Seed a new or empty Instagram account with a 9-post grid (3×3) so the profile looks established the moment a new visitor lands. Designed for festivals, new businesses, product launches, conferences, communities — any time an empty IG profile would hurt conversion from external traffic (QR scans, flyer drops, cross-promo). Generates assets via /image-from-gemini (per content-publishing rules — never HTML), writes captions with hashtag sets, and outputs a posting order + cadence plan. Trigger generously: phrases like '9 posts for instagram', 'fill my IG', 'starter grid', 'launch grid', 'instagram seed', '9-post grid', 'IG account not to look empty', 'first instagram posts', 'feed bootstrap', '3x3 grid', 'instagram launch content'. Even if the user mentions only one piece (just the images, just the captions, just the order), use this skill — the grid only works as an integrated bundle.
testing
Translate one English blog post into multiple target languages via parallel sub-agents, preserving frontmatter conventions, hero image, and brand voice. Use when the user shares a published English post URL or markdown path and says 'translate it', 'add other languages', 'publish in DE/ES/RU/UK', 'translate to 5 languages', or asks for localized versions of a specific post.
development
Build a complete press kit for an event, product launch, or campaign — in multiple languages — and publish it as a shareable Google Drive folder ready to send to journalists, partners, or a delegate. Produces press releases (typically DE/EN/ES, or configurable), uploads press photos and flyers, creates an Overview document for at-a-glance briefing, and creates a Handover document with pending tasks, contacts, risks, and decisions so press distribution can be delegated. Use when the user says 'I need a press release', 'create a press kit', 'press release in X languages', 'set up a Drive folder for press', 'handover doc for someone else to run press', or has an upcoming announcement that needs to be sent to media. Trigger generously: even partial requests (just a press release, just a flyer folder) typically evolve into the full kit.
development
Track ticket sales for a live event (concert, festival, conference, workshop) with daily snapshots, generate a burndown chart comparing actual sales to ideal-linear targets and tier-cumulative milestones, and report whether the event is on pace. Use when the user asks how sales are going, wants to know if their event will sell out, asks for a daily sales report, wants to set up sales tracking for an upcoming event, or asks about ticket pace / velocity / projection. Trigger generously: phrases like 'how is concert sales going', 'burndown for my event', 'are we going to sell out', 'sales velocity', 'daily ticket chart', 'how many tickets do we need to sell', or any case where the user has a ticketed event with a fixed sales window and wants visibility on pacing.