[BUG] list_sessions/search_session_transcripts MCP tools silently cap at 20 results, ignoring limit

Status Open
Reported on v2.1.216
Maintainer reply None cached
Activity 0 comments · opened Jul 21, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet (related but distinct: #59736 covers sessions missing from the Desktop UI after restart on Windows — a different mechanism than the silent result-cap described here)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

The Desktop app's session-management MCP tools (mcp__ccd_session_mgmt__list_sessions and mcp__ccd_session_mgmt__search_session_transcripts) silently cap results at 20, regardless of the requested limit, and with no field indicating the results were truncated.

  • list_sessions with limit: 5 correctly returns 5 results.
  • list_sessions with limit: 100 and limit: 300 both return the exact same 20 results (identical sessions, identical order — the 20 most-recently-active).
  • In one project directory alone (~/.claude/projects/<encoded-project-path>/) there are 184 session transcript .jsonl files on disk; 266 total across all projects. None of that is reflected in the tool output or any truncation flag.
  • search_session_transcripts appears to search over the same capped/recency-limited set rather than the full transcript history: searching for a distinctive string known to exist verbatim inside an older session's transcript returned "No matching sessions found," even though the string is present on disk in that session's .jsonl file. The session simply fell outside the ~20 most-recently-active window.

Net effect: any session more than about 20-sessions-old (which in an actively used repo can be just a few days) becomes effectively unfindable through either tool, with no indication to the caller (human or agent) that anything was omitted.

What Should Happen?

  • list_sessions should honor the requested limit up to some documented maximum, or the response should include an explicit indicator (e.g. hasMore: true / totalCount) when results are truncated.
  • search_session_transcripts should perform full-text search across all available transcripts (or at minimum all non-archived + archived ones within the store), not just the N most recently active sessions.

Steps to Reproduce

  1. In a project directory with more than 20 historical Claude Code sessions (check via ls ~/.claude/projects/<encoded-project-path>/*.jsonl | wc -l), call the list_sessions MCP tool with limit: 300, include_archived: true.
  2. Observe the response contains exactly 20 sessions, sorted by most-recent activity, not up to 300.
  3. Re-run with limit: 5 — observe it correctly returns 5, confirming the parameter is read but capped somewhere above 20.
  4. Pick a session older than the 20th-most-recent (confirm via its .jsonl file's timestamp fields) that contains a distinctive string in its transcript content (e.g. a keyword inside a file written via the Write tool).
  5. Call search_session_transcripts with that distinctive string as the query.
  6. Observe "No matching sessions found," despite the string being present verbatim in that session's on-disk transcript.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Claude Code Version

2.1.216 (Claude Code) — Desktop app version 1.22209.3, bundled claude-code 2.1.215 (per running process)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Related: #59736 documents a related but mechanically different symptom (Desktop-created sessions vanish from the UI after restart, on Windows, with entrypoint: claude-desktop-3p). This report's repro is restart-independent and reproducible purely via the MCP tool calls above, on macOS.

View original on GitHub ↗