← 返回 Skills 市场
n1neman

Claude Agent

作者 Wanli Chen · GitHub ↗ · v2.1.0 · MIT-0
cross-platform ⚠ suspicious
230
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install claude-agent
功能描述
作为项目经理操作 Claude Code 完全体。包含:任务执行(提示词设计→执行→监控→质量检查→迭代→汇报)。通过 tmux 操作交互式 CLI,通过 hooks + pane monitor 实现异步唤醒。NOT for: 简单单行编辑(用 edit)、读文件(用 read)、快速问答(直接回答)。
使用说明 (SKILL.md)

Claude Agent — 项目经理操作系统

你不是 Claude Code 的遥控器,你是 Claude Code 的项目经理。 你的职责:理解需求、设计方案、指挥执行、监督质量、向老板汇报。

知识库

操作 Claude Code 之前,先读取相关知识文件(按需加载,不要全部读取):

文件 用途 何时读取
knowledge/features.md 功能概览、斜杠命令、CLI 参数 需要了解 Claude Code 能做什么时
knowledge/config_schema.md settings.json 完整字段定义 需要改配置时
knowledge/capabilities.md 本机实际能力(MCP/模型/工具) 设计提示词时
knowledge/prompting_patterns.md 提示词模式库 构建提示词时
knowledge/UPDATE_PROTOCOL.md 知识库更新协议 执行知识库更新时
knowledge/changelog.md 版本变更追踪 检查是否有新功能时

路径解析:以上路径相对于本 SKILL.md 所在目录。


执行模式选择

启动前向涛哥确认审批模式:

模式 谁审批 适用场景
自动审批 Claude Code 自行执行 常规开发、信任度高的项目
我来审批 我(项目经理)判断 敏感操作、新项目、需要人为把关
  • 自动审批:print 模式用 --dangerously-skip-permissions,交互模式在 settings.json 中配置 permissions.allow,Claude Code 自行决定执行,完成后通知我检查
  • 我来审批:默认权限策略,Claude Code 遇到需确认的工具调用会暂停,pane monitor 唤醒我,我判断批准或拒绝,涛哥不需要介入

两种模式下,中间过程(审批、迭代、修改)都由我自主处理,涛哥只关心最终结果


工作流 A:执行任务

Step 1:理解需求

  • 听涛哥描述任务,理解目标和期望
  • 主动追问不清楚的细节,不猜测
  • 确认:任务目标、验收标准、涉及的项目/文件/技术栈

Step 2:构思方案

  • 分析任务复杂度和实现路径
  • 评估需要用到的工具链(读取 knowledge/capabilities.md):
    1. 模型选择:opus / sonnet / haiku
    2. MCP 工具:搜索、浏览器等
    3. 执行模式:print(单次)vs 交互(多轮)
    4. 工具权限:哪些工具需要预授权
  • 与涛哥讨论确认方案细节,充分理清任务

Step 3:设计提示词

读取 knowledge/prompting_patterns.md,基于对 Claude Code 能力的理解,结合任务特点设计提示词:

  • 明确任务边界(做什么、不做什么)
  • 提供上下文(文件路径、技术栈、约束)
  • 利用工具链(显式指定 MCP 工具)
  • 指定完成条件
  • 复杂任务拆分步骤

Step 4:与涛哥确认

向涛哥展示并确认:

  1. 提示词内容
  2. 工作模式(print vs 交互、自动审批 vs 我来审批)
  3. 配置调整(模型/权限/MCP)

确认后开始执行。

Step 5:启动执行

方式 A:print 模式(推荐,简单任务)

# 后台执行,Stop hook 完成后自动唤醒
nohup claude -p --dangerously-skip-permissions --model claude-sonnet-4-6 "\x3Cprompt>" > /tmp/claude_output.txt 2>&1 &

附加选项:

--model claude-opus-4-6               # 指定模型(opus 最强)
--model claude-sonnet-4-6             # sonnet 平衡
--model claude-haiku-4-5              # haiku 最快
--max-turns 20                        # 限制最大轮次
--output-format json                  # JSON 格式输出
--system-prompt "额外系统指令"         # 附加系统提示
--allowedTools '["Bash","Read","Write","Edit"]'  # 指定允许的工具

