home / skills / yousufjoyian / claude-skills / terminal-discussion-export

terminal-discussion-export skill

/terminal-discussion-export

This skill exports terminal discussions from TriClaude logs to Google Drive as Markdown, preserving order and removing noise for easy archiving.

npx playbooks add skill yousufjoyian/claude-skills --skill terminal-discussion-export

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.9 KB
---
name: terminal-discussion-export
description: Export TriClaude or WorkClaude terminal discussion content to Google Drive as clean Markdown and post completion status to the terminal Visual tab. Use when the user asks to save, archive, export, or capture what was discussed in a terminal session to Drive, or says "workclaw".
---

# Terminal Discussion Export

Export a terminal discussion from TriClaude runtime logs into Drive.

## Output Location

Default root:
`/home/yousuf/GoogleDrive/PROJECTS/.triclaude/exports/terminal-discussions`

Each export is saved under a project subfolder:
`<root>/<project-name-slug>/discussion_YYYYMMDD_HHMMSS_<terminal-suffix>.md`

A rolling latest file is also updated:
`<root>/<project-name-slug>/latest_<terminal-suffix>.md`

## Workflow

1. Determine terminal id.

Preferred:
```bash
echo "$TC_TERMINAL_ID"
```

Fallback:
```bash
python3 - <<'PY'
import json
p='/home/yousuf/GoogleDrive/PROJECTS/.triclaude/projects.json'
d=json.load(open(p))
for proj in d.get('projects', []):
  for t in proj.get('terminals', []):
    print(f"{proj.get('name')} | {t.get('id')}")
PY
```

2. Run export script.

```bash
python3 /home/yousuf/local_workspaces/skills/terminal-discussion-export/scripts/export_terminal_discussion.py \
  --terminal-id "$TC_TERMINAL_ID" \
  --lines 1800 \
  --a2ui on
```

3. Return the generated file path to the user.

The script prints JSON including `exportFile`, `latestFile`, and `a2uiUpdated`.

## Common Variants

Export a different number of lines:
```bash
python3 /home/yousuf/local_workspaces/skills/terminal-discussion-export/scripts/export_terminal_discussion.py \
  --terminal-id term_XXXXXXXXXXXX \
  --lines 3000
```

Add a short user-provided note at the top of export:
```bash
python3 /home/yousuf/local_workspaces/skills/terminal-discussion-export/scripts/export_terminal_discussion.py \
  --terminal-id "$TC_TERMINAL_ID" \
  --note "Focus: GH work account validation and Codex checks"
```

Override output root when explicitly requested:
```bash
python3 /home/yousuf/local_workspaces/skills/terminal-discussion-export/scripts/export_terminal_discussion.py \
  --terminal-id "$TC_TERMINAL_ID" \
  --output-root /custom/path
```

Disable Visual-tab update only when explicitly requested:
```bash
python3 /home/yousuf/local_workspaces/skills/terminal-discussion-export/scripts/export_terminal_discussion.py \
  --terminal-id "$TC_TERMINAL_ID" \
  --a2ui off
```

## Visual Tab Completion

- Default behavior writes an A2UI status card to the terminal `a2ui_input.log`.
- Supports both personal and work runtimes by auto-detecting `.triclaude` or `.workclaude`.
- Use `--a2ui on` to require Visual-tab update success.

## Rules

- Export from `stream.log` only; do not fabricate transcript text.
- Keep raw order of lines.
- Strip ANSI/control escape noise before saving.
- Confirm success by returning the exact output file path.
- Confirm Visual-tab status via `a2uiUpdated: true` when `--a2ui on` is used.

Overview

This skill exports TriClaude terminal session content to Google Drive as clean Markdown files for archiving or sharing. It preserves the original line order, strips ANSI/control escape noise, and updates a project-level rolling "latest" file. Use it when you need an exact, readable capture of a terminal discussion saved under your Drive workspace.

How this skill works

The script reads the TriClaude runtime stream.log for a specified terminal id, removes control/ANSI escape sequences, and writes the ordered text to a timestamped Markdown file under the configured Drive export root. It also updates a project-level latest_<terminal-suffix>.md file and prints JSON that includes exportFile and latestFile paths for confirmation. The tool accepts options for number of lines, a short note header, and a custom output root.

When to use it

  • Save or archive a terminal discussion after a long troubleshooting session.
  • Share a reproducible terminal transcript with teammates or for documentation.
  • Capture an exact record before restarting or destroying a terminal instance.
  • Maintain a searchable, chronological record of terminal activity per project.
  • Quickly export the most recent N lines for postmortem analysis.

Best practices

  • Prefer the TC_TERMINAL_ID environment variable; fallback script lists project terminals if unknown.
  • Export from live stream.log only; do not edit or synthesize transcript content.
  • Specify an appropriate --lines value to avoid truncation or oversized files.
  • Add a concise --note when the export needs context or a decision summary.
  • Keep default output root unless you explicitly need a different Drive path.
  • Verify the printed JSON and returned exportFile path to confirm success.

Example use cases

  • Archive a debugging session for a bug report and attach the exported Markdown to the ticket.
  • Export the last 1800 lines before handing a project to another engineer.
  • Add a short note and export a CI troubleshooting session for retrospective review.
  • Produce a timestamped record for compliance or audit of important terminal operations.
  • Save a reproducible transcript to include in project documentation under the project subfolder.

FAQ

How do I find the terminal id if I don’t have TC_TERMINAL_ID set?

Run the provided Python fallback snippet to list projects and their terminal ids from the projects.json file.

What confirms a successful export?

The script prints JSON containing exportFile and latestFile paths; check those exact paths in Drive to confirm the saved Markdown.

Can I change how many lines are exported?

Yes—use the --lines option to specify the number of most recent lines to include.