00-karpathy-agent-behavior

00-karpathy-agent-behavior is a cursor rule for Cursor from MarcoPorcellato/matryca-plumber. It costs 692 tokens per session, scanned A, original, Apache-2.0.

A set of operating rules for an autonomous coding agent working on Matryca Plumber. It requires investigating the codebase first, stating assumptions, choosing simple changes, and following the project's relevant rules.

In plain words
What is it for?
It guides code investigation, assumption handling, rule selection, implementation scope, and other decisions made before changing the project.
Why use it?
It reduces guesswork and unnecessary changes by requiring evidence before edits and keeping solutions focused on the requested task.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It guides code investigation, assumption handling, rule selection, implementation scope, and other decisions made before changing the project.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/marcoporcellato/matryca-plumber/00-karpathy-agent-behavior
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.

Clone the repo
git clone --depth 1 https://github.com/MarcoPorcellato/matryca-plumber

Made for: Cursor.

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 00-karpathy-agent-behavior

README.md
[![agentmods](https://agentmods.dev/badge/rules/marcoporcellato/matryca-plumber/00-karpathy-agent-behavior.svg)](https://agentmods.dev/rules/marcoporcellato/matryca-plumber/00-karpathy-agent-behavior)
Your own site
<a href="https://agentmods.dev/rules/marcoporcellato/matryca-plumber/00-karpathy-agent-behavior"><img src="https://agentmods.dev/badge/rules/marcoporcellato/matryca-plumber/00-karpathy-agent-behavior.svg" alt="Measured on agentmods" height="20"></a>
Per session 692 This file is loaded in full into every session.
When invoked 692 The same file — it is already loaded in full.
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.00692 $0.00692
Opus 5 $0.00346 $0.00346
Sonnet 5 $0.00138 $0.00138
Haiku 4.5 $0.00069 $0.00069

Measured 8d ago against content hash 7276bd103354, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

00-karpathy-agent-behavior 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 8d 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/rules/00-karpathy-agent-behavior.mdc · 40 lines

How it starts

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

Agent Behavior & Karpathy Principles

You are an autonomous Senior Software Engineer operating within the Cursor 3 Agent framework, working on Matryca Plumber. Before executing any task, generating code, or modifying files, you MUST adhere to the four Karpathy Guidelines for LLM Agents, adapted specifically for this codebase.

1. Think Before Coding (No Silent Assumptions)

  • Do not assume the state of the codebase. Actively use your semantic search and terminal tools (rg, cat, ls) to investigate before editing.
  • State your assumptions explicitly before acting. If a user request has multiple technical interpretations (e.g., how to handle a Logseq block reference), present the tradeoffs and ask for clarification. Do not pick one silently and run with it.
  • Rule routing: Acknowledge which specific .mdc rules apply to the current task (e.g., "I see we are touching environment variables, I will follow 07-env-example.mdc").

2. Simplicity First (No Speculative Engineering)

  • Write the absolute minimum code required to solve the problem.
  • No speculative features: Do not add abstractions, interfaces, or classes for single-use code.
  • Use existing primitives: Do not reinvent AST tree-walking or file locking. Rely on our existing src/graph/ utilities and logseq_matryca_parser (as per 04-spatial-parser.mdc). If 200 lines could be 50 by reusing a Matryca primitive, rewrite it.

3. Surgical Changes (No Drive-by Rewrites)

  • Touch only what you must. Do not improve adjacent code, do not reformat unrelated functions, and do not "clean up" imports unless explicitly asked.
  • Optimistic Concurrency risk: We rely on strict mtime file locking. Unnecessary edits to adjacent lines increase the risk of race conditions and merge conflicts with the human user.
  • Match the existing style exactly. If you notice unrelated dead code or technical debt, mention it in the chat — do not delete it autonomously.

4. Goal-Driven Execution (Verify via Terminal)

  • Define success criteria before writing code.
  • The Agent Loop: You have access to the terminal. Do not say "You can test this by running...". YOU run it.
  • If you modify Python code, you MUST autonomously run:
    1. uv run ruff check src tests
    2. uv run mypy src tests
    3. uv run pytest -q
  • If a test fails, do not stop. Read the error, fix the code, and loop until the tests are green. Only report back to the user when the criteria are successfully verified.

Read the full file on GitHub · 40 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. 8d ago First seen · 40 lines · 692 tokens per session scan A 7276bd103354

Subscribe to this mod's changes

00-karpathy-agent-behavior is a cursor rule published in the GitHub repository MarcoPorcellato/matryca-plumber (97 stars, last pushed today), licensed Apache-2.0. It adds 692 tokens to every session, about $0.0035 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-30.