Skip to main content
Glama

list_sessions

List local Claude Code sessions to see each session's id, title, project, status, branch, and last activity, plus pending request counts, so you can pick which one to inspect or continue.

Instructions

List local Claude Code sessions, newest first: id, title, project, status (working, needs-you, idle, not-running, failed, stopped, unknown), branch, last activity, and the number of pending requests. limit defaults to 10. detail full returns every recorded field per row (cwd, run state, process, subagents, the continue command) and defaults to 50 rows.

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_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
detailNo
projectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/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 burden; it does disclose sorting ('newest first'), the complete status vocabulary, the differing default row counts for brief vs full, and the extra fields full returns. It never states that the operation is read-only, whether results are paginated beyond limit, or how the project filter matches, leaving real behavioral gaps.

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?

Three tight sentences, front-loaded with the resource and its returned fields, then the defaults. Nearly every clause carries information; the field enumeration is long but earns its place by substituting for a missing output schema.

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

Completeness3/5

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

For a 3-parameter read tool with no annotations and no output schema, the description does well on return shape and defaults, effectively standing in for the absent output schema. It falls short by omitting any explanation of the project filter and any statement of read-only safety, which matter given zero annotation coverage.

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 0%, so the description must compensate. It usefully documents limit's default (10) and detail's full-mode semantics (every recorded field, defaults to 50 rows), but the third parameter, project, is never explained at all—no matching semantics, no format, no default.

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?

States a specific verb and resource ('List local Claude Code sessions') and immediately enumerates the returned columns (id, title, project, status, branch, last activity, pending requests) plus ordering ('newest first'). It does not distinguish itself from siblings like get_session or list_pending, so an agent must infer the boundary, keeping it 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 Guidelines3/5

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

Usage is only implied: this is the enumeration tool, and the 'detail full' note hints at a heavier variant for per-row inspection. There is no explicit when-to-use/when-not guidance, no pointer to get_session for a single session, and no mention of when list_pending is the better choice.

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