receive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReceiving Context
接收上下文
Received At: !
Context Directory: !
date '+%Y-%m-%d %H:%M:%S'[[ -d /tmp/claude-ctx ]] && echo "Exists" || echo "Does not exist - will create"Note: If does not exist, create it with:
/tmp/claude-ctx/bash
mkdir -p /tmp/claude-ctx
cat > /tmp/claude-ctx/README.md << 'EOF'接收时间: !
上下文目录: !
date '+%Y-%m-%d %H:%M:%S'[[ -d /tmp/claude-ctx ]] && echo "已存在" || echo "不存在 - 将创建"注意: 如果不存在,请使用以下命令创建:
/tmp/claude-ctx/bash
mkdir -p /tmp/claude-ctx
cat > /tmp/claude-ctx/README.md << 'EOF'Claude Context Handoff Directory
Claude Context Handoff Directory
This is an ephemeral directory for Claude Code session context handoff. Created by claude slash commands. '/context:send' and '/context:receive'.
EOF
---This is an ephemeral directory for Claude Code session context handoff. Created by claude slash commands. '/context:send' and '/context:receive'.
EOF
---Quick Example
快速示例
bash
/context:receive child api-implementationbash
/context:receive child api-implementation✓ Context received from child session
✓ 已从子级会话接收上下文
File: /tmp/claude-ctx/ctx-child-to-parent-api-implementation.md
文件: /tmp/claude-ctx/ctx-child-to-parent-api-implementation.md
---
---receive - Receive context from parent, child, or sibling session
receive - 从父级、子级或同级会话接收上下文
Read and integrate context from session handoff file.
读取并整合会话交接文件中的上下文。
Usage
使用方法
/context:receive parent [subject] [path]
/context:receive child [subject] [path]
/context:receive sibling [subject] [path]IMPORTANT: Direction is REQUIRED. Must be one of: , , or .
parentchildsiblingSubject and path are optional:
- subject: Claude will infer from context if not provided
- path: Defaults to if not provided
/tmp/claude-ctx/
/context:receive parent [subject] [path]
/context:receive child [subject] [path]
/context:receive sibling [subject] [path]重要提示:必须指定方向。方向只能是以下之一:、或。
parentchildsibling主题(subject)和路径(path)为可选参数:
- 主题:如果未提供,Claude将从上下文中推断
- 路径:如果未提供,默认值为
/tmp/claude-ctx/
What it does
功能说明
- Validates direction - Errors if direction is not parent|child|sibling
- Check "Context Directory" status above (from dynamic injection)
- Create directory only if status shows "Does not exist - will create"
- If creating directory, generates minimal README.md:
markdown
# Claude Context Handoff Directory This is an **ephemeral directory** for Claude Code session context handoff. Created by claude slash commands. '/context:send' and '/context:receive'. - Determines direction flow based on argument
- Records received timestamp (auto-captured)
- If subject provided, looks for
{path}/ctx-{direction}-{subject}.md - If no subject, uses wildcard: sorted by newest first
{path}/ctx-{direction}-*.md - Path defaults to but can be customized
/tmp/claude-ctx/ - Reads and displays context file with original timestamp from sender
- Integrates context into current session understanding
Important: When using wildcard (no subject), files are sorted by modification time with newest first, ensuring you get the most recent context.
File patterns:
- → looks for
/context:receive parent/tmp/claude-ctx/ctx-parent-to-child-*.md - → looks for
/context:receive child/tmp/claude-ctx/ctx-child-to-parent-*.md - → looks for
/context:receive sibling/tmp/claude-ctx/ctx-sibling-to-sibling-*.md
- 验证方向 - 如果方向不是parent|child|sibling则报错
- 检查上方的“上下文目录”状态(来自动态注入)
- 仅当状态显示“不存在 - 将创建”时才创建目录
- 如果创建目录,会生成极简的README.md:
markdown
# Claude Context Handoff Directory This is an **ephemeral directory** for Claude Code session context handoff. Created by claude slash commands. '/context:send' and '/context:receive'. - 根据参数确定方向流向
- 记录接收时间戳(自动捕获)
- 如果提供了主题,查找文件
{path}/ctx-{direction}-{subject}.md - 如果未提供主题,使用通配符:按最新排序
{path}/ctx-{direction}-*.md - 路径默认为,但可自定义
/tmp/claude-ctx/ - 读取并显示上下文文件,同时显示发送方的原始时间戳
- 将上下文整合到当前会话的理解中
重要提示:使用通配符(未指定主题)时,文件会按修改时间从新到旧排序,确保你获取到最新的上下文。
文件模式:
- → 查找
/context:receive parent/tmp/claude-ctx/ctx-parent-to-child-*.md - → 查找
/context:receive child/tmp/claude-ctx/ctx-child-to-parent-*.md - → 查找
/context:receive sibling/tmp/claude-ctx/ctx-sibling-to-sibling-*.md
Example: Receiving from Parent (Wildcard)
示例:从父级接收上下文(通配符方式)
/context:receive parent
✓ Searching for context files: /tmp/claude-ctx/ctx-parent-to-child-*.md (newest first)
✓ Found: /tmp/claude-ctx/ctx-parent-to-child-database-migration.md (modified 2 minutes ago)
[Context displayed with parent session details]
Ready to begin focused work based on parent's context!/context:receive parent
✓ 正在搜索上下文文件:/tmp/claude-ctx/ctx-parent-to-child-*.md(按最新排序)
✓ 找到:/tmp/claude-ctx/ctx-parent-to-child-database-migration.md(2分钟前修改)
[显示包含父级会话详情的上下文]
已准备好基于父级上下文开展聚焦工作!Example: Receiving from Child with Subject
示例:指定主题从子级接收上下文
/context:receive child api-implementation
✓ Context received from child session
File: /tmp/claude-ctx/ctx-child-to-parent-api-implementation.md
[Context displayed with completed work summary]
Child session completed. Integrating results back./context:receive child api-implementation
✓ 已从子级会话接收上下文
文件: /tmp/claude-ctx/ctx-child-to-parent-api-implementation.md
[显示包含已完成工作摘要的上下文]
子级会话已完成。正在整合结果。Example: Receiving from Sibling
示例:从同级接收上下文
/context:receive sibling parallel-task
✓ Context received from sibling session
File: /tmp/claude-ctx/ctx-sibling-to-sibling-parallel-task.md
[Context displayed with parallel work details]
Sibling session completed. Integrating parallel work./context:receive sibling parallel-task
✓ 已从同级会话接收上下文
文件: /tmp/claude-ctx/ctx-sibling-to-sibling-parallel-task.md
[显示包含并行工作详情的上下文]
同级会话已完成。正在整合并行工作。Example: Custom Path
示例:自定义路径
/context:receive parent database-work ~/Documents/context/
✓ Context received from parent session
File: ~/Documents/context/ctx-parent-to-child-database-work.md
[Context displayed]/context:receive parent database-work ~/Documents/context/
✓ 已从父级会话接收上下文
文件: ~/Documents/context/ctx-parent-to-child-database-work.md
[显示上下文]Example: Missing Direction (Error)
示例:未指定方向(错误)
/context:receive database-work
✗ Error: Must specify direction: parent, child, or sibling
Usage: /context:receive <parent|child|sibling> [subject] [path]/context:receive database-work
✗ 错误:必须指定方向:parent、child或sibling
使用方法:/context:receive <parent|child|sibling> [subject] [path]What gets loaded
加载内容
- Context file content: Decisions, work done, blockers, next actions
- Handoff metadata: Why the handoff occurred, what was planned
- Related context: Key information needed to continue
- 上下文文件内容:决策、已完成工作、障碍、下一步行动
- 交接元数据:交接原因、计划内容
- 相关上下文:继续工作所需的关键信息
When to use
使用场景
- Immediately after starting a new child session from parent
- After resuming parent session when child is complete
- When starting a sibling session and receiving context from another sibling
- When receiving context from any parent/child/sibling session
- To understand what happened in related session
- 从父级会话启动新的子级会话后立即使用
- 子级会话完成后恢复父级会话时使用
- 启动同级会话并从另一个同级接收上下文时使用
- 从任何父级/子级/同级会话接收上下文时使用
- 了解相关会话中发生的情况时使用
Related commands
相关命令
- - Send context to parent/child before switching
/context:send
- - 切换会话前向父级/子级发送上下文
/context:send