threads

A command that lists the conversation threads available in the thread-manager service. Threads are separate ongoing conversations, each with its own status and message history.

In plain words
What is it for?
Use it with options such as sorting by recent activity or message count, filtering by tags, and limiting the number of results. The required thread-manager service must be configured first.
Why use it?
It gives you one place to find, filter, sort, and limit threads instead of searching through them manually.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/peterfei/ai-agent-team/threads
Clone the repo
git clone --depth 1 https://github.com/peterfei/ai-agent-team

Made for: Claude Code.

Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00006 $0.00670
Opus 5 $0.00003 $0.00335
Sonnet 5 $0.00001 $0.00134
Haiku 4.5 $0.00001 $0.00067

Measured 2d ago against content hash b7ec8f4c32b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

threads scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/threads.md · 94 lines

What it actually says

List Threads Command

List all available conversation threads with their status and statistics.

Usage

/threads [options]

Options

  • --sort [field]: Sort by updatedAt, createdAt, or messageCount (default: updatedAt)
  • --order [asc|desc]: Sort order (default: desc)
  • --tags [tag1,tag2]: Filter by tags
  • --limit [number]: Limit the number of results (default: 50)

Implementation Details for Claude

⚠️ 前置检查(最高优先级)

在执行任何操作之前,必须先检查 thread-manager MCP 服务器是否可用。

判断方法:检查当前可用的工具列表中是否包含 mcp__thread-manager__list_threads 工具。

如果 MCP 工具不可用,必须立即输出以下错误信息并停止,不要尝试调用任何工具:

❌ thread-manager MCP 服务器未配置

当前项目未配置 thread-manager MCP 服务器,无法使用线程管理功能。

🔧 解决方案:

方案 1:全局安装(推荐,一次配置全局可用)
   claude mcp add thread-manager -s user -- node <path-to-thread-manager>/dist/index.js

方案 2:项目级安装
   claude mcp add thread-manager -s project -- node <path-to-thread-manager>/dist/index.js

方案 3:切换到已配置该服务的项目目录

添加后需要重启 Claude Code 会话才能生效。

🔴 重要:绝对不要在 MCP 不可用时尝试调用工具,这会导致命令卡住无响应!


正常流程

When the user invokes /threads, call the thread-manager.list_threads tool.

Example: If user types: /threads --sort messageCount You call:

use_mcp_tool({
  server_name: "thread-manager",
  tool_name: "list_threads",
  arguments: {
    sortBy: "messageCount"
  }
});

Output Format: Please format the output as a compact table with the following structure:

 状态  标题                          ID         消息   文件   更新时间
────────────────────────────────────────────────────────────────────────
 ✅   [当前线程标题]                 [short-id]  [n]    [n]   [时间]
      [其他线程标题]                 [short-id]  [n]    [n]   [时间]
      [描述] (如果有)
      ...
────────────────────────────────────────────────────────────────────────
总计: [n] 个线程

格式要求:

  • 当前活跃线程用 ✅ 标记
  • ID 显示前 8 位短 ID
  • 如果线程有描述,在标题下方缩进显示
  • 消息列显示消息数量
  • 文件列显示文件变更数量
  • 更新时间使用相对时间(如:刚刚、3分钟前、1小时前)
  • 表格使用 ASCII 字符分隔线
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 94 lines · 6 tokens per session scan A b7ec8f4c32b9

Subscribe to this mod's changes

threads is a command published in the GitHub repository peterfei/ai-agent-team (428 stars, last pushed 2mo ago), licensed MIT. It adds 6 tokens to every session and 670 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.