← 返回 Skills 市场
linux2010

Claw Help Claude

作者 Andy Tien · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
79
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install chc
功能描述
Manage and persist multiple Claude Code CLI sessions via OpenClaw, enabling PTY-based session control, messaging, and lifecycle management.
使用说明 (SKILL.md)

CHC - Claw Help Claude

OpenClaw 作为中介,管理 Claude Code CLI 的完整生命周期,实现用户与 Claude Code 的双向通信。

核心架构

用户 → OpenClaw → Claude Code CLI (PTY) → 代码/项目
                    ↓
              多实例管理

关键点:

  • Claude Code CLI 通过 PTY (伪终端) 运行,而非直接 API
  • OpenClaw 作为消息路由器,转发双方交互
  • 支持同时运行多个独立 Claude Code 实例
  • 会话持久化在 ~/.claude/sessions/

会话生命周期

1. 启动 Claude Code 会话

使用 sessions_spawn 创建后台 PTY 会话:

{
  "runtime": "acp",
  "mode": "session",
  "thread": true,
  "agentId": "claude-code",
  "cwd": "/path/to/project",
  "label": "project-name"
}

参数说明:

  • runtime: "acp" - ACP 模式,适合 Claude Code CLI
  • mode: "session" - 持久化会话(推荐)
  • thread: true - 线程绑定,便于追踪
  • cwd - Claude Code 工作目录

2. 发送消息到 Claude Code

使用 sessions_send 或直接 PTY write:

{
  "sessionKey": "young-falcon",
  "message": "分析这个项目的代码结构"
}

PTY 模式(更直接):

process(action=write, sessionId="xxx", data="用户消息")
process(action=send-keys, keys=["Enter"])

3. 接收 Claude Code 输出

使用 process(action=poll) 获取输出:

{
  "action": "poll",
  "sessionId": "young-falcon",
  "timeout": 120000
}

4. 管理多个实例

查看所有运行的 Claude Code 会话:

sessions_list(kinds=["acp"])
subagents(action=list)

监控特定会话状态:

process(action=poll, sessionId="xxx", limit=100)

终止会话:

process(action=kill, sessionId="xxx")

5. 会话恢复

Claude Code 会话持久化在 ~/.claude/sessions/\x3Cuuid>.json

恢复现有会话:

{
  "runtime": "acp",
  "resumeSessionId": "\x3Cclaude-session-uuid>",
  "agentId": "claude-code"
}

实例管理最佳实践

实例命名约定

使用语义化 label 区分不同项目:

  • young-falcon - 测试/临时会话
  • hermes-main - Hermes 项目主会话
  • coding-pr - PR 审查专用

多实例场景

场景 实例数 建议
单项目开发 1 保持单一实例
多项目并行 2-3 每项目独立实例
PR 审查 + 开发 2 分离审查实例

资源监控

定期检查实例状态:

  • Token 使用量(通过 Claude Code 输出)
  • 运行时长(避免过长会话)
  • 响应延迟(判断是否需要重启)

Claude Code CLI 配置参考

详见 references/config.md

关键配置文件:

  • ~/.claude/settings.json - API 配置
  • ~/.claude/sessions/*.json - 会话持久化

常见问题

Q: Claude Code 无响应?

检查:

  1. 会话是否仍在运行 (sessions_list)
  2. PTY 是否卡住(尝试发送空消息唤醒)
  3. 是否需要重启实例

Q: 如何切换项目?

在现有实例中发送:

/cd /path/to/new/project

或启动新实例指向新目录。

Q: 会话历史丢失?

Claude Code 自动保存历史到 ~/.claude/sessions/。 使用 resumeSessionId 恢复。

资源文件

  • references/config.md - Claude Code CLI 配置详解
  • scripts/session_manager.py - 会话管理辅助脚本(可选)
安全使用建议
This skill appears to do what it says: manage local Claude Code CLI sessions via PTYs and persist session files under ~/.claude. Before installing: (1) inspect and back up your ~/.claude/sessions and ~/.claude/settings.json if you care about existing session history, because the included clean operation can delete files; (2) verify the ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN settings in your Claude config so you know where messages will be sent — the skill will forward user messages to the configured Claude endpoint, so don’t expose secrets via those sessions; (3) because the skill owner is unknown, prefer testing in a safe account/environment first; (4) if you don’t want automatic deletion of old sessions, avoid running the clean command or review the script to change behavior. Overall risk is low but exercise normal caution around session data and external API endpoints.
功能分析
Type: OpenClaw Skill Name: chc Version: 1.0.0 The skill bundle is a legitimate integration for managing the Claude Code CLI lifecycle within OpenClaw. The Python script `scripts/session_manager.py` provides administrative functions like listing and cleaning session files in the standard `~/.claude/` directory and explicitly avoids printing sensitive API tokens. The instructions in `SKILL.md` and documentation in `references/config.md` are well-structured, functional, and contain no evidence of malicious prompt injection, data exfiltration, or unauthorized execution.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
Name/description (PTY-based management of Claude Code CLI sessions) matches the SKILL.md and the included session_manager.py: both focus on listing, showing, cleaning, and inspecting session/config files under ~/.claude. No unrelated binaries, environment variables, or external services are required by the skill itself.
Instruction Scope
Runtime instructions direct the agent to create/drive PTY sessions and to read/write session files in ~/.claude/sessions and settings in ~/.claude/settings.json — which is appropriate for session management. Be aware that messages forwarded to Claude Code will travel to whatever endpoint is configured in the user's Claude settings (ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN), so sensitive data in messages could be sent to external APIs depending on the user's configuration.
Install Mechanism
There is no install spec (instruction-only) and only a simple helper script included. Nothing is downloaded or extracted from remote URLs and no packages are installed, so install risk is low.
Credentials
The skill declares no required environment variables or credentials. The references/config.md documents how Claude Code may be configured (ANTHROPIC_* env keys inside ~/.claude/settings.json) but those are examples for the Claude CLI, not requirements imposed by this skill — this is proportionate to the stated purpose.
Persistence & Privilege
always is false and autonomous invocation is allowed (platform default). The skill reads and can delete files in ~/.claude/sessions (clean command removes stale session files), which is within its self-contained scope but is destructive to session history if run unintentionally.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chc
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chc 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
首次发布 - OpenClaw 管理 Claude Code CLI 生命周期
元数据
Slug chc
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Claw Help Claude 是什么?

Manage and persist multiple Claude Code CLI sessions via OpenClaw, enabling PTY-based session control, messaging, and lifecycle management. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 79 次。

如何安装 Claw Help Claude?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chc」即可一键安装,无需额外配置。

Claw Help Claude 是免费的吗?

是的,Claw Help Claude 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Claw Help Claude 支持哪些平台?

Claw Help Claude 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claw Help Claude?

由 Andy Tien(@linux2010)开发并维护,当前版本 v1.0.0。

💬 留言讨论