monitor-patterns

monitor-patterns is a skill for Claude Code, Codex from Insajin/autopus-adk. It costs 16 tokens per session (1,739 once invoked), scanned A, original, MIT.

A guide to watching command output as it is produced, especially when using a tool called Monitor that reports new output lines. It also explains how to make grep, a text-search command, flush lines promptly.

In plain words
What is it for?
Use it when streaming logs or command results, monitoring long-running processes, and writing shell commands that need to report matching lines in real time.
Why use it?
It prevents delayed or missing events caused by output buffering, where text waits in memory instead of being sent immediately.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions OpenCode.

Good fit Use it when streaming logs or command results, monitoring long-running processes, and writing shell commands that need to report matching lines in real time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/insajin/autopus-adk/monitor-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Insajin/autopus-adk --skill monitor-patterns
Clone the repo
git clone --depth 1 https://github.com/Insajin/autopus-adk

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for monitor-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/insajin/autopus-adk/monitor-patterns.svg)](https://agentmods.dev/skills/insajin/autopus-adk/monitor-patterns)
Your own site
<a href="https://agentmods.dev/skills/insajin/autopus-adk/monitor-patterns"><img src="https://agentmods.dev/badge/skills/insajin/autopus-adk/monitor-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.01739
Opus 5 $0.00008 $0.00870
Sonnet 5 $0.00003 $0.00348
Haiku 4.5 $0.00002 $0.00174

Measured 4d ago against content hash 540eab256ad9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

monitor-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.omp/skills/monitor-patterns/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Monitor Patterns Skill

OMP 2.1.x Monitor tool을 활용한 pane 이벤트 스트리밍 패턴. 주 사용처는 orchestra Round 2 응답 대기(idea.md Step 3.6).

1. Monitor Tool 개요

Monitor는 실행 중인 command의 stdout을 실시간 tail하여 각 라인을 notification으로 전달한다. until-loop/polling sleep 보다 저렴하다 — 대기 중 토큰 소비 없음.

기본 호출:

Monitor(
  command = "...",
  timeout_ms = 180000
)

반환값: notification stream (stdout의 각 라인이 1개 이벤트).

활성화 조건: AUTOPUS_PLATFORM == claude-code AND features.cc21.monitor_enabled: true. 비 OMP CLI 환경에서는 polling fallback으로 graceful degradation (R8).

2. grep --line-buffered 요구사항

Monitor가 실시간으로 라인을 수신하려면 command가 line-buffered 모드로 출력해야 한다. stdout이 pipe 앞단이면 기본값은 fully-buffered — 이벤트가 버퍼 flush 전까지 지연된다.

올바른 패턴

# GNU grep (Linux 기본값, macOS Homebrew grep)
grep --line-buffered -E 'pattern'

# BSD grep (macOS 기본값) — stdbuf로 강제 line-buffering
stdbuf -oL grep -E 'pattern'

# Universal fallback — unbuffer (expect 패키지)
unbuffer grep -E 'pattern'

잘못된 패턴 — Monitor가 실시간 이벤트를 받지 못함

grep -E 'pattern'          # fully-buffered 기본값 — 이벤트 지연
cat file | grep 'pattern'  # grep 자체도 line-buffered 필요

3. 플랫폼 감지 및 분기 템플릿

# Detect GNU vs BSD grep and set GREP_LB accordingly
if grep --version 2>/dev/null | grep -qi "gnu grep"; then
  GREP_LB="grep --line-buffered"
else
  GREP_LB="stdbuf -oL grep"
fi

Monitor 호출 시 적용:

Monitor(
  command = f"cmux read-screen --surface {surface_id} --follow --scrollback 200 | {GREP_LB} -E '{idle_regex}'",
  timeout_ms = 180000
)

4. Provider별 idle prompt 정규식

spec.md R7 정의. provider pane이 응답을 마치고 입력 대기 상태에 진입하면 해당 라인이 stdout으로 출력된다.

Provider Pattern
claude ^❯\s*$
codex ^codex>\s*$
antigravity-cli ^>\s*(Type your|Press Ctrl) 또는 gemini>\s*$
opencode ^opencode›\s*$ 또는 ^>\s*Ready\s*$

오버라이드

.autopus/project/orchestra-patterns.yaml:

orchestra_patterns:
  claude:
    idle: '^❯\s*$'
  codex:
    idle: '^codex>\s*$'
  antigravity-cli:
    idle: '^>\s*(Type your|Press Ctrl)'
  opencode:
    idle: '^opencode›\s*$'

Read the full file on GitHub · 198 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 198 lines · 16 tokens per session scan A 540eab256ad9

Subscribe to this mod's changes

monitor-patterns is a skill published in the GitHub repository Insajin/autopus-adk (110 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 1,739 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.