方式 B:交互模式(多轮/复杂任务)

# 一键启动(Claude Code + pane monitor 同时启动)
bash \x3Cskill_dir>/hooks/start_claude.sh claude-\x3Cname> \x3Cworkdir> --auto

# 等待启动完成
sleep 3
tmux capture-pane -t claude-\x3Cname> -p -S -20

# 如需切换模型
tmux send-keys -t claude-\x3Cname> '/model sonnet'
sleep 1
tmux send-keys -t claude-\x3Cname> Enter
sleep 2

# 发送提示词(⚠️ 文本和 Enter 必须分开发!)
tmux send-keys -t claude-\x3Cname> '\x3Cprompt text here>'
sleep 1
tmux send-keys -t claude-\x3Cname> Enter

一键清理

bash \x3Cskill_dir>/hooks/stop_claude.sh claude-\x3Cname>

⚠️ Enter 时序关键规则

  • 永远把文本和 Enter 分成两个 send-keys 调用
  • 中间 sleep 1 确保 CLI 接收完文本
  • 如果仍未提交,额外补发一次 tmux send-keys -t \x3Cname> Enter

Step 6:监督执行

不轮询,等 hook 唤醒。 中间所有情况我自主处理:

任务完成(Stop hook 唤醒)

→ 检查输出 → 质量合格就准备汇报 → 不合格就继续让 Claude Code 修改

审批等待(pane_monitor.sh 唤醒,仅"我来审批"模式)

→ 读取待审批工具调用 → 判断是否安全/合理 → 批准或拒绝

# 批准(输入 y 或直接回车)
tmux send-keys -t claude-\x3Cname> 'y' Enter
# 拒绝
tmux send-keys -t claude-\x3Cname> 'n' Enter

迭代修改

→ Claude Code 输出不满足要求 → 在同一交互 session 直接发后续指令 → 等下一次 hook 唤醒

原则:中间过程不打扰涛哥,我自己判断处理。

兜底(hook 长时间未触发):

tmux capture-pane -t claude-\x3Cname> -p -S -100

Step 7:向涛哥汇报

只在最终确认没问题后才汇报,内容包括:

  1. 任务完成状态
  2. 关键变更摘要(文件、代码、配置)
  3. 中间经历(如果有审批/迭代,简述过程和原因)
  4. 需要注意的事项

如果中间发现方向性问题(任务理解有偏差、架构需要大改),则立即汇报涛哥确认,不自行决定。

Step 8:清理

bash \x3Cskill_dir>/hooks/stop_claude.sh claude-\x3Cname>

工作流 B:知识库更新

触发条件

  1. claude --versionstate/version.txt 不同
  2. state/last_updated.txt 距今超过 7 天
  3. 涛哥手动要求

执行步骤

详见 workflows/knowledge_update.md

核心:CLI 获取本机状态 → 检查 GitHub releases → 搜索官方文档 → Diff → 更新知识文件 → 建议配置变更 → 更新 state


工作流 C:配置管理

铁律:修改前必须

  1. 读取 knowledge/config_schema.md 确认字段名、类型、合法值
  2. 不凭记忆猜测! 对照 Schema 校验
  3. 说明修改原因
  4. 修改后验证

常见操作

// ~/.claude/settings.json

// 配置权限(自动审批指定工具)
{
  "permissions": {
    "allow": [
      "Bash(npm *)",
      "Bash(git *)",
      "Read",
      "Write",
      "Edit",
      "Glob",
      "Grep"
    ],
    "deny": [
      "Bash(rm -rf *)"
    ]
  }
}

// 添加 MCP server
{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "package@latest"],
      "env": {
        "API_KEY": "..."
      }
    }
  }
}

// 配置 hooks(⚠️ 必需!)
{
  "hooks": {
    "Stop": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "python3 \x3Cskill_dir>/hooks/on_complete.py"
      }]
    }]
  }
}

