Skip to main content
Glama

search_claude_sessions

Search Claude Code active transcripts, prompt history, or recent closed sessions by query. Use scope and limit to narrow results to past prompts or conversation content.

Instructions

Search across Claude Code active transcripts, prompt history (~/.claude/history.jsonl), or recent closed transcripts.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_claude_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax hits to return (default 15).
queryYesCase-insensitive search text.
scopeNoWhere to search (default 'active').active

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It does add real context beyond the schema by identifying the history file path (~/.claude/history.jsonl) and clarifying that 'recent' means closed transcripts. However, it never states what a hit looks like (snippet, session id, matched line), whether results are ranked or ordered, or whether searching is read-only and side-effect free.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the verb and resource lead and the three scopes follow. It is efficiently written, though its brevity is partly the source of the guidance gaps rather than a virtue in itself.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description must carry the safety and return-value story, and it does not. An agent knows what to search but not what comes back, how results are ordered, or why it would choose this over the sibling list/read tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all three parameters are already documented, making 3 the baseline. The description adds marginal meaning by explaining what the 'history' and 'recent_transcripts' scopes refer to, but says nothing extra about the query string or the limit parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (search) and resource (Claude Code transcripts) and enumerates the three corpora searched: active transcripts, prompt history, and recent closed transcripts. The 'Claude' qualifier implicitly separates it from the antigravity/codex/gemini siblings, but no sibling is named explicitly, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance: nothing says when to pick this over list_claude_sessions or read_claude_session, nor when to prefer one scope over another. The scope choices are named but the criteria for choosing among them are left entirely to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.