cursor_rule_snippet

A Cursor project rule that requires Latch's decision check before implementation changes. Cursor is a code editor with an AI agent, and Latch is the project’s decision-tracking layer.

In plain words
What is it for?
Use it to enforce decision checks before edits, display their findings, and guide recovery when Cursor's Latch tools are unavailable.
Why use it?
It helps stop changes when the required current-request record or decision check is missing, while making skipped or degraded checks visible.

Cursor rule

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 rules/open-latch/latch/cursor_rule_snippet
Clone the repo
git clone --depth 1 https://github.com/open-latch/latch
Per session 555 This file is loaded in full into every session.
When invoked 555 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 $0.00555 $0.00555
Opus 5 $0.00278 $0.00278
Sonnet 5 $0.00111 $0.00111
Haiku 4.5 $0.00056 $0.00056

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

Security

Grade A, and why

cursor_rule_snippet 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.

cursor_rule_snippet.mdc · 47 lines

What it actually says

latch Cursor activation

This rule is managed by Latch. Re-run {{KB_HOME}}/bin/install_cursor.sh --yes from this project to refresh it.

Treat AGENTS.md as the shared Latch contract for live reads, authority and reconciliation, visible receipts, durable capture, write hints, and compaction. This rule adds Cursor-specific enforcement:

  • If the IDE has no Latch tools, do not repeatedly call latch_gate. Ask the user to open Cursor Settings > Tools & MCP, enable workspace server latch, confirm it reports tools enabled (count may vary), and start a fresh Agent chat. agent mcp list does not prove the IDE toggle.
  • Before an implementation mutation, call latch_gate once with this prompt verbatim. When findings.must_display_to_user=true, show the Latch gate block before editing.
  • If the gate is skipped, degraded, has no recommendation, or used a rephrased request, say so and do not mutate while the opt-in gate hook is active.
  • If preToolUse denies a mutation for a missing current-prompt receipt, run latch_gate on the current request, surface the findings, and retry. Never work around or disable the hook silently.
  • Explicit Latch slash workflows use a separate one-shot operation receipt bound to the Cursor session, prompt, expected tool, and exact arguments. A general gate receipt cannot override that narrow lane.
  • Preview does not authorize apply. Only a matching successful postToolUse result advances preview state. /latch-pm must display the read-only latch_pm_preview result and digest-bind the exact staging decision before one matching latch_insert.
  • Free-form Shell commands are mutation-capable. Before the gate, use Cursor's exact native read tools rather than inferring safety from a program name.
  • Use /latch-seed only for the exact current hook-provided Cursor transcript; preview candidates before any confirmed staging write.

Cursor's installed surface is project MCP, this rule, shared AGENTS.md, .cursor/commands, and .cursor/skills. --with-hooks adds session, gate, and activity hooks. The Cursor Agent CLI is the native model backend. Manual compaction is fail-closed on the exact current transcript_path; Latch never discovers or guesses historical Cursor transcripts.

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 · 47 lines · 555 tokens per session scan A 7868e222cda0

Subscribe to this mod's changes

cursor_rule_snippet is a cursor rule published in the GitHub repository open-latch/latch (9 stars, last pushed 3d ago), licensed Apache-2.0. It adds 555 tokens to every session, about $0.0028 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.