ai-agent-team: Command for Claude Code

.claude/commands/thread.md

thread is a command for Claude Code from peterfei/ai-agent-team. It costs 16 tokens per session (1,445 once invoked), scanned A, original, MIT.

A command set for organizing conversation threads. It can create, switch, update, delete, and display thread details.

In plain words
What is it for?
Use it to start a named task, move between ongoing tasks, change thread details, inspect thread information, or permanently remove a thread.
Why use it?
It keeps separate tasks and discussions from getting mixed together. Thread titles, descriptions, and tags make conversations easier to find and manage.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

This is peterfei/ai-agent-team's own configuration. It tells Claude Code how to work on ai-agent-team itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-agent-team configures →

Reuse

Borrowing it

Nothing to install: this file belongs to peterfei/ai-agent-team. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/peterfei/ai-agent-team/main/.claude/commands/thread.md
Clone the repo
git clone --depth 1 https://github.com/peterfei/ai-agent-team

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for thread

README.md
[![agentmods](https://agentmods.dev/badge/commands/peterfei/ai-agent-team/thread/github.svg)](https://agentmods.dev/commands/peterfei/ai-agent-team/thread)
Your own site
<a href="https://agentmods.dev/commands/peterfei/ai-agent-team/thread"><img src="https://agentmods.dev/badge/commands/peterfei/ai-agent-team/thread/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for thread

Your own site · 80×15
<a href="https://agentmods.dev/commands/peterfei/ai-agent-team/thread"><img src="https://agentmods.dev/badge/commands/peterfei/ai-agent-team/thread.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,445 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00016 $0.01445
Opus 5.5 $0.00006 $0.00578
Sonnet 5.5 $0.00003 $0.00289
Haiku 4.5 $0.00002 $0.00145

Measured 1mo ago against content hash 74068be8d7b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

thread 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 1mo 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/thread.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Thread Manager Command

This command allows you to manage conversation threads using the thread-manager MCP server.

Usage

  • /thread new "Title" [options]: Create a new thread
  • /thread switch <id>: Switch to a specific thread
  • /thread update [options]: Update current thread metadata
  • /thread delete <id>: Delete a thread
  • /thread show [id]: Show thread details
  • /thread or /thread info: Show current thread info

Subcommands

New Thread

Create a new thread and optionally switch to it.

/thread new "Implement User Auth" --tags backend,auth

Options:

  • --desc "Description": Add a description
  • --tags tag1,tag2: Add tags (comma separated)
  • --no-switch: Do not switch to the new thread immediately

Switch Thread

Switch context to another thread.

/thread switch <thread-id>
/thread <thread-id>

Update Thread

Update the metadata of the current or specified thread.

/thread update --title "New Title" --add-tags tag3

Delete Thread

Delete a thread permanently.

/thread delete <thread-id> --confirm

Show/Info

Show details about a thread.

/thread show <thread-id>
/thread info  # Shows current thread

Implementation Details for Claude

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

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

判断方法:检查当前可用的工具列表中是否包含 mcp__thread-manager__* 系列工具(如 mcp__thread-manager__list_threads、mcp__thread-manager__switch_thread 等)。

如果 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 不可用时尝试调用工具,这会导致命令卡住无响应!


正常流程

当用户调用此命令时,您应该:

  1. 检查 MCP 可用性:确认 mcp__thread-manager__* 工具存在。如不存在,输出上述错误信息并停止。
  2. 解析子命令:识别它是 new、switch、update、delete、show 还是 ID(这意味着切换)。
  3. 调用相应的 MCP 工具:
    • new -> thread-manager.create_thread
    • switch 或 <id> -> thread-manager.switch_thread
    • list -> thread-manager.list_threads
    • update -> thread-manager.update_thread
    • delete -> thread-manager.delete_thread
    • show 或 info -> thread-manager.get_thread 或 thread-manager.get_current_thread
  4. 格式化输出:将结果美观地呈现给用户。

Read the full file on GitHub · 189 lines

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. 1mo ago First seen · 189 lines · 16 tokens per session scan A 74068be8d7b5

Subscribe to this mod's changes

thread is a command published in the GitHub repository peterfei/ai-agent-team (448 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 1,445 once invoked, about $0.0001 per session on Opus 5.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.