Use when you need to watch, observe, or react to human terminal activity. Examples: "monitor the terminal for errors", "watch what the user is doing and provide help", "audit terminal activity for security issues".
60
70%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/monitor/SKILL.mdIMPORTANT: EXECUTION CONTEXT This skill describes what to do — domain patterns and decision-making. It does NOT describe how to call the API.
- If you have
wsh_*tools (check your toolkit forwsh_send_input,wsh_get_screen, etc.): use them directly. Operation names in this skill generally map to tool names (e.g., "send input" →wsh_send_input). When in doubt, list your availablewsh_*tools.- If you do NOT have
wsh_*tools: you are in HTTP/curl fallback mode. DO NOT GUESS endpoints or CLI subcommands. Load the full API reference first: search your workspace forskills/core/and readSKILL.md. It contains every endpoint with working curl examples and a bootstrap sequence.- Quick bootstrap:
curl -sf --unix-socket ${XDG_RUNTIME_DIR:-/tmp}/wsh/default.http.sock http://localhost/health— if that fails:wsh server -L agent-$$ --ephemeral &and retry.
In this mode, you're not driving the terminal — the human is. You're watching what happens and providing value by reacting: flagging errors, offering help, catching mistakes, maintaining context. You're a copilot, not the pilot.
Periodically read the screen and react to what you see. Good enough for most use cases:
read screen
analyze what changed
respond if needed (overlay, panel, conversation)
wait
repeatPolling is simple and straightforward. The downside is latency — you're checking on an interval, so you might miss transient output or react a few seconds late.
Subscribe to real-time events via the WebSocket (see the
core skill for connection mechanics). Subscribe to the
events you care about — lines for output, input for
keystrokes — and the server pushes them as they happen.
You also get periodic sync snapshots when the terminal
goes quiet, giving you a natural checkpoint to analyze
the current state.
Under heavy output (e.g. build logs, test runners), the
server may coalesce events — delivering periodic sync
snapshots instead of individual line updates. Your code
should handle sync events to stay in sync regardless
of output volume.
For most monitoring tasks, start with polling. Move to event subscription when you need immediate reaction time.
Monitoring is only useful if you know what to look for. Here are the categories of patterns worth detecting.
Read the screen and scan for:
When detected: show a panel or overlay with a brief explanation and suggested fix. Don't interrupt the human's flow — they may have already noticed.
Watch input events for risky patterns:
rm -rf with broad pathsgit push --force to main/masterDROP TABLE, DELETE FROM without WHEREchmod 777When detected: use input capture to intercept before execution. Show an overlay asking for confirmation. Release input if approved, discard if rejected.
Not everything is about preventing mistakes. Watch for moments where help would be welcome:
Maintain a mental model of what the human is doing:
This context makes your reactions more relevant. An rm
in a temp directory is different from an rm in the
project root.
The hardest part of monitoring isn't detection — it's calibrating your response. Too noisy and the human ignores you. Too quiet and you're useless.
Overlays — lightweight, transient. Best for:
Position them near the relevant content. Remove them after a few seconds or when the screen changes.
Panels — persistent, always visible. Best for:
Keep panels compact. One or two lines. Update in place rather than creating new ones.
Input capture — disruptive, use sparingly. Best for:
Never capture input for something the human can easily undo. Reserve it for irreversible actions.
Conversation — the chat with the human. Best for:
wsh renders spans as-is — no built-in borders, padding, or separators. Build visual structure from text characters:
┌─┐│└─┘)
for framed overlays and panels│ between inline elements━ repeated to cols width
to separate panels from terminal contentSee the wsh:visual-feedback skill for detailed guidance on constructing visual elements.
Be quiet by default. Only react when you have something genuinely useful to say. The human chose to work in a terminal — they know what they're doing most of the time.
Severity drives channel. Informational → overlay. Important → panel. Critical → input capture. Complex → conversation.
Don't repeat yourself. If you flagged an error and the human re-runs the same command, they saw your warning and chose to proceed. Don't flag it again.
Dissolve gracefully. Remove overlays when they're stale. Update panels rather than accumulating them. Leave no visual debris.
Watch what command the human is typing or has just started. Detect the program and provide relevant, timely guidance:
read screen
# See: "$ parted /dev/sda"
# The human is partitioning a disk.
create overlay near the bottom of screen:
"┌─ Parted Quick Ref ────────────────┐"
"│ Common schemes: │"
"│ GPT + EFI: mkpart ESP fat32 │"
"│ 1MiB 513MiB │"
"│ Root: mkpart primary ext4 │"
"│ 513MiB 100% │"
"│ Type 'help' for all commands │"
"└───────────────────────────────────┘"This works for any tool. Detect the command, surface the most useful information:
git rebase → show the rebase commands (pick, squash,
fixup, drop) and common flagsdocker build → show relevant Dockerfile tipskubectl → show the resource types and common flagsffmpeg → show common codec and format optionsiptables → show chain names and common patternsTiming matters. Show help when the human starts the command, not after they've already finished. Update or remove the overlay when they move on to something else.
Be concise. A help overlay is a cheat sheet, not a man page. Three to five lines of the most useful information. If the human needs more, they'll ask.
Long error messages scroll by and are hard to parse. Detect them and provide a summary:
read screen or scrollback
# See: 47 lines of Rust compiler errors
create panel at bottom:
"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
" 3 errors: missing lifetime in "
" auth.rs:42, type mismatch in "
" db.rs:108, unused import main.rs:3"Monitor for sensitive data in terminal output:
When detected, overlay a warning. The data is already on screen — you can't un-show it — but you can alert the human to rotate the credential.
Maintain a running summary panel of what's happened:
panel at top, 2 lines:
"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
" Session: 14 cmds │ 2 errs │ 38 min"
" Last: cargo test (PASS) in /wsh "Update after each command completes. This gives the human (and you) a persistent sense of where things stand.
The human is in control. If they run a command you'd do differently, that's their choice. Only intervene when something is genuinely dangerous or when they appear stuck. "You should use --verbose" is annoying. "That rm will delete your git repo" is helpful.
Overlays and panels consume screen space. On a small terminal, a 3-line panel and two overlays can cover a significant portion of the visible content. Be aware of the terminal dimensions (available in the screen response) and scale your visual elements accordingly. On a 24-row terminal, a 1-line panel is plenty.
If you're polling, don't hammer the API. Every request costs a round-trip. Reasonable intervals:
Match the frequency to the urgency. Most monitoring doesn't need sub-second reaction time.
If the human asked you to watch for errors, don't also start providing unsolicited style tips. Scope your monitoring to what was requested. You can suggest expanding scope, but don't do it silently.
The human may type passwords, access personal accounts, or work on confidential material. If you're monitoring, you see everything. Don't log, repeat, or comment on anything that looks private unless it's directly relevant to the monitoring task you were asked to perform.
Monitoring is not a permanent state. When the human is done with the task that warranted monitoring, tear down your panels and overlays and stop polling. Ask if you should continue rather than assuming.
4863aaf
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.