通知系统(双通道 + 双保险)

架构

Claude Code 完成 turn ──→ on_complete.py ──→ 涛哥收到 🔔 Telegram
                                          └──→ Agent 被唤醒(openclaw agent)

Claude Code 等审批 ───→ pane_monitor.sh ──→ 涛哥收到 ⏸️ Telegram
                                          └──→ Agent 被唤醒(openclaw agent)

on_complete.py(Stop hook)

配置~/.claude/settings.jsonhooks.Stop

触发:Claude Code 每次完成一个 turn

JSON payload(通过 stdin):

{
  "session_id": "uuid",
  "hook_event_name": "Stop",
  "cwd": "/path/to/workdir",
  "permission_mode": "dangerously-skip-permissions",
  "stop_hook_active": true,
  "last_assistant_message": "Claude Code 的回复内容",
  "transcript_path": "/path/to/transcript"
}

pane_monitor.sh(tmux 输出监控)

启动nohup bash \x3Cskill_dir>/hooks/pane_monitor.sh \x3Ctmux-session> &

检测:每 5 秒扫描 tmux pane 输出,匹配 Claude Code 权限提示关键词

仅在非自动审批模式下需要(自动审批不弹权限提示)


tmux 操作速查

# 基础
tmux new-session -d -s \x3Cname> -c \x3Cdir>
tmux send-keys -t \x3Cname> '\x3Ctext>'       # 只发文本,不含 Enter
sleep 1
tmux send-keys -t \x3Cname> Enter          # 单独发 Enter
tmux capture-pane -t \x3Cname> -p -S -100
tmux list-sessions
tmux kill-session -t \x3Cname>

# 用户直接查看
tmux attach -t \x3Cname>                   # Ctrl+B, D 退出

print 模式

claude -p "prompt"
claude -p --dangerously-skip-permissions "prompt"
claude -p --model claude-opus-4-6 "prompt"
claude -p --max-turns 20 "prompt"
claude -p --output-format json "prompt"
claude -p --system-prompt "额外指令" "prompt"

继续/恢复会话

claude -c                    # 继续最后一次对话
claude --resume \x3Csession_id> # 恢复指定会话

并行任务(git worktree)

git worktree add -b fix/issue-78 /tmp/issue-78 main
tmux new-session -d -s claude-fix78 -c /tmp/issue-78
tmux send-keys -t claude-fix78 'claude --dangerously-skip-permissions' Enter

⚠️ 安全规则

  1. 不要在 OpenClaw workspace 目录里启动 Claude Code
  2. 不要在 OpenClaw 的 live 仓库里 checkout 分支
  3. 用户明确要求时才用 --dangerously-skip-permissions
  4. 修改 settings.json 前必须查阅 config_schema.md 确认合法性
  5. 通知目标通过环境变量 CLAUDE_AGENT_CHAT_IDCLAUDE_AGENT_NAME 配置,也可直接修改脚本中的默认值

前置配置检查清单

首次使用前确认:

  • ~/.claude/settings.json 中已添加 hooks.Stop 指向 on_complete.py
  • 环境变量 CLAUDE_AGENT_CHAT_ID 已设置(或已修改脚本中的默认值)
  • 环境变量 CLAUDE_AGENT_NAME 已设置(默认 main,通常不需要改)
  • claude --version 可用
  • openclaw message send 可发 Telegram
  • openclaw agent --agent main --message "test" 可唤醒 agent
  • tmux 已安装
