Skip to main content
Glama
dambinhtu-nhuy

claude-code-session-mcp

List Claude Code sessions

list_sessions
Read-only

List past Claude Code sessions with project, time span, turns, prompts, token usage, and tool calls. Use it to see which projects were active and compare session durations, without exposing message content.

Instructions

List past Claude Code sessions, newest first, with the project, time span, number of turns and prompts, per-model token usage and a tally of which tools were called. Use it to answer questions like which projects were worked on last week or which session was the long one. Returns counts only, never the text of any message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum sessions to return, newest first.
sinceNoEarliest day to include, YYYY-MM-DD, inclusive.
untilNoLatest day to include, YYYY-MM-DD, inclusive.
projectNoOnly this project. Claude Code names it after the working directory with separators replaced by dashes, for example c--dev-myapp.
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description adds a key behavioral constraint: returns only counts, never message content. This goes beyond the annotation by clarifying the data privacy boundary, which is valuable for an agent deciding whether to use this tool.

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

Conciseness5/5

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

Two sentences, front-loaded with the action and result contents, followed by usage examples and a boundary statement. Every sentence earns its place with no redundancy or fluff.

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?

The description is complete for a read-only list tool, covering the return shape and privacy boundary. It lacks an explicit note on defaults (e.g., limit behavior) but given the schema documents all parameters and no output schema exists, the description provides sufficient context for an agent to use the tool effectively.

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 parameters (limit, since, until, project) are already documented. The description adds no additional parameter-level meaning beyond what the schema provides, so a baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool lists past Claude Code sessions with specific attributes (newest first, project, time span, turns, prompts, token usage, tool tally). This distinguishes it from siblings like session_stats and tool_usage by focusing on session listing rather than aggregate stats or tool usage alone.

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

Usage Guidelines4/5

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

Provides concrete use cases ('which projects were worked on last week or which session was the long one') and clarifies what the tool does not return ('never the text of any message'). While it doesn't explicitly mention when to use sibling tools instead, the guidance is sufficient for typical use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dambinhtu-nhuy/claude-code-session-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server