outl: Command for Claude Code

.claude/commands/new-op.md

new-op is a command for Claude Code from outlmd/outl. It costs 30 tokens per session (883 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: mentions CLAUDE.md; positional $N argument.

This is outlmd/outl's own configuration. It tells Claude Code how to work on outl 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 outl configures →

Reuse

Borrowing it

Nothing to install: this file belongs to outlmd/outl. 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/outlmd/outl/main/.claude/commands/new-op.md
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/github.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/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 new-op

Your own site · 80×15
<a href="https://agentmods.dev/commands/outlmd/outl/new-op"><img src="https://agentmods.dev/badge/commands/outlmd/outl/new-op.svg" alt="Reviewed on agentmods" width="80" 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 883 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.00030 $0.00883
Opus 5.5 $0.00012 $0.00353
Sonnet 5.5 $0.00006 $0.00177
Haiku 4.5 $0.00003 $0.00088

Measured 29d ago against content hash a4159f51d7e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 29d 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 · 73 lines

How it starts

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

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/op.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. Reaching the clients

An Op a user can trigger needs a way to trigger it, and that path is declared, not hand-rolled:

  • Action + capability. Add the Action to outl-shortcuts; support() is an exhaustive match, so it will not compile until all three clients state what they do with it (root CLAUDE.md invariant 12).
  • The command. Body in outl-tauri-shared/src/commands/, one entry in the matching *_commands! list in src/wrappers/catalog.rs, then an invoke_handler! entry in both clients. Never hand-write the #[tauri::command] wrapper. Shared bodies take String, not &str.
  • The mutation. Route it through outl_actions::commit_page so the undo snapshot, backlink invalidation, peer announce and projection all happen, in order.
  • The wire shape. If the reply carries a new DTO, mirror it in crates/outl-frontend-shared/src/api/types.ts and pin it in outl-tauri-shared/tests/wire_types.rs.
  • The TUI. It still derives ops from rendered markdown (issue 263), so a new op reaches it through outl-actions, not through save_page_with.

Read the full file on GitHub · 73 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. 29d ago Changed a4159f51d7e5
  2. 1mo ago Changed · +15 lines 3e12987eae5c
  3. 1mo 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 (222 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 883 once invoked, about $0.0001 per session on Opus 5.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.