Skip to main content
Glama

list_claude_sessions

Lists Claude Code sessions with live PID status, name, working directory (including git worktrees), status, session ID, and transcript size, with filters for query, cwd, and active-only results.

Instructions

List Claude Code sessions on this machine with live PID status, name, working directory (including git worktrees), status, session_id, and transcript size.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_claude_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum sessions to return (default 25).
queryNoOptional substring filter on name, cwd, status, or ID.
cwd_filterNoOptional substring filter on working directory.
active_onlyNoIf true (default), only live sessions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that results include live PID status, git worktree resolution for cwd, and transcript size, implying a read-only local enumeration, but it never states ordering, whether dead sessions are excluded beyond the default, or anything about cost/latency of the scan.

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 trailing field enumeration earns its place because there is no output schema. Slightly list-heavy, but it stays information-dense rather than padded.

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

Completeness4/5

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

With no output schema, the description compensates by naming the returned fields, and with four optional parameters at full schema coverage the agent has what it needs to build a call. Only ordering and results-limit/pagination semantics are left implicit.

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 description coverage is 100%, so all four parameters are already documented in structured form, and the description adds no syntax or matching rules beyond it. It only echoes the fact that results carry a name, cwd, status, and session_id, which is the same ground the query parameter's schema text covers.

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 pairs a specific verb ("List") with a specific resource ("Claude Code sessions on this machine") and enumerates the returned fields (PID status, cwd, status, session_id, transcript size). That makes the scope distinguishable from the codex/gemini/antigravity siblings by resource name and from read_claude_session by verb, though it never names an alternative explicitly.

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

Usage Guidelines3/5

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

Usage is implied by phrased scope ("on this machine" plus live-PID emphasis) and reinforced by the schema default active_only=true, but the description never says when to prefer this over search_claude_sessions or read_claude_session. No exclusions or prerequisites are stated, leaving the agent to infer routing from name alone.

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