claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] VS Code extension: "Search Sessions" should search session content, not just session titles

Open wshallwshall opened this issue 4 months ago • 8 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I frequently need to return to a past Claude Code session — to reread how something was decided, recover context, or resume the work. I remember what the session was about (a file name, a symbol, an error string, a phrase I typed), but I rarely remember what the session ended up being titled.

The VS Code extension's "Search Sessions" input only matches the session title. Session titles are short, auto-generated, and frequently reflect one incidental message rather than the substance of the conversation. So the one thing I reliably remember about a session — its content — is the one thing I can't search on.

The practical effect: once a session scrolls out of recent view, it is effectively unfindable from inside the IDE. My fallback is to leave VS Code and grep ~/.claude/projects/<slug>/*.jsonl by hand, which finds the session ID but doesn't connect back to the extension's "resume session" action.

Proposed Solution

Extend the existing "Search Sessions" input in the VS Code sidebar so a query matches session content as well as the session title.

The transcripts are already on disk as .jsonl; this is a matter of reading them, not of new data collection. Options, lightest to heaviest:

  1. Match user messages only. Usually sufficient — people recall what they asked. Lowest cost.
  2. Match all message text (user + assistant), with a matching snippet shown under the session in the results list so I can tell candidate sessions apart.
  3. A maintained index (e.g. SQLite FTS5) over the transcripts, for users with large session histories.

Even option 1 would close the gap. Ideally the results show a match snippet and clicking one resumes that session directly, so search and resume stay in the same place.

Alternative Solutions

  • Grep the transcripts manually (~/.claude/projects/<slug>/*.jsonl). This works, and it's what I do today, but it's outside the IDE, requires knowing the on-disk layout, and produces a session ID rather than something I can click to resume.
  • Third-party indexers exist (e.g. claude-code-search on PyPI, built by a user in response to this exact gap). That such tools keep getting built is evidence of the demand; relying on them means an unofficial index of conversation transcripts, which not everyone will want.
  • Scroll the sidebar and rely on memory of the date. Breaks down entirely past a few dozen sessions.
  • Rename every session by hand so the title contains searchable terms. Requires predicting, at the start of a session, which term future-me will search for.

Priority

High - Significant impact on productivity

Feature Category

Other

Use Case Example

  1. Last week I worked through a tricky bug in wiring_runner.py involving a cross-shard wake gap. Over the session we identified the root cause and I want that reasoning back.
  2. Today I open the VS Code sidebar and type wiring_runner into "Search Sessions".
  3. Expected: the session appears, ideally with a snippet showing where the term matched.
  4. Actual: no results. The session's title is something like "Fix the ordering issue" — a phrase that appears nowhere in my memory of the session, and wiring_runner appears nowhere in the title.
  5. I leave the IDE, grep the .jsonl files, find a session ID, and resume by ID from the CLI.

Step 5 is the whole gap: the information is on disk, the extension just won't search it.

Additional Context

Environment

  • Claude Code: 2.1.207
  • VS Code: 1.128.0
  • OS: Windows 11 (10.0.26200)

Why this is not a duplicate of the previously-closed issues

This request has surfaced before, but no open issue currently tracks it:

  • #50344 was this exact request (VS Code sidebar search is title-only). It was auto-closed by the duplicate-detection bot as a duplicate of #30599, and is now locked.
  • #30599 was about the CLI --resume and TUI /resume picker — a different surface. It was then auto-closed as stale / not-planned, so the VS Code request was folded into a CLI issue that subsequently died of inactivity rather than being declined on the merits.
  • #34098 (fuzzy search for the --resume picker) and #33683 are likewise CLI-picker issues, and closed.

So: the VS Code sidebar surface has never had an open issue tracking it to a decision. If the maintainers would prefer one issue covering all surfaces (CLI picker, TUI, and the VS Code sidebar), I'm happy for this to be that issue — but please reopen or track it somewhere rather than closing it back into a closed issue.

Suggested labels: enhancement, area:ide, platform:vscode.

wshallwshall avatar Jul 14 '26 16:07 wshallwshall

Does search within a session work for you @wshallwshall? It's completely broken for me in the latest version, and I'm surprised such a key missing features hasn't been reported yet.

dandv avatar Jul 17 '26 20:07 dandv

Ran into exactly this and ended up building a CLI for it: agsearch.

It indexes the JSONL transcripts under ~/.claude/projects and ranks sessions by content with BM25, so a symbol, a file name, or an error string finds the session even when the title is useless. Codex CLI sessions show up in the same ranked list. Everything stays local.

Not a substitute for this landing in the extension, but it works today if it helps anyone in the meantime.

devcodes9 avatar Aug 26 '26 17:08 devcodes9

I also need this feature very much. There is no way to search for specific text/content within an open chat conversation (similar to a browser's Ctrl+F find-in-page).

wenq77 avatar Aug 28 '26 07:08 wenq77

Still relevant. "Search Sessions" in the VS Code extension still matches session titles only.

The mismatch is that titles are generated, while what a user remembers about a past session is its content: a file name, a symbol, an error string, a phrase they typed. Searching the one thing nobody remembers is close to searching nothing.

Transcript content is already on disk under the project storage directory, so the index this would need exists. search_session_transcripts also already does content search on the MCP side, which suggests the capability is present and simply not wired into the extension's search box.

wshallwshall avatar Aug 29 '26 18:08 wshallwshall

One thing sits under both the extension ask and the indexer route: search can only see transcripts that still exist, and Claude Code deletes them after 30 days by default (cleanupPeriodDays, see #62476) - agsearch's own README warns about this. The "reread how something was decided" session is usually weeks or months old, which makes it exactly the one the sweep already removed. Content search that ships tomorrow still misses everything that expired yesterday.

That half is the one I built pond for: it syncs sessions into a store you own before cleanup can touch them - Claude Code, Codex and others, several accounts or machines in one place (which would also cover your #90188 case) - searchable by the agent over MCP, and pond resume writes a session back out in Claude Code's own format so you can open it and keep going. The extension should still get content search - but whatever indexes these files needs the files to survive first.

tenequm avatar Sep 07 '26 19:09 tenequm

on @tenequm's point: an index built before the sweep keeps answering after cleanupPeriodDays removes the file, so content search doesn't have to lose everything older than 30 days. that's how deja-vu works (disclosure: i maintain it). deja "the error string" ranks sessions by what's in them, and the vs code extension writes the same ~/.claude/projects files, so its sessions are in there too. deja resume <id> --exec reopens a hit. the extension's own search matching content is still the real fix.

vshulcz avatar Sep 28 '26 08:09 vshulcz

Still open. @tenequm and @vshulcz raise a real limit: transcripts are removed after cleanupPeriodDays, 30 by default (#62476), so content search in the extension could only reach what has not been cleaned up. I have not tried either tool.

That limit does not change the request. A user who raises cleanupPeriodDays keeps the files and still cannot search them from the extension, because "Search Sessions" matches titles only.

Both comments end in the same place as the report: the extension's own search box matching content is the fix.

wshallwshall avatar Oct 08 '26 12:10 wshallwshall

until this lands in the extension: i built ccback for exactly this (disclosure: i made it, MIT, runs locally) https://github.com/Aditya-A-G/ccback

it searches what you and claude actually wrote, across every project, shows the matching message, and enter reopens the session with claude --resume in its original folder. it's a terminal tool, so it reopens in the cli, not the extension panel

on the cleanupPeriodDays point above: resuming needs the transcript file, so raising that setting matters either way

Aditya-A-G avatar Oct 11 '26 17:10 Aditya-A-G