Skip to main content
Glama

List Claude Code sessions

list_sessions
Read-only

Lists Claude Code sessions newest activity first, showing live connected windows and headless sessions with name, folder, focus, and status so you can find the right session.

Instructions

List Claude Code sessions, newest activity first: live windows the user has open (connected=true means it hears you now) and headless sessions the Mac runs. Shows each one's name, folder, focus and status.

Input Schema

NameRequiredDescriptionDefault
include_endedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already cover read-only and closed-world, and the description adds real value on top: sort order, the distinction between live and headless sessions, the meaning of the connected flag, and the fields returned (name, folder, focus, status). It does not disclose whether ended sessions normally appear or how the result set is bounded, which is the main remaining behavioral gap.

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?

One front-loaded sentence with the verb and resource first, then scope, then returned fields. The parenthetical about connected=true is colloquial but earns its place as behavior clarification; nothing is redundant.

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?

With no output schema, the description usefully enumerates returned fields, which covers the return-value gap. However, the one input parameter is left unexplained, so an agent cannot tell how to request ended sessions or what the default excludes.

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

Parameters2/5

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

The single parameter include_ended has 0% schema description coverage, and the description never mentions it or explains that ended sessions are excluded by default. Because the schema provides no semantics here, the description needed to carry that burden and does not.

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 Claude Code sessions') plus ordering ('newest activity first') and the two categories it returns (live windows vs. headless sessions). It does not distinguish itself from siblings like list_jobs, which also enumerate things, so an agent must infer the session-vs-job boundary.

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: a discovery/listing tool you'd call before end_session, send_message, or get_job. There is no explicit when-to-use, no when-not, and no named alternative, so the agent has to infer routing from the sibling names.

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