Claw Help Claude

v1.0.0

Manage and persist multiple Claude Code CLI sessions via OpenClaw, enabling PTY-based session control, messaging, and lifecycle management.

0· 89·0 current·0 all-time
byAndy Tien@linux2010

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for linux2010/chc.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Claw Help Claude" (linux2010/chc) from ClawHub.
Skill page: https://clawhub.ai/linux2010/chc
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install chc

ClawHub CLI

Package manager switcher

npx clawhub@latest install chc
Security Scan
Capability signals
Requires OAuth tokenRequires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

claude-codevk97603svqk853177xhwq36j75h852qgklatestvk97603svqk853177xhwq36j75h852qgkptyvk97603svqk853177xhwq36j75h852qgksession-managementvk97603svqk853177xhwq36j75h852qgk
89downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

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/<uuid>.json

恢复现有会话:

{
  "runtime": "acp",
  "resumeSessionId": "<claude-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 - 会话管理辅助脚本(可选)

Comments

Loading comments...