← 返回
开发者工具 中文

Cc

Claude Code relay via tmux. Operate Claude Code remotely — start sessions, send messages, read output. Use when the user wants to interact with Claude Code f...
通过 tmux 中继 Claude Code,远程启动会话、发送消息、读取输出。适用于用户想与 Claude Code 交互的场景。
artwalker
开发者工具 clawhub v2.1.0 2 版本 100000 Key: 无需
★ 0
Stars
📥 1,124
下载
💾 5
安装
2
版本
#latest

概述

cc — Claude Code Relay

Operate Claude Code remotely from any OpenClaw channel via tmux.

Continues your existing claude -c sessions — ACP creates new sessions, cc connects to what's already running.

Language: Always reply in the same language the user uses.

Script

{baseDir}/scripts/cc.sh <command> [args...]

Commands

CommandAction
-----------------
/cc on Start session (claude -c in project dir)
/cc off [project]Stop session
/cc ?Check Claude Code status (running/idle/dead)
/cc tail [project] [lines]Show recent output
/cc projectsList available projects
/cc statusList active sessions
/cc config root Set project root directory
/ccShow help + project list
/cc Send message to Claude Code

Relay Mode (CRITICAL)

After /cc on , you enter relay mode:

  1. ALL user messages are forwarded to Claude Code — NEVER answer yourself
  2. Only messages NOT forwarded: /cc off, /cc ?, /cc tail, /cc status, /cc projects, /cc config
  3. Relay mode ends on /cc off

You are a transparent pipe. Never interpret, analyze, or answer the user's question yourself.

Starting a Session

  1. Run: scripts/cc.sh on
  2. Report to user:

```

✅ Claude Code session started for

Your messages will now be sent directly to Claude Code.

Send /cc off to exit relay mode.

```

  1. Enter relay mode

Sending Messages (relay flow)

When user sends a message in relay mode:

  1. Immediately reply: ⏳ (so user knows message was received)
  2. Forward: scripts/cc.sh ""
  3. The script returns the incremental output — only content from this reply, not history
  4. Return output to user (see Output Formatting below)

Stopping a Session

  1. Run: scripts/cc.sh off
  2. Report to user:

```

Session ended. You're back to normal chat.

```

Status Check (/cc ?)

Run: scripts/cc.sh check

Report result to user:

  • "🟢 Claude Code is running and waiting for input"
  • "🔄 Claude Code is processing..."
  • "🔴 Claude Code process died — try /cc off then /cc on to restart"
  • "⚪ No active session"

/cc (no arguments)

Run scripts/cc.sh projects. Show brief help + project list.

If there's a last-used project (marked with ★), show it first. Keep the response short — just names, no paths.

First-time Setup

When scripts/cc.sh projects outputs SETUP_NEEDED (exit 100):

  1. Check: which tmux and which claude — report if missing
  2. Ask user: "Where are your projects? (e.g., ~/projects)"
  3. Run: scripts/cc.sh config root
  4. List projects to confirm

Output Formatting

If output ≤ 4000 characters: wrap in one code block and send.

If output > 4000 characters: send a summary of the key output (first meaningful paragraph + last 10 lines), then add:

"Full output: send /cc tail to see more"

Always: strip ANSI escape codes (the script handles this automatically).

Requirements

  • tmux installed
  • claude CLI installed (npm i -g @anthropic-ai/claude-code)
  • Any OpenClaw channel (Telegram, Discord, CLI, etc.)

版本历史

共 2 个版本

  • v2.1.0 当前
    2026-05-03 03:13 安全 安全
  • v1.1.0
    2026-03-29 13:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,164
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,780
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,072