Skip to main content
Glama

claude_resume

Resume a headless Claude Code CLI session by session_id to continue edits or verification with the same context.

Instructions

按 session_id 续跑已有的无头 Claude Code CLI 会话(--resume),保持同一上下文继续修改或核查。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>",
      "prompt": "<prompt>",
      "cwd": "<cwd>"
    },
    "name": "claude_resume"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYes目标工作目录绝对路径(必须存在)。
asyncNo可选是否立即异步启动并转后台返回 task_id(等效于 wait_ms: 0)。
modelNo可选切换的模型名。
effortNo可选推理强度档位(low | medium | high | xhigh | max)。
promptYes本轮追加的指令或反馈。
wait_msNo可选本次调用同步等待时长(毫秒,0~165000,默认 150000 即 2.5 分钟)。超期仍未完成时平滑转后台返回 task_id;传 0 立即异步返回。
role_nameNo可选成员职能显示名(如"前端开发"、"后端联调"),用于看板主标题展示。
thread_idNo可选工作线 ID,若存在则自动将该任务归入对应 thread。
session_idYes需要续跑的 Claude 会话 ID。
timeout_msNo可选执行超时时间(毫秒),默认与上限均为 1800000(30 分钟)。
allowed_toolsNo可选允许自动使用的工具列表(传给 --allowedTools)。
permission_modeNo可选权限模式(default 不传该标志;支持 acceptEdits、auto、bypassPermissions、manual、dontAsk、plan)。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

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 load. It usefully discloses that the session is headless and that context is shared across the resume, and the word 修改 hints at mutation, but it says nothing about permissions required, whether earlier output is preserved, or what the call actually returns. The sync-to-background switching behavior is only implied via the schema, not the description.

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 that identifies the resource and the mechanism without filler. It is arguably too terse for a 12-parameter mutation tool, but nothing in it is wasted.

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?

For a resume-in-place tool this states the essential contract. Given the rich 12-parameter schema and no output schema, an agent still lacks guidance on the returned task_id / background transition, but the core semantics needed to invoke it correctly are present.

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 every one of the 12 parameters is already documented in the schema, making 3 the baseline. The description only reinforces that session_id identifies the session to resume and that the prompt is appended to existing context; it adds no format or interaction details beyond the schema.

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 names a specific verb (续跑/resume) and resource (an existing headless Claude Code CLI session) and gives the underlying mechanism (--resume) plus the goal (keep the same context to continue modifying or verifying). It implicitly contrasts with starting a new run, though it never names claude_run as the alternative.

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?

It makes the precondition clear — you must already hold a session_id from a prior run — which implies when to use it. But it never states when NOT to use it (e.g. no existing session, use claude_run instead) nor how it interacts with claude_list_sessions to discover IDs.

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