← Back to Skills Marketplace
linux2010

Claw Help Claude

by Andy Tien · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
79
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install chc
Description
Manage and persist multiple Claude Code CLI sessions via OpenClaw, enabling PTY-based session control, messaging, and lifecycle management.
README (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 - 会话管理辅助脚本(可选)
Usage Guidance
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.
Capability Analysis
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.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install chc
  3. After installation, invoke the skill by name or use /chc
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
首次发布 - OpenClaw 管理 Claude Code CLI 生命周期
Metadata
Slug chc
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Claw Help Claude?

Manage and persist multiple Claude Code CLI sessions via OpenClaw, enabling PTY-based session control, messaging, and lifecycle management. It is an AI Agent Skill for Claude Code / OpenClaw, with 79 downloads so far.

How do I install Claw Help Claude?

Run "/install chc" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Claw Help Claude free?

Yes, Claw Help Claude is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Claw Help Claude support?

Claw Help Claude is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Claw Help Claude?

It is built and maintained by Andy Tien (@linux2010); the current version is v1.0.0.

💬 Comments