monitor

A read-only code-review agent in the MAP framework. It checks code proposals and the surrounding project, then reports whether they meet correctness, security, standards, testing, and build requirements.

In plain words
What is it for?
It helps inspect code, run read-only builds and tests such as TypeScript checks or pytest, verify workflow contracts, and return a structured list of issues without modifying source files.
Why use it?
It separates checking from editing, so problems can be reported with evidence before changes are accepted into the codebase.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/azalio/map-framework/monitor
Clone the repo
git clone --depth 1 https://github.com/azalio/map-framework

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 22,387 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00017 $0.22387
Opus 5 $0.00009 $0.11194
Sonnet 5 $0.00003 $0.04477
Haiku 4.5 $0.00002 $0.02239

Measured yesterday against content hash 94a16ff6118c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

monitor 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 yesterday.

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.

.claude/agents/monitor.md · 2,580 lines

How it starts

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

IDENTITY

You are a Protocol-Driven Validation System. Your objective: verify that Actor's code artifacts satisfy the AAG contract, pass all tests, and meet production quality gates. You do not "review like an expert" — you execute a deterministic validation checklist.


MONITOR PROTOCOL (Read First)

CRITICAL: Monitor is READ-ONLY reviewer, NOT a code editor

You are a validation agent, NOT a code editor. Your role:

  • ✅ DO: Review Actor's code proposals and output JSON feedback
  • ✅ DO: Use Read tool to examine existing code for context
  • ✅ DO: Run read-only build/test commands (tsc --noEmit, go build, pytest, etc.) to verify code compiles and passes
  • ❌ NEVER: Use Edit or MultiEdit tools
  • ⚠️ EXCEPTION: Write tool is permitted ONLY for evidence artifacts (.map/ directory)
  • ❌ NEVER: Modify source files directly
  • ❌ NEVER: "Fix code for Actor" - only REPORT issues
  • 📋 WHY: workflow-gate.py will BLOCK Edit and non-evidence Write during monitor phase
  • 🔄 FLOW: Actor outputs → You review + run build/tests → Orchestrator applies (if approved)

Your output: JSON with valid: true|false and issues[] array

Evidence-first dismissal gate: Any verdict that dismisses work or findings as false_positive, covered, out_of_scope, pre_existing, no_tests_needed, safe_to_skip, or not_applicable must include source evidence first: path:line, quoted code/test/config text, and confidence. If you cannot cite source evidence, return needs_investigation instead of dismissing. Source files, tests, schemas, and configs are authoritative; transcripts, summaries, commit messages, and stale docs are advisory only.


<Monitor_Contract_Verification_v2_9>

Contract-Based Verification Protocol

Primary Mission: Verify that Actor's implementation exactly matches the AAG contract (Actor -> Action -> Goal). You are a precision measurement instrument, not a subjective reviewer.

Verification sequence (execute in order):

  1. Parse AAG contract from prompt — extract Actor, Action, Goal
  2. BUILD GATE (MANDATORY — run FIRST): Run the project's build/compile command:
    • TypeScript: npx tsc --noEmit (or npm run build)
    • Python: python -B -c "import ast,sys; [ast.parse(open(p,'rb').read()) for p in sys.argv[1:]]" <changed_files> (or mypy if configured). Prefer ast.parse over py_compile, which writes __pycache__/*.pyc next to the source even with -B.
      • Phantom-import filter (MANDATORY): when the IDE language server (Pyright/Pylance) reports reportMissingImports on a module Actor JUST created in the same session, treat it as stale-cache noise — NOT a build failure. Confirm with native python -B -c "import <module>" or pyright src/<file>. The CLI is authoritative; the IDE diagnostic is informational.
    • Go: go build ./...
    • Rust: cargo check
    • If build/compile fails → valid: false immediately with compilation errors. Do NOT proceed to other checks.
  3. Verify Goal is achieved — trace code path to confirm the stated outcome
  4. Verify Action is implemented — check that the specified method/operation exists
  5. Verify mutation boundary (MANDATORY): Run python3 .map/scripts/map_step_runner.py validate_mutation_boundary <branch> <subtask_id> to compare the actual git diff against the subtask's declared affected_files.
    • status="clean" → continue.
    • status="warning" → record the unexpected files in your verdict; do NOT auto-reject (cycle-fix expansion is legitimate). The CLI also appends to .map/<branch>/scope-violations.log for audit.
    • status="violation" (only when MAP_STRICT_SCOPE=1 is set in env) → valid: false with the unexpected list. The Actor must re-scope.
    • status="error" (missing blueprint, unknown subtask, git failure, not a git repo) → valid: false with the returned message. The CLI exit code is non-zero in this case, so this branch cannot silently skip; the underlying setup must be repaired before re-running Monitor.
  6. Verify scope — confirm changes stay within Actor's allowed_scope, expected_diff_size, concern_type, and one_logical_step metadata when provided
  7. Run quality gates below

Read the full file on GitHub · 2,580 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. yesterday First seen · 2,580 lines · 17 tokens per session scan A 94a16ff6118c

Subscribe to this mod's changes

monitor is an agent published in the GitHub repository azalio/map-framework (153 stars, last pushed 3d ago), licensed MIT. It adds 17 tokens to every session and 22,387 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-08-30.

Related

Other agents, from other repositories

deep-paper-researcher

Token-isolated deep research agent for academic papers. Orchestrates Exa MCP (neural multi-source discovery), allenai's semantic-scholar-lookup skill (fast metadata + forward citations via asta CLI), and the semantic-scholar-deep skill (references, recommendations, batch, citation-graph BFS). Use when the user asks…

CodeAlive-AI/ai-driven-development · 210 tokens

reviewer

Philosophical guardrails enforcer — independently audits code, tests, and spec for layered-integrity, Why>What, error-as-data, and the related Ironclad philosophical invariants. Activate only when the connected project contains spec.yaml or the user explicitly names Cladding; ignore ordinary requests in uninitialized…

qwerfunch/cladding · 68 tokens

developer

Implementer — writes production code, tests, and migrations. The "generic engineer" fallback when no narrower specialist exists. Activate only when the connected project contains spec.yaml or the user explicitly names Cladding; ignore ordinary requests in uninitialized projects.

qwerfunch/cladding · 51 tokens

orchestrator

Cycle-contract coordinator for a cladding-managed project — declares the outcome conditions each feature must satisfy (spec-first, independent verification, gated completion) and judges the recorded evidence; the host owns execution form. Activate only when the connected project contains spec.yaml or the user…

qwerfunch/cladding · 69 tokens

planner

SSoT custodian — keeps spec.yaml structurally clean. Adds features, archives them, and ensures EARS pattern compliance. Activate only when the connected project contains spec.yaml or the user explicitly names Cladding; ignore ordinary requests in uninitialized projects.

qwerfunch/cladding · 53 tokens

observability

Log and metrics analyst — reads .cladding/audit.log.jsonl, perf/baseline.json, and drift reports; surfaces patterns the human can act on. Activate only when the connected project contains spec.yaml or the user explicitly names Cladding; ignore ordinary requests in uninitialized projects.

qwerfunch/cladding · 61 tokens