pingdotgg / pingdotgg/t3code

[Bug]: Imported Claude Code threads drop the user's renamed title (custom-title / customTitle)

Open Beginner friendly
#12,276 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Version: T3 Code 0.0.43-nightly.20260917.1866, macOS.

Summary

Claude Code stores a user-set thread title in its transcript as a custom-title record. The importer never reads it — it reads only aiTitle — so any Claude session the user has explicitly renamed imports under a title derived from the first user message instead of the name the user chose.

Steps

  1. In Claude Code, rename a session (e.g. to Refactor auth module).
  2. Import that project's sessions into T3 Code through onboarding.
  3. Look at the imported thread's title.

Actual: the thread is titled from the first user record. When the session's first message is a slash command, the title becomes the raw wrapper — e.g. <command-name>/effort</command-name>.

Expected: Refactor auth module — the title the user set in Claude Code.

Cause

Claude Code writes two distinct title records into ~/.claude/projects/<project>/<session>.jsonl:

{"type":"ai-title","aiTitle":"...","sessionId":"..."}         // auto-generated
{"type":"custom-title","customTitle":"...","sessionId":"..."} // the user's rename

AgentSessionScanner.ts handles only the first:

  • TranscriptRecord declares aiTitle but not customTitle (L118), so customTitle is dropped at decode.
  • The only title assignment from a record is if (record.aiTitle?.trim()) title = record.aiTitle.trim(); (L407).
  • Everything else falls through to the first-user-message derivation at L501.

Worth noting: shouldRetainDecodedRecord (L514-526) already keeps the record — a custom-title record carries sessionId, so it satisfies record.sessionId !== undefined. The record survives the read and is then discarded purely for lack of a schema field.

In a sample of local transcripts, 53 files carried customTitle against 8 carrying aiTitle — so for renamed sessions this is the common case, not an edge one.

Suggested fix

Add the field to TranscriptRecord and prefer it over the generated title:

customTitle: Schema.optional(Schema.String),
if (record.aiTitle?.trim()) title = record.aiTitle.trim();
if (record.customTitle?.trim()) title = record.customTitle.trim();

Ordering matters: Claude Code writes both kinds, and an explicit user rename should win over the generated one. Both appear repeatedly through a transcript, so last-write-wins on the existing linear scan yields the current title without extra bookkeeping.

Related

#10513 is the Codex-side of the same first-user-message derivation. This one is narrower: for Claude sources a user-authored title already exists inside the transcript and is being dropped.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in AgentSessionScanner.ts by reading TranscriptRecord around L118 and the title assignment near L407, then follow the existing linear transcript scan. Verify that imported Claude sessions use the user's customTitle over aiTitle, including transcripts containing both records and sessions whose first message is a slash command.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.