new-op

new-op is a command for Claude Code from outlmd/outl. It costs 30 tokens per session (534 once invoked), scanned A, original, MIT.

A checklist for adding a new operation type to a Rust tree-based CRDT, a data structure that lets replicas merge changes. It covers implementation, undo support, storage, serialization, and convergence tests.

In plain words
What is it for?
Use it when extending the operation enum with features such as tags or links.
Why use it?
It reduces the risk of adding an operation in one place while forgetting the other code and tests needed for correct synchronization.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

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 commands/outlmd/outl/new-op
Clone the repo
git clone --depth 1 https://github.com/outlmd/outl

Made for: Claude Code.

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 new-op

README.md
[![agentmods](https://agentmods.dev/badge/commands/outlmd/outl/new-op.svg)](https://agentmods.dev/commands/outlmd/outl/new-op)
Your own site
<a href="https://agentmods.dev/commands/outlmd/outl/new-op"><img src="https://agentmods.dev/badge/commands/outlmd/outl/new-op.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 534 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.1 $0.00030 $0.00534
Opus 5 $0.00015 $0.00267
Sonnet 5 $0.00006 $0.00107
Haiku 4.5 $0.00003 $0.00053

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

Security

Grade A, and why

new-op 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.

.claude/commands/new-op.md · 58 lines

What it actually says

You want to add Op::$1 to the outl tree CRDT. MANDATORY checklist:

1. Define the variant in crates/outl-core/src/op.rs

$1 {
    node: NodeId,
    // ... op fields
    // CRITICAL: include `old_*` fields for undo.
    // Without old_*, undo_op cannot revert.
}

2. Implement do_op in crates/outl-core/src/tree.rs

  • Fill old_* in the LogOp before applying the mutation.
  • If the op can violate an invariant (cycle, etc), check first and treat as a no-op on materialization (but the op still goes to the log).

3. Implement undo_op

  • Revert using the old_* fields of the LogOp.
  • Idempotency: undo of an op that was never applied must be a no-op.

4. Update serialization

  • Verify that serde derive already covers it. If there's a binary field, ensure base64 or bincode.
  • Add conversion to the SQLite schema in storage/sqlite.rs if the op has extra fields.

5. Mandatory tests (in crates/outl-core/tests/)

  • Convergence: 3 replicas apply the op in different orders → same final state.
  • Idempotency: applying 2x = applying 1x.
  • Reordering: a late-arriving op forces a correct undo/replay.
  • Interaction with Move: an op concurrent with a Move on the same node converges.

6. Document in docs/crdt.md

  • Add a paragraph in the "Operations" section describing semantics.
  • Add a concurrent example if the op has non-obvious interactions.

7. Pre-flight before PR

  • cargo fmt
  • cargo clippy -- -D warnings
  • cargo test -p outl-core
  • 100% coverage on the new branches in do_op/undo_op
  • Invoke the crdt-invariant-checker agent
  • Invoke the paper-verifier agent if the op has an analog in the paper

Do not skip steps. A new op that breaks convergence destroys trust in outl.

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 · 58 lines · 30 tokens per session scan A 9be32e9cbe55

Subscribe to this mod's changes

new-op is a command published in the GitHub repository outlmd/outl (167 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 534 once invoked, about $0.0002 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-01.