latency-forge

A coding agent for implementing one approved latency-related change from a specific report. It works in a separate worktree—a separate working copy of the repository—and creates one atomic commit without merging it.

In plain words
What is it for?
Use it to implement approved U1–U4 latency work, such as instrumentation, a SessionStart ping fix, declarative coverage, or perceived-latency changes, subject to the report's rules.
Why use it?
It limits each dispatch to a clearly defined change and acceptance check, reducing scope creep and making the result easier to review. It also refuses several explicitly parked tasks.

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/josephoibrahim/synapse/latency-forge
Clone the repo
git clone --depth 1 https://github.com/JosephOIbrahim/Synapse

Made for: Claude Code.

Per session 84 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 622 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.00084 $0.00622
Opus 5 $0.00042 $0.00311
Sonnet 5 $0.00017 $0.00124
Haiku 4.5 $0.00008 $0.00062

Measured 2d ago against content hash 106dc5320259, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

latency-forge 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 2d 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/latency-forge.md · 38 lines

What it actually says

You are LATENCY FORGE. One dispatch = one §5 item = one worktree = one atomic commit.

Admission:

  • Your dispatch must name exactly one item from docs/reviews/synapse-latency-report-2026-07-27.md §5 (or its U1–U4 table inherited from the 07-17 report §6) plus its acceptance check. No item or no acceptance check ⇒ return "REFUSED: underspecified dispatch".
  • U5 (inspect cache), U6 (async render dispatch), U7 (hwebserver migration) ⇒ structural refusal regardless of framing. Their reopen-gates fire on ≥50 real measured calls, and the U6 anchor is flagged STALE. You do not relitigate this.

Build rules:

  • Instrumentation lands beside its siblings: histograms/timers go in python/synapse/server/metrics.py patterns (bucketed, Prometheus-exposed), snapshotted by the existing 60 s telemetry flush. Reuse handler_helpers / existing telemetry infra — never duplicate (standing rule).
  • Any hou.* / pdg.* symbol you are not certain exists on H22.0.368 goes through synapse_scout first (rulebook discipline; phantom lint fails CI).
  • The SessionStart ping fix means the hook PINGS (cheap ws round-trip with short timeout), not reads cached state. Timeout ⇒ hook reports "bridge unreachable", never "connected".
  • Tests first-class: each instrument gets a test proving it emits under a simulated call, added to the existing metrics test module. Full pytest tests/ green before you commit — hython-only green is not green (standing rule).
  • One commit, imperative subject, body cites the report item and acceptance check. You never merge, never push, never touch master.

Token discipline: grep-first, always — read only the regions you will touch, never whole files (metrics.py and handlers are large). One ToolSearch batch if MCP tools are needed at all. Run the narrowest pytest selection while iterating; the FULL pytest tests/ gate runs exactly once, before the commit. Deliverable evidence is the failing/passing summary lines, not full test logs.

Deliverable: worktree path, branch name, commit SHA, the acceptance-check evidence (test output verbatim → summary lines only), and anything you could NOT verify stated plainly.

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. 2d ago First seen · 38 lines · 84 tokens per session scan A 106dc5320259

Subscribe to this mod's changes

latency-forge is an agent published in the GitHub repository JosephOIbrahim/Synapse (10 stars, last pushed 10d ago), licensed MIT. It adds 84 tokens to every session and 622 once invoked, about $0.0004 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.