Skip to main content
Glama

discover_claude_sessions

Scan Claude Code project directories to identify active sessions, decode paths, and optionally register them as subprojects for multi-repo intelligence.

Instructions

Scan ~/.claude/projects for projects Claude Code has touched on this machine, decode each directory name back to its absolute path, and report which ones still exist plus session-file count and last activity. With add_as_subprojects=true, every existing project is registered as a subproject in one call — useful for spinning up multi-repo intelligence after a fresh clone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_rootNoOverride the scan root (default: ~/.claude/projects)
exclude_currentNoExclude the current project from results (default: true)
only_existingNoDrop entries whose decoded path no longer exists on disk (default: true)
limitNoMax sessions to return, most recently active first (default: 50)
add_as_subprojectsNoRegister every discovered project as a subproject in one shot (default: false)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: scanning a specific directory, decoding paths, checking existence, counting session files, reporting last activity, and the batch registration capability. It covers the tool's scope and practical use case, though it could mention performance considerations like scan time or error handling.

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?

The description is appropriately sized with two sentences that are front-loaded with core functionality and followed by a practical use case. Every sentence adds value: the first explains the tool's operations, and the second highlights a key feature and its utility, with zero redundant or vague phrasing.

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?

Given the tool's moderate complexity (5 parameters, no output schema, no annotations), the description is mostly complete. It explains what the tool does, its key feature, and a use case. However, it lacks details on output format (e.g., structure of reported data) and potential side effects (e.g., impact of registering subprojects), which would enhance completeness for an agent.

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 the schema fully documents all 5 parameters. The description adds minimal parameter semantics by briefly explaining the effect of 'add_as_subprojects=true' and implying default behaviors (e.g., scanning ~/.claude/projects). It does not provide additional syntax, format, or examples beyond the schema, meeting the baseline for high coverage.

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's purpose with specific verbs ('scan', 'decode', 'report') and resources (~/.claude/projects, projects, session files). It distinguishes itself from siblings by focusing on discovering Claude Code sessions rather than analyzing code, refactoring, or other operations listed in the sibling tools.

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?

The description provides clear context for when to use the tool ('useful for spinning up multi-repo intelligence after a fresh clone') and mentions a specific parameter effect ('With add_as_subprojects=true, every existing project is registered as a subproject in one call'). However, it does not explicitly state when not to use it or name alternative tools for similar purposes.

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/nikolai-vysotskyi/trace-mcp'

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