inbox

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Inbox - Read Inter-Agent Messages

收件箱 - 读取代理间消息

Check and read messages sent to this session's inbox from other agents or sessions.
查看和读取从其他代理或会话发送到本次会话收件箱的消息。

When to Use

适用场景

  • Another agent mentions sending a message
  • Starting work on a task that may have been handed off
  • Coordinating with other Claude sessions
  • Checking for pending messages or recent communications
  • 其他代理提及已发送消息
  • 开始处理可能已移交的任务
  • 与其他Claude会话协作
  • 检查待处理消息或近期通信

How It Works

工作原理

Each hive session has a unique inbox topic (
agent.<id>.inbox
). Other agents publish messages to this inbox, readable via the commands below.
By default, messages are NOT marked as read. Use
--ack
to acknowledge messages.
每个hive会话都有一个唯一的收件箱主题(
agent.<id>.inbox
)。其他代理会将消息发布到该收件箱,可通过以下命令读取。
默认情况下,消息不会被标记为已读。使用
--ack
参数可确认消息。

Commands

命令

Read Unread Messages (Default)

读取未读消息(默认)

bash
hive msg inbox
Shows unread messages without marking them as read.
bash
hive msg inbox
显示未读消息且不标记为已读。

Read and Acknowledge

读取并确认

bash
hive msg inbox --ack
Shows unread messages and marks them as read so they won't appear again.
bash
hive msg inbox --ack
显示未读消息并将其标记为已读,使其不会再次显示。

Read All Messages

读取所有消息

bash
hive msg inbox --all
Shows all messages (read and unread).
bash
hive msg inbox --all
显示所有消息(已读和未读)。

Specify Session Explicitly

显式指定会话

bash
hive msg inbox --session <id|name>
Overrides auto-detection from working directory. Useful when running outside a session directory.
bash
hive msg inbox --session <id|name>
覆盖从工作目录自动检测的会话。在会话目录外运行时非常有用。

Wait for a Message

等待消息

bash
hive msg inbox --wait
hive msg inbox --wait --timeout 2m
Blocks until a message arrives. Default timeout is 24h for wait mode.
bash
hive msg inbox --wait
hive msg inbox --wait --timeout 2m
阻塞直到消息到达。等待模式下的默认超时时间为24小时。

Poll for New Messages

轮询新消息

bash
hive msg inbox --listen --timeout 30s
Continuously polls and outputs new messages until timeout.
bash
hive msg inbox --listen --timeout 30s
持续轮询并输出新消息,直到超时。

Limit Results

限制结果数量

bash
hive msg inbox --tail 5
Returns only the last N unread messages.
bash
hive msg inbox --tail 5
仅返回最后N条未读消息。

Output Format

输出格式

All output is JSON Lines (one JSON object per line) on stdout. Fields:
  • id
    - Unique message identifier
  • topic
    - The inbox topic (
    agent.<id>.inbox
    )
  • payload
    - The message text
  • sender
    - Who sent the message (session ID or custom sender)
  • session_id
    - Sender's session ID (if auto-detected)
  • created_at
    - ISO 8601 timestamp
On timeout (
--listen
/
--wait
), a JSON status line is printed and exit code is 1.
所有输出以JSON Lines格式(每行一个JSON对象)输出到标准输出。字段包括:
  • id
    - 唯一消息标识符
  • topic
    - 收件箱主题(
    agent.<id>.inbox
  • payload
    - 消息文本
  • sender
    - 消息发送方(会话ID或自定义发送方)
  • session_id
    - 发送方的会话ID(若自动检测到)
  • created_at
    - ISO 8601时间戳
超时(
--listen
/
--wait
)时,会打印一条JSON状态行,退出码为1。

Common Workflows

常见工作流

Basic Message Check

基本消息检查

bash
hive msg inbox
Read and act on any unread messages.
bash
hive msg inbox
读取并处理所有未读消息。

Handle Coordinated Handoff

处理协作移交

When another agent hands off work:
bash
undefined
当其他代理移交工作时:
bash
undefined

Check inbox for handoff message

检查收件箱中的移交消息

hive msg inbox
hive msg inbox

Read referenced task details

读取相关任务详情

bd show <issue-id>
undefined
bd show <issue-id>
undefined

Review Message History

查看消息历史

bash
hive msg inbox --all
bash
hive msg inbox --all

Additional Resources

额外资源

For troubleshooting and advanced usage patterns, see:
  • references/troubleshooting.md
    - Common issues and solutions
有关故障排除和高级使用模式,请参阅:
  • references/troubleshooting.md
    - 常见问题及解决方案

Related Skills

相关技能

  • /hive:publish
    - Send messages to other agents
  • /hive:wait
    - Wait for specific messages with timeout
  • /hive:session-info
    - Get current session details and inbox topic
  • /hive:publish
    - 向其他代理发送消息
  • /hive:wait
    - 等待特定消息并设置超时
  • /hive:session-info
    - 获取当前会话详情和收件箱主题