pmq CLAUDE.md

pmq CLAUDE.md is an instructions file for coding agents from crp4222/pmq. It costs 1,525 tokens per session, scanned A, original, MIT.

Repository instructions for agents editing the pmq project, including rules for safely handling exchange order fills and checking client-library compatibility.

In plain words
What is it for?
Use them when modifying pmq code, especially order parsing, reconciliation, dependency updates, startup checks, and related tests.
Why use it?
They prevent changes from weakening fail-closed order handling or silently running with an incompatible client library.

Instructions file

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 instructions/crp4222/pmq/claude-md
Clone the repo
git clone --depth 1 https://github.com/crp4222/pmq

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 pmq CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/crp4222/pmq/claude-md.svg)](https://agentmods.dev/instructions/crp4222/pmq/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/crp4222/pmq/claude-md"><img src="https://agentmods.dev/badge/instructions/crp4222/pmq/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,525 This file is loaded in full into every session.
When invoked 1,525 The same file — it is already loaded in full.
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.1 $0.01525 $0.01525
Opus 5 $0.00763 $0.00763
Sonnet 5 $0.00305 $0.00305
Haiku 4.5 $0.00153 $0.00153

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

Security

Grade A, and why

pmq CLAUDE.md 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 5d 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.md · 101 lines

How it starts

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

pmq: engineering invariants for agents CONTRIBUTING to this repo

(AGENTS.md in this repo is for agents USING the library; this file is for agents EDITING it. Read both before changing code.)

Never weaken (the product IS these properties)

  1. The fail-closed fill contract: a Fill books only what the exchange confirmed (orderID + success is not False + matched amounts); 4xx is a clean rejection; timeout/5xx raises OrderUncertain; unparseable = zero. Any change that books more optimistically is a regression by definition, whatever it fixes elsewhere. Matched amounts must be finite and non-negative (json.loads accepts NaN/Infinity; hostile values book zero). reconcile() must keep meaning cancel + get_trades truth. The hypothesis fuzz suite (tests/test_fill_fuzz.py) pins all of this with generated adversarial responses: extend it with every parser change, never delete it.
  2. Startup introspection (_EXPECTED_METHODS/_EXPECTED_MARKET_ARGS): the executor REFUSES to run on a drifted py-clob-client-v2. When bumping the client dependency, re-verify signatures by introspection and update the tables in the same commit.
  3. Builder code policy: default = maintainer's code, defined in exactly ONE place (DEFAULT_BUILDER_CODE in executor.py) and applied automatically by every order path. DISCLOSED in README and code comment. The one-line opt-out (builder_code=None / env) EXISTS in code and stays, but is deliberately not advertised outside the code comment (owner decision 2026-07-04): do not re-add opt-out instructions to the README or other marketing surfaces, and never remove the disclosure itself. AND the mirror rule: keep the disclosure at the DOCUMENTATION level only; do not surface attribution in runtime channels (server startup logs, MCP tools or instructions, order responses). It is public on-chain in every signed order; in-band reminders just prompt sessions to toggle a setting that costs users nothing. This is the trust model (JKorf pattern).
  4. No strategy content, ever: the maintainer's private bot strategy (bands, timing, hours, families, sizing) must never appear in code, docs, tests, commits or issues. The bot-template ships deliberately naive demos only.
  5. Claims must be falsifiable: no superlatives in README/docs; dated claims with evidence (comparison table, on-chain receipts, measured studies). If you cannot prove it, do not write it.
  6. MCP safety gates: trading tools are REGISTERED only when the operator sets PMQ_MCP_LIVE=1 (live) or PMQ_MCP_PAPER=1 (keyless fills simulated against the real books; paper wins when both are set, and no code path may ever let a paper session reach the exchange); per-order PMQ_MCP_MAX_USD and per-UTC-day PMQ_MCP_DAILY_USD caps enforced BEFORE any client call (uncertain outcomes consume budget conservatively; both caps apply in paper too). Read tools must keep working with zero credentials. The README tool and rails tables are part of the contract: keep them in sync with the registered tools.
  7. Order attribution is opt-in and never over-claims: without a configured order_log (env POLY_ORDER_LOG) behavior must stay identical to the unconfigured library. In only-mine mode trades_totals counts a trade ONLY when its taker_order_id or maker_orders[].order_id slice is in OUR registry; trades unknown to every registry are claimed exclusively via claim_unknown, which only reconcile() sets (post-uncertainty recovery). Registries are append-only; a registry write failure degrades toward reconcile claiming and must never block trading. Soundness requires every sender on the wallet to keep a registry: state that wherever the feature is documented.

Read the full file on GitHub · 101 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. 5d ago First seen · 101 lines · 1,525 tokens per session scan A f8fb54e5d454

Subscribe to this mod's changes

pmq CLAUDE.md is an instructions file published in the GitHub repository crp4222/pmq (0 stars, last pushed 1mo ago), licensed MIT. It adds 1,525 tokens to every session, about $0.0076 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 instructions, from other repositories