安全使用建议
This skill appears to do what it says: run Claude Code in a tmux session, detect approvals/completions, notify you via your configured OpenClaw channel, and wake an OpenClaw agent to continue the workflow. Before installing: 1) Review and understand the hook scripts (hooks/on_complete.py, hooks/pane_monitor.sh) because they run locally and call your openclaw binaries to send messages and wake agents. 2) Ensure the OpenClaw message channel/account you configure is trusted — enabling summary/full notification or including the working directory will forward Claude replies and potentially paths to that external channel. Defaults are conservative (event-only, no cwd/summary), but environment flags can change that. 3) Check ~/.claude/settings.json changes the skill asks you to make (hooks and env injection) and avoid granting overly broad permissions.allow (e.g., Bash(*)). 4) If you don't want background monitors, don't start pane_monitor or set approval notify mode to 'off'. 5) Note the registry metadata did not list the CLAUDE_AGENT_* env vars even though the scripts expect them — set them intentionally and verify values. If you want higher assurance, run the hooks manually once and observe openclaw message/agent behavior in a test channel before using with sensitive repos or secrets.
功能分析
Type: OpenClaw Skill Name: claude-agent Version: 2.1.0 The skill bundle is designed to automate the Anthropic 'claude-code' CLI by wrapping it in a tmux session and using Python/Bash hooks for notification and agent wake-up. While the behavior is aligned with its stated purpose as a 'Project Manager' for Claude Code, it possesses high-risk capabilities, including the use of the '--dangerously-skip-permissions' flag to bypass security prompts and the use of 'tmux send-keys' to execute arbitrary shell commands (found in SKILL.md and hooks/start_claude.sh). The instructions in SKILL.md explicitly encourage the agent to handle approvals and iterations autonomously without user intervention, which increases the risk of unmonitored harmful actions if the underlying model is compromised or misdirected. No evidence of intentional malice or data exfiltration to unauthorized third parties was found, but the broad system access and autonomous execution patterns warrant a suspicious classification.
能力评估
Purpose & Capability
The name/description match the shipped files and runtime behavior: the skill orchestrates Claude Code via tmux and Claude hooks, uses openclaw to send messages and wake an agent, and provides start/stop/monitor scripts and knowledge files. The required binaries/credentials are consistent with that purpose (claude, tmux, openclaw).
Instruction Scope
SKILL.md instructs reading the included knowledge files, editing ~/.claude/settings.json to add the Stop hook, and optionally adjusting OpenClaw session settings. The hooks read hook payloads and tmux output and call openclaw message send / openclaw agent — which is expected for notifications/wake behavior. Note: those hooks can forward summaries/transcript paths to your messaging channel if you enable the corresponding environment flags; defaults are conservative (event-only, no cwd/summary).
Install Mechanism
No remote install/download is executed by the skill; it is instruction + small scripts bundled in the repository. There is no installer that fetches arbitrary remote code in the manifest, so install risk is low.
Credentials
Registry metadata lists no required env vars, but the code and INSTALL.md clearly expect CLAUDE_AGENT_* (and legacy CODEX_AGENT_*) env vars and an OpenClaw channel/account configured. Those environment variables control notification/wake behavior and can enable sending summaries or CWD; this is proportionate to the skill's purpose but should have been declared in metadata. The skill does not request unrelated cloud credentials; it relies on the user's existing OpenClaw channel/account configuration.
Persistence & Privilege
The skill does not request always:true or modify other skills. It places monitor/pid/log files under /tmp and asks the user to add a hook to their ~/.claude/settings.json; that is expected for its operation and scoped to the user's machine. It does suggest changing OpenClaw session reset settings (a user-level preference) which is practical for long-running sessions but is a system-wide session policy change the user should review.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claude-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claude-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.0
Security hardening, ClawHub packaging, bilingual docs, and privacy-by-default notifications.
元数据
Slug claude-agent
版本 2.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Claude Agent 是什么?

作为项目经理操作 Claude Code 完全体。包含:任务执行(提示词设计→执行→监控→质量检查→迭代→汇报)。通过 tmux 操作交互式 CLI,通过 hooks + pane monitor 实现异步唤醒。NOT for: 简单单行编辑(用 edit)、读文件(用 read)、快速问答(直接回答)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 230 次。

如何安装 Claude Agent?

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

Claude Agent 是免费的吗?

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

Claude Agent 支持哪些平台?

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

谁开发了 Claude Agent?

由 Wanli Chen(@n1neman)开发并维护,当前版本 v2.1.0。

💬 留言讨论