claude-code - 💡(How to fix) Fix VS Code: Session renames not persisted to JSONL files [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49012Fetched 2026-04-17 08:53:19
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

When renaming sessions in the VS Code sidebar, the custom titles are not written to the session JSONL files as {"type":"custom-title","customTitle":"..."} records. The sidebar displays the renamed titles correctly during the session, but the titles are lost and not accessible to the CLI or other tools that read the JSONL files.

Root Cause

When renaming sessions in the VS Code sidebar, the custom titles are not written to the session JSONL files as {"type":"custom-title","customTitle":"..."} records. The sidebar displays the renamed titles correctly during the session, but the titles are lost and not accessible to the CLI or other tools that read the JSONL files.

RAW_BUFFERClick to expand / collapse

Description

When renaming sessions in the VS Code sidebar, the custom titles are not written to the session JSONL files as {"type":"custom-title","customTitle":"..."} records. The sidebar displays the renamed titles correctly during the session, but the titles are lost and not accessible to the CLI or other tools that read the JSONL files.

Steps to Reproduce

  1. Open a Claude Code session in VS Code
  2. Rename the session in the sidebar (e.g., to "My Feature Work")
  3. Check the session's JSONL file: grep "custom-title" ~/.claude/projects/<encoded-path>/<session-id>.jsonl
  4. No custom-title record is found

Expected Behavior

Renaming a session should append a {"type":"custom-title","sessionId":"...","customTitle":"..."} record to the session's JSONL file, so that:

  • The CLI (claude --resume) can display the custom name
  • Third-party tools and skills can read session titles
  • Titles persist across VS Code restarts

Actual Behavior

  • The VS Code sidebar shows the renamed title correctly (likely cached in extension memory)
  • The JSONL file contains no custom-title or ai-title records
  • The extension source code (extension.js) has the renameSession function that should write these records, but it appears not to be called or to fail silently

Environment

  • Claude Code VS Code Extension: 2.1.109
  • macOS (darwin-arm64)
  • Verified across 15+ sessions — zero had persisted title records

extent analysis

TL;DR

The issue can be fixed by ensuring the renameSession function in the extension source code is correctly called and writes the custom title records to the JSONL file.

Guidance

  • Verify that the renameSession function is being called when renaming a session in the VS Code sidebar by adding logging or debugging statements to the function.
  • Check the function for any potential errors or exceptions that might prevent it from writing the custom title records to the JSONL file.
  • Inspect the JSONL file for any other records that might indicate the rename operation was attempted, but failed.
  • Consider adding error handling to the renameSession function to provide feedback to the user if the operation fails.

Example

// In extension.js, add logging to the renameSession function
function renameSession(sessionId, customTitle) {
  try {
    // Write custom title record to JSONL file
    const record = { type: "custom-title", sessionId, customTitle };
    // ...
    console.log(`Wrote custom title record: ${JSON.stringify(record)}`);
  } catch (error) {
    console.error(`Error writing custom title record: ${error}`);
  }
}

Notes

The issue may be specific to the Claude Code VS Code Extension version 2.1.109, and upgrading to a newer version might resolve the issue. However, without further information, it's unclear if this is the case.

Recommendation

Apply a workaround by modifying the renameSession function to correctly write the custom title records to the JSONL file, as this is the most direct way to address the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING