← 返回 Skills 市场
344
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-status-monitor
功能描述
检查本地开发 Agent 的运行和活动状态,显示工作中、等待中、闲置或未运行及会话数量详情。
使用说明 (SKILL.md)
Agent Status Monitor
检查本地开发工具 Agent 的运行状态和活动状态。
触发条件
核心意图:快速了解本地运行的 AI 开发工具(Agent)是否在运行、是否在工作、是否有会话活动。
典型场景:
- 同时运行多个 Agent(Claude Code、OpenCode、OpenClaw),想确认各自状态
- 不确定某个 Agent 是否还在工作,还是已经卡住/闲置
- 想查看哪个 Agent 正在活跃使用,哪个只是后台运行
- 定期检查多个 Agent 的健康状态
触发示例:
- "检查 agent 状态"
- "Claude Code 还在工作吗"
- "看看有哪些 agent 在运行"
- "opencode 是不是闲置了"
- "运行 agents_monitor"
具体成果
一句话目标:运行 agents_monitor 命令,输出所有本地 Agent 的运行状态(运行中/工作中/闲置/未运行)和会话数量。
预期输出:
● Claude Code: 🔥 工作中 (2 分钟内有更新) · 13 个会话
● OpenClaw: 🔥 工作中 (2 分钟内有更新) · 1 个会话
● OpenCode: 💤 闲置 (未使用) · 1 个会话
○ Cursor IDE: 未运行
状态说明:
| 状态 | 含义 |
|---|---|
| 🔥 工作中 | 2 分钟内有会话文件更新 |
| ⏳ 等待中 | 10 分钟内有更新(可能在思考/等待 API) |
| 💤 闲置 | 超过 10 分钟无更新,或未使用 |
| ○ 未运行 | 进程不存在 |
步骤逻辑
执行步骤
-
运行检测脚本
~/.openclaw/workspace/skills/agent-status-monitor/scripts/check-agents.sh -
进程检测 - 对每个 Agent 执行:
ps aux | grep \x3Cagent>检查进程是否存在- 排除系统误报进程(如 CursorUIViewService)
-
活动状态判断 - 检查会话目录文件修改时间:
- 2 分钟内有更新 → 🔥 工作中
- 10 分钟内有更新 → ⏳ 等待中
- 超过 10 分钟无更新 → 💤 闲置
- 只有 1 个文件且超过 5 分钟 → 💤 未使用(初始配置)
-
输出报告 - 包含:
- 状态图标 + 文字说明
- 会话文件数量
- 详细配置信息(版本、配置路径等)
各 Agent 会话目录
| Agent | 会话目录 |
|---|---|
| Claude Code | ~/.claude/projects/ |
| OpenClaw | ~/.openclaw/agents/ |
| OpenCode | ~/.local/state/opencode/ |
| Cursor IDE | 进程检测(无统一会话目录) |
约束
- 只检测本地运行的 Agent,不涉及云端/远程服务
- 基于文件系统修改时间,不依赖 Agent API
- 仅读取公开目录,不访问私有数据
正反样例
✅ 正例
输入:
检查 agent 状态
输出:
========================================
Agent Status Monitor
========================================
--- 进程状态 ---
● Claude Code: 🔥 工作中 (2 分钟内有更新) · 13 个会话
● OpenClaw: 🔥 工作中 (2 分钟内有更新) · 1 个会话
● OpenCode: 💤 闲置 (未使用) · 1 个会话
○ Cursor IDE: 未运行
--- OpenCode 详情 ---
版本:1.2.15
└─ 配置:~/.config/opencode/opencode.json
└─ 会话日志:1 个文件
--- OpenClaw 状态 ---
[OpenClaw status 输出...]
输入:
Claude Code 还在工作吗
输出:
Claude Code: 🔥 工作中 (2 分钟内有更新) · 13 个会话
❌ 反例
输入:
检查 agent 状态
错误输出:
Claude Code: 运行中
OpenCode: 运行中
❌ 问题:没有显示活动状态(工作中/闲置),信息不完整
错误输出:
CPU 使用率:Claude Code 3.7%, OpenCode 0.3%
❌ 问题:CPU 使用率不可靠,Agent 等待 API 时 CPU 低但仍在工作中
错误输出:
Claude Code 进程 ID: 12345, 12346, 12347
❌ 问题:用户不关心进程 ID,关心的是"是否在工作"
明确限制
不做什么
- ❌ 不监控云端 Agent - 只检测本地进程和文件
- ❌ 不统计 Token 使用量 - 各 Agent 日志格式不统一,暂不支持
- ❌ 不显示进程 ID/内存占用 - 用户关心活动状态,不是系统指标
- ❌ 不控制/停止 Agent - 只读检测,不执行任何修改操作
- ❌ 不涉及敏感话题 - 纯技术检测,无内容审查
异常处理
| 情况 | 处理方式 |
|---|---|
| 会话目录不存在 | 显示"未运行"或"未安装" |
| 无法读取文件时间 | 降级为仅进程检测 |
| 脚本执行失败 | 输出错误信息 + 建议检查路径 |
| 没有安装任何 Agent | 显示"未检测到任何 Agent" |
兜底策略
如果脚本检测失败,返回:
⚠️ 无法获取详细状态,尝试手动检查:
ps aux | grep -E "(claude|opencode|openclaw)" | grep -v grep
已知限制
- Cursor IDE - 没有统一会话目录,仅进程检测
- 新 Agent 类型 - 需要手动添加检测逻辑
- 跨用户检测 - 只能检测当前用户的 Agent
- 容器/Docker - 不检测容器内运行的 Agent
相关资源
scripts/check-agents.sh- 主检测脚本references/agent-commands.md- 各 Agent 命令参考
更新日志
- 基于会话文件修改时间判断活动状态(比 CPU 使用率更可靠)
- 支持 Claude Code、OpenCode、OpenClaw、Cursor IDE
- 提供
agents_monitor命令别名
安全使用建议
This skill's shell scripts themselves are straightforward: they run ps and find on specific ~/.<agent>/ paths to determine activity and are consistent with the described local monitoring. Two things to be cautious about before installing or running: (1) Telegram integration — the included Node handler will execute the local scripts and send the output to a Telegram bot/chat, so if you enable that integration you will be transmitting local system status (session counts, timestamps, versions) over the network; only enable it if you trust the bot recipients and the machine’s network environment. (2) Installer modifies OpenClaw config — telegram-commands/install.js writes to ~/.openclaw/openclaw.json to register an alias; back up that file before running the installer and inspect the script to confirm you’re comfortable with the exact change. Recommended steps: inspect the scripts locally, run ./scripts/check-agents.sh manually to verify output, run the install.js only after backing up ~/.openclaw/openclaw.json, restrict Telegram usage to private trusted chats, and avoid running any installer commands from untrusted sources. If you want strict read-only behavior, skip the telegram install and run the shell scripts manually.
功能分析
Type: OpenClaw Skill
Name: agent-status-monitor
Version: 1.0.0
The agent-status-monitor skill bundle is a legitimate tool designed to monitor the activity of local AI agents (Claude Code, OpenClaw, OpenCode, and Cursor). It functions by checking process lists via 'ps' and inspecting session directory metadata (file counts and modification times) to determine if an agent is active, idle, or not running. The bundle includes shell scripts for status detection, a Node.js handler for Telegram commands, and an installation script that adds a command alias to the OpenClaw configuration file (~/.openclaw/openclaw.json). All actions are transparent, well-documented, and strictly aligned with the stated purpose of monitoring local development tools without any evidence of data exfiltration or malicious intent.
能力评估
Purpose & Capability
Name/description match the scripts: the bundled shell scripts inspect local processes and session directories for Claude Code, OpenClaw, OpenCode, Cursor. However, additional components (telegram command handler and install.js) extend capability beyond simple local monitoring by enabling remote reporting (Telegram) and by editing OpenClaw config to register a command alias. Those extras are plausible for convenience but are not strictly necessary for a 'local status' monitor and are not fully reflected in the SKILL.md's '只读检测' statement.
Instruction Scope
SKILL.md describes read-only local checks (ps, find, mtime) on explicit home-path session directories — the shell scripts implement exactly that. But the repository also contains a Telegram handler (executes the local script and returns its output over Telegram) and an installer script that writes to ~/.openclaw/openclaw.json. The SKILL.md states '只检测本地运行的 Agent,不涉及云端/远程服务', yet the Telegram integration will transmit system/state output to an external Telegram chat if installed; this mismatch is a scope creep / documentation gap the user should note.
Install Mechanism
There is no remote download/install spec in the manifest; code is included in the package and README suggests cloning the GitHub repo or copying files into ~/.openclaw. No external URLs or archive extraction are performed by the code itself. This is low-risk compared to arbitrary remote installers.
Credentials
The skill requests no environment variables or credentials. The scripts read files under the user's home (e.g., ~/.claude/, ~/.openclaw/, ~/.local/state/opencode/), which is needed for the stated function but can reveal counts/names/timestamps of local session files. The Telegram handler sends the script output to remote users (Telegram), which increases sensitivity of the read operations — this network transmission is not called out in SKILL.md's '仅检测本地' claim.
Persistence & Privilege
always is false and the skill does not require permanent platform-level privileges. However, telegram-commands/install.js programmatically modifies the OpenClaw config file (~/.openclaw/openclaw.json) to add a command alias. That modifies another tool's configuration and thus affects system/agent settings beyond the skill's own files. This is a legitimate integration step but is a privilege escalation relative to purely read-only monitoring and should be done with explicit user consent/backups.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-status-monitor - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-status-monitor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: local agent status monitoring
- **v1.0** - Initial release
- Support for Claude Code, OpenCode, OpenClaw, Cursor IDE
- Activity detection based on session file modification times
- Modular script design for easy extension
元数据
常见问题
Agent Status Monitor 是什么?
检查本地开发 Agent 的运行和活动状态,显示工作中、等待中、闲置或未运行及会话数量详情。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 344 次。
如何安装 Agent Status Monitor?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-status-monitor」即可一键安装,无需额外配置。
Agent Status Monitor 是免费的吗?
是的,Agent Status Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent Status Monitor 支持哪些平台?
Agent Status Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Status Monitor?
由 Willin(@willin)开发并维护,当前版本 v1.0.0。
推荐 Skills