anthropics / anthropics/claude-code

Desktop app: /resume shows every session as "Untitled session" with no preview

未关闭
#93,330 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:desktop bug has repro platform:windows
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

## What happens

In the desktop app, `/resume` lists every past session as "Untitled session". The preview
pane on the right says "Couldn't load the preview." for all of them. The only thing that
tells one row from another is its timestamp.

The same sessions show correct titles in the VS Code extension, and in the desktop app's own
sidebar.

## Environment

- Windows 11
- Claude desktop app, Code tab
- CLI bundled with the app: 2.1.260, at `%APPDATA%\Claude\claude-code\2.1.260\claude.exe`
- VS Code extension: 2.1.266

## The titles are already on disk

Session transcripts under `~/.claude/projects//*.jsonl` carry title records:

```
{"type":"ai-title","sessionId":"...","aiTitle":"..."}
{"type":"custom-title","sessionId":"...","customTitle":"..."}
{"type":"last-prompt","sessionId":"...","lastPrompt":"..."}
```

In one project folder holding 84 transcripts, 75 have an `ai-title` record, 15 have a
`custom-title` record, and 81 have a `last-prompt` record. Across all my project folders,
147 transcripts, not one contains a `{"type":"summary"}` line.

The resume dialog shows every one of them as untitled.

## The app's own stored titles are ignored too

The desktop app keeps a record per session at
`%APPDATA%\Claude\claude-code-sessions\\\local_.json`. Each record has a
`title` field and a `cliSessionId` field pointing at the transcript.

One of my sessions has such a record, with a title the app generated itself and shows
correctly in the sidebar. That same session appears as "Untitled session" in `/resume`. So
the dialog reads neither the transcript records nor the app's own store.

## Where the two strings come from

Neither string is in the CLI that the app bundles. Counting plain string matches in
`claude.exe` 2.1.260:

| String | Matches |
| --- | --- |
| `aiTitle` | 14 |
| `lastPrompt` | 6 |
| `Untitled session` | 0 |
| `Couldn't load the preview` | 0 |

The CLI knows about the title fields and never emits either string. Both come from the app's
own interface, so updating the CLI does not help.

## What the VS Code extension does instead

`extension.js` in 2.1.266 builds each history row's label as:

```
title = customTitle || aiTitle || lastPrompt || summary || firstPrompt
```

It reads the head and tail of each transcript, and falls back to the first user message when
no title record is present. That is why its history list reads correctly against the same
files.

### What Should Happen?

## Expected

The resume dialog should fall back the same way: the app's stored title, then `custom-title`,
`ai-title`, `last-prompt`, then the first user message. Any one of those four would have
produced a usable label for all 84 of my sessions.

### Error Messages/Logs

```shell

```

### Steps to Reproduce

## Steps to reproduce

1. Run some sessions from the VS Code extension so transcripts build up in a project folder.
2. Open the same folder in the desktop app.
3. Run `/resume` and pick "This folder".

Every row reads "Untitled session", and the preview pane fails to load for each one.

### Claude Model

None

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

_No response_

### Claude Code Version

2.1.263

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Other

### Additional Information

_No response_

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reproducing in the desktop app with /resume against transcripts in ~/.claude/projects//*.jsonl and session records under %APPDATA%\Claude\claude-code-sessions\\\. Use the VS Code extension.js behavior as the reference described in the issue. Done means /resume shows usable stored or transcript-derived titles instead of "Untitled session" and the preview no longer fails for those sessions.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, vscode
领域
desktop, developer-experience
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。