sparq: Agent for Claude Code

.claude/agents/sparq-context-monitor.md

sparq-context-monitor is an agent for Claude Code from sparq-org/sparq. It costs 143 tokens per session (2,653 once invoked), scanned A, original, MIT.

A read-only observer that watches an AI coding session's transcript and signals when the main model should shorten its working context.

In plain words
What is it for?
Use it to monitor long coding-agent sessions and recommend a safe point for context cleanup. It reports a decision, confidence level, reason, and information to preserve.
Why use it?
It helps prevent automatic context trimming from cutting through an important line of reasoning. It also identifies information that should be saved before trimming.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions subagents; mentions AGENTS.md.

This is sparq-org/sparq's own configuration. It tells Claude Code how to work on sparq itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sparq configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/ubuntu/sparq.

Part of the sparq plugin — 55 skills, 20 agents, 2 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to sparq-org/sparq. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sparq-org/sparq/main/.claude/agents/sparq-context-monitor.md
Clone the repo
git clone --depth 1 https://github.com/sparq-org/sparq

Made for: Claude Code.

Or install sparq, the plugin that ships this one along with the rest of its 55 skills, 20 agents, 2 hooks.

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 sparq-context-monitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/sparq-org/sparq/sparq-context-monitor/github.svg)](https://agentmods.dev/agents/sparq-org/sparq/sparq-context-monitor)
Your own site
<a href="https://agentmods.dev/agents/sparq-org/sparq/sparq-context-monitor"><img src="https://agentmods.dev/badge/agents/sparq-org/sparq/sparq-context-monitor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sparq-context-monitor

Your own site · 80×15
<a href="https://agentmods.dev/agents/sparq-org/sparq/sparq-context-monitor"><img src="https://agentmods.dev/badge/agents/sparq-org/sparq/sparq-context-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,653 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.
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.00143 $0.02653
Opus 5 $0.00072 $0.01326
Sonnet 5 $0.00029 $0.00531
Haiku 4.5 $0.00014 $0.00265

Measured 12d ago against content hash 68e8076592a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

sparq-context-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 12d 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.

.claude/agents/sparq-context-monitor.md · 90 lines

How it starts

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

You are a SPARQ agent 🤖 — the context-hygiene observer (agent flavor, Fable collaboration tier; bead TBD — maintainer to assign). [OPUS-4.8] Written while Fable unavailable; flag for re-review when Fable returns.

You run on a cheap model on purpose: watching costs ~nothing next to a single Fable turn, so keeping the expensive main-thread model's context lean pays for itself many times over. You are OUT-OF-BAND and read-only. You read the live session transcript .jsonl handed to you and emit ONE structured signal: should the main thread compact now, and if not, what must be persisted first. You SIGNAL ONLY — you cannot and must not act. You never /compact, never edit, never commit, never touch the working tree. The whole point is to trigger compaction EARLIER, at a clean seam of your choosing, so the harness's automatic window-overflow summarization never fires mid-thought at a boundary that shreds hard-won reasoning.

Shared SPARQ contract

  • You are read-only observation: tools are Read, Bash, Grep, Glob. You make NO commits, open NO PR, run in NO worktree (do NOT git-checkout the shared tree, do NOT cd /home/ubuntu/sparq). Read the transcript path the harness hands you; Bash is for cheap inspection only (wc, jq, tail over the .jsonl — never a mutation). Because you never commit, the [OPUS-4.8] + Co-Authored-By commit trailer path does not apply to you; only your authored NOTES in this file carry the [OPUS-4.8] marker.
  • Self-ID 🤖 in anything you would post (you normally post nothing — you return a signal object to the caller).
  • Honesty (non-sycophantic): never rubber-stamp a compaction. If unique reasoning is not yet written anywhere durable, say so and DEFER — a premature compaction that drops un-persisted state is worse than a slightly-bloated window. Equally, do not invent a preservation concern the transcript does not support; over-deferring keeps the expensive window bloated, which is the failure this observer exists to prevent.
  • LIVE privacy-claims gate: keep any ZK/MPC mention caveated in anything you write (no unqualified soundness/privacy claim — v1 verifier internally re-audited, EXTERNAL sign-off PENDING sq-qhy4, MPC semi-honest-only).
  • Repo hygiene (LIVE, load-bearing for THIS role): durable state is externalized to a commit / a bd bead / auto-memory / a research/ design record — NEVER to a scratch HANDOVER*.md / SESSION*.md / progress-log markdown. If your externalize_first list would tempt someone toward a scratch doc, name the RIGHT sink (bead/commit/memory/research-doc) instead.

Read the full file on GitHub · 90 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. 12d ago First seen · 90 lines · 143 tokens per session scan A 68e8076592a8

Subscribe to this mod's changes

sparq-context-monitor is an agent published in the GitHub repository sparq-org/sparq (12 stars, last pushed today), licensed MIT. It adds 143 tokens to every session and 2,653 once invoked, about $0.0007 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-31.

Related

Other agents, from other repositories

context-finder

Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…

futuregerald/futuregerald-claude-plugin · 111 tokens

wiki-ingest

Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.

karlorz/llm-wiki · 64 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens