Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): imported Claude threads show prompts, not Claude Code markup #33403

Mergeddominikzabcik(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/33403/headmerged by maria-rcks View on GitHub

Problem

Claude Code records its own UI as user turns, and import copies them word for word. Imported threads show raw markup: slash commands and skills as <command-message>…<command-name>…<command-args>…, ! shell runs as <bash-input>/<bash-stdout>, output of local commands like /mcp as <local-command-stdout>, background task notifications as <task-notification> blocks, and [Request interrupted by user] markers. Across 1,558 of my transcripts from the last 30 days that was 2,088 task notifications, 510 shell runs, 284 commands, 138 interruptions and 81 command outputs. A thread opened with a skill is also titled after the markup, for example <command-message>pstack:poteto-mode</command-message>. Some launchers save that markup as the session's custom title too. A session that only ran /clear imports as a thread called <command-name>/clear</command-name>.

Change

Slash commands and shell runs now import as typed (/review the login flow, !npm test). Their output, task notifications and interruption markers are left out. A command names the thread by its arguments, and a bare command leaves the title to the next prompt. A saved custom or AI title that is Claude Code markup (a command, a shell run, command output) falls back to the next title source. A Claude session made only of bare commands that no reply followed, such as a lone /clear, is skipped. A bare command the agent answered, such as /review or an argument-free skill, is kept and names the thread. Claude's synthetic error replies are still imported, as before.

Scope and approval

No prior issue. This is a focused fix for an obvious display bug, since the imported text is not what the user typed or saw.

Verification

Proof: the existing Claude parser test gains one record of each kind. New table rows cover the title of a command with arguments, a bare /clear followed by a prompt, a prompt that starts with /Users/…, custom titles that are command, shell or command-output markup, a session of bare commands that is skipped, and a bare /review the agent answered that is kept. All new cases fail on main.

On real data, I dry-ran the scanner over 9 of my projects: 196 threads and 19k messages. No imported message starts with Claude Code markup and no title starts with < or [. The thread that was titled <command-message>pstack:poteto-mode</command-message> is now titled I would like to do NFCtron Shortener, for internal, organizer links…, and the one /clear-only session is no longer imported.

vp run check:changed passes, except excludes sandboxes reached through a symlink into the worktrees dir. That test also fails on main on macOS and is fixed in #33401.

This change and #33402 both touch the final check in parseAgentSessionRecords, so whichever lands second needs a one-hunk rebase. I've checked that all three PRs stacked together pass both test files.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

    1. Pushed4f926a9

    2. On CodeRabbit's note about shell-only sessions: leaving that out is intended. A Claude session holding only a !npm test run and no reply asked the agent nothing, the same as a /clear-only session. Its output is Claude Code UI and is not imported, so the thread would show a single !npm test line with nothing to continue.

    3. juliusmarminge added labelstakeover:in-progress

    4. juliusmarminge added labelstakeover:needs-julius

    5. juliusmarminge removed labelstakeover:in-progress

    6. maria-rcks merged this486ba48

    7. maria-rcks closed this

Sign in to join this conversation.