[Bug]: Imported Claude Code threads drop the user's renamed title (custom-title / customTitle)
Nobody has claimed this yet.
- 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
- In Claude Code, rename a session (e.g. to
Refactor auth module). - Import that project's sessions into T3 Code through onboarding.
- 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:
TranscriptRecorddeclaresaiTitlebut notcustomTitle(L118), socustomTitleis 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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