Context Monitor

v1.2.0

「macOS」常驻菜单栏的上下文显示器 · Menu bar context monitor for OpenClaw agents.

1· 145·0 current·0 all-time
byArock@hjklasdfg

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for hjklasdfg/menubar-context-monitor.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Context Monitor" (hjklasdfg/menubar-context-monitor) from ClawHub.
Skill page: https://clawhub.ai/hjklasdfg/menubar-context-monitor
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 menubar-context-monitor

ClawHub CLI

Package manager switcher

npx clawhub@latest install menubar-context-monitor
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (macOS menu-bar monitor) align with the included scripts: a SwiftBar plugin script and a Python status collector that read OpenClaw session data. Required tools (Python3, SwiftBar, SSH for remote mode) are appropriate for the described functionality.
Instruction Scope
SKILL.md and Agent Setup Guide instruct the agent to run the installer (including 'bash scripts/install.sh --yes' for local mode) and to copy/run the status collector on remote hosts via SSH. The installer reads and writes only user locations (~/.openclaw, SwiftBar plugin folder) and uses SSH/scp for remote deployment — all within the scope of installing/operating the monitor. Note: the instructions allow an automated install via --yes (i.e., the agent can auto-confirm prompts), so users should be aware an agent could perform the installation without interactive confirmation if permitted.
Install Mechanism
No network downloads of arbitrary archives are performed by the installer itself; SwiftBar is installed via Homebrew (prompted) or the user is pointed to official SwiftBar releases. The installer copies/installs local scripts into the user's SwiftBar plugin directory and ~/.openclaw — standard and proportional for this skill.
Credentials
The skill requests no secrets or unrelated environment variables. It reads OpenClaw config and session files (~/.openclaw/* and agent workspaces) which is expected for a monitor. Remote mode requires SSH key-based auth (expected). Optional env vars referenced by scripts (OPENCLAW_SSH_TARGET, OPENCLAW_STATUS_SCRIPT) are reasonable and documented.
Persistence & Privilege
The skill does not set always:true and does not modify other skills or system-wide settings beyond installing a SwiftBar plugin and placing a collector in ~/.openclaw. These are appropriate for a menu-bar plugin and do not constitute elevated platform privileges.
Assessment
This skill appears to do what it says, but review the following before installing: 1) Inspect the included scripts (openclaw-status.py, install.sh, swiftbar-plugin.sh) yourself — they will be copied into your home directory (~/.openclaw) and your SwiftBar Plugins folder. 2) Prefer running the installer interactively (omit --yes) so you can confirm actions; avoid running automated agent-driven installs unless you trust the agent. 3) For remote mode, double-check the SSH target (user@host) and verify host keys manually rather than relying solely on StrictHostKeyChecking=accept-new (the scripts auto-accept new keys which can risk MITM on untrusted networks). 4) Ensure SSH key-based auth is configured on the remote host before deploying. 5) If you have sensitive agent data, confirm you are comfortable the tool only reads ~/.openclaw and agent workspace files; it does not attempt to phone home or upload data to third-party servers. 6) If in doubt, run the Python status collector locally first to see the data it prints (python3 scripts/openclaw-status.py) before installing the plugin.

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

latestvk97bjdvjv54hhnxsgpxr4zs7s183zmr6
145downloads
1stars
7versions
Updated 3w ago
v1.2.0
MIT-0

MenuBar Context Monitor

macOS 菜单栏实时显示 OpenClaw agent 的上下文用量、模型和运行状态。基于 SwiftBar

Real-time OpenClaw agent observability in your macOS menu bar, powered by SwiftBar.

Version: 1.1.0 Platform: macOS only Author: @hjklasdfg Source: GitHub

Features

  • 🔧 Menu bar shows the most recently active agent's emoji + context usage (e.g. 🔧 140k)
  • 📊 Dropdown lists all agents with context tokens, model alias, and last active time
  • 🫠 Warning indicator when context exceeds 100k tokens
  • ▶ / — / ✖ Running, idle, and failed state indicators
  • 🏠 Works locally or over SSH to a remote OpenClaw host

Screenshots

🔧 98k                          ← menu bar
───────────────────────────────
🦞 OpenClaw Agents (6)
───────────────────────────────
▶ 🔧 tech    98k/1000k (9%)  │ opus   │ 26s ago
— 🎮 main    50k/1000k (5%)  │ opus   │ 2m ago
— 🎯 career  52k/1000k (5%)  │ opus   │ 1m ago
— ✍️ content 40k/1000k (4%)  │ opus   │ 20h ago
— 💰 finance 52k/200k (26%)  │ haiku  │ 1h ago
✖ 🧠 phil    26k/1000k (2%)  │ opus   │ 3d ago
───────────────────────────────
Refresh

Install

Choose the scenario that matches your setup:

Scenario A: OpenClaw runs on this Mac (local mode)

Everything on one machine — OpenClaw and the menu bar monitor.

# 1. Install the skill via OpenClaw CLI
openclaw skills install menubar-context-monitor

# 2. Run the installer
bash ~/.openclaw/skills/context-monitor/scripts/install.sh

Scenario B: OpenClaw runs on another machine (remote mode)

Most common setup — OpenClaw runs on a server / Raspberry Pi / Mac Mini, and you want the menu bar on your MacBook. No OpenClaw installation needed on the MacBook.

# 1. Clone the repo
git clone https://github.com/hjklasdfg/openclaw-context-monitor.git
cd openclaw-context-monitor

# 2. Run the installer with your OpenClaw host's SSH address
bash scripts/install.sh --remote user@host

Example: bash scripts/install.sh --remote linyili@192.168.1.100

SSH key auth is required. If not set up yet, the installer will guide you.

Alternative: Ask your agent

If you have OpenClaw running locally, you can also just tell your agent:

"Help me set up agent menu bar monitoring"

The agent will read this skill and walk you through it.

SwiftBar First Launch

When SwiftBar opens for the first time, it asks you to choose a plugin folder. Press Cmd+Shift+G and paste:

~/Library/Application Support/SwiftBar/Plugins

The installer places the plugin script in this directory. You only need to do this once.

Requirements

  • macOS (SwiftBar is macOS-only)
  • Python 3
  • SwiftBar — installer will offer to install via Homebrew
  • SSH key auth (remote mode only)

How it works

SwiftBar plugin (your Mac)  →  SSH  →  status collector (OpenClaw host)  →  sessions.json
                            or locally ↗

Two components:

  1. openclaw-status.py — Reads agent session data on the OpenClaw host
  2. swiftbar-plugin.sh — Renders the menu bar on your Mac

Customization

SettingHow to change
Refresh intervalRename plugin: 30s10s, 1m, 5m
Warning thresholdEdit WARN = 100000 in the plugin
SSH targetEdit MINI= in plugin or set OPENCLAW_SSH_TARGET env var

Agent emoji

Reads from each agent's IDENTITY.md:

- **Emoji:** 🔧

Falls back to agent name if not set.

Model display

Shows short aliases: opus, sonnet, haiku, flash, pro. User-configured modelAliases in openclaw.json take priority.

Troubleshooting

Menu barMeaningFix
🦞 ❌Connection failedCheck SSH / network
🦞 ⚠️Data parse errorRun python3 ~/.openclaw/openclaw-status.py on host
Agent missingNo session data yetUse the agent once to generate a session

License

MIT


<!-- Agent instructions below — not displayed on ClawHub -->

Agent Setup Guide

When a user asks to set up context monitoring, follow this flow:

Before starting: This skill requires running commands on a Mac. If the user might be on a mobile device:

"This needs to run on a Mac. Are you at your Mac now? If you're on another device, I'll send you the commands to run later."

Step 1: Ask the user:

"Does OpenClaw run on this Mac, or on a remote machine? If remote, what's the SSH address? (e.g. user@hostname)"

Step 2 (local mode): Run the installer directly:

bash scripts/install.sh --yes

Step 2 (remote mode): The agent cannot install SwiftBar on the user's Mac remotely. Instead:

  1. Deploy the status collector to the OpenClaw host:
    scp scripts/openclaw-status.py <user>@<host>:~/.openclaw/openclaw-status.py
    
  2. Generate copy-paste instructions for the user with the full install command, including the correct SSH target baked in.

SwiftBar installation: If SwiftBar needs to be installed, ask the user for permission first:

"This requires installing SwiftBar (a macOS menu bar tool). OK to install?"

After confirmation, pass --yes to skip the script's interactive prompt.

Triggers

menu bar, SwiftBar, agent status, agent monitor, observability, dashboard mac, agent context, context monitor, 菜单栏, 上下文显示, agent 监控

Comments

Loading comments...