finalize

A set of rules for finishing coding work or ending a conversation. It focuses on reviewing staged changes and keeping only comments that explain a reason or a complex detail.

In plain words
What is it for?
Use it after making code changes to review staged lines and remove unnecessary inline comments without changing program logic.
Why use it?
It removes comments that merely repeat what self-explanatory code already says while preserving comments that prevent mistakes or explain unusual choices.

Cursor rule for Cursor

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/zackiles/cursor-config/finalize
Clone the repo
git clone --depth 1 https://github.com/zackiles/cursor-config

Made for: Cursor.

Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 908 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 $0.00007 $0.00908
Opus 5 $0.00003 $0.00454
Sonnet 5 $0.00001 $0.00182
Haiku 4.5 $0.00001 $0.00091

Measured yesterday against content hash ca9209db5522, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

finalize 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 yesterday.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • finalize — 92% identical, 3 lines differ
.cursor/rules/global/finalize.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.

Steps You MUST Follow After Making Changes in this Codebase

Role: You are an expert in code review, refactoring, and minimalistic documentation. You're meticulous in your review and do not make mistakes or miss finding issues with the code you review.

When reviewing or generating code changes:

  1. Analyze all staged Git changes line by line and remove inline code comments according to strict rules:
    • Remove any comment that redundantly describes what the code does (e.g., // increment counter), especially if the code is self-explanatory.
    • Preserve comments only if they explain why the code exists or adds explains highly complex, unconventional, security sensitive code where the comment is highly valuable or prevents developer mistakes (e.g., // workaround for known issue in API v2).
    • Assume all code is self-documenting by default. Comments must earn their place.
    • Do not skip any line. Apply these rules to every staged line containing an inline comment.
    • If unsure, treat the comment as describing what and remove it.
    • Never hallucinate intent, rewrite, or add comments. Only remove.
    • Never change logic—only operate on comments. Maintain exact indentation and formatting.
    • Remove ALL development artifacts and their traces:
      • Delete any comments that explain debugging, testing strategies, or temporary code
      • Remove comments containing words like "temporary," "test," "debug," or "verify"
      • Eliminate commented-out code AND any comments explaining such code
      • Purge any "notes to self" or development process comments
      • This applies to ALL files, but especially test files where development traces accumulate
      • Every comment must justify its existence by explaining why something non-obvious is necessary, not what you were doing during development
  2. Identify all tools provided to you that can be used to inspect the files for issues. Use the tools to inspect the codebase and resolve any errors, warnings, or issues you find. Examples of tools: Language Servers, Output or Debuggers from the IDE, MCP servers that allow runtime or compile-time inspection of the code, log files, type checkers or linters etc.
    • Give up after 2 attempts to solve simple issues. Examples of simple issues: simple warnings or info messages from linters that don't break runtime functionality.
  3. Review all changes made in this conversation to identify and fix any introduced bugs, unmet objectives, or issues in dependent code.
  4. Search through the entirety of all modified or staged files for any linting errors, including those unrelated to your immediate changes, and resolve them.
  5. Remove old, dead, or clearly unused code that relates to this change. If unrelated unreferenced code is discovered, notify the user.
  6. Update any project documentation that refers to or is made outdated by the recent changes. Ensure all project documentation accurately reflects the current code it documents.
  7. After all steps are complete, confirm the work was done. Then ask if the user would like you to:
    a) run a test (if applicable) to validate the change, and
    b) increase the depth and breadth of your investigation to ensure no regressions were introduced.
    If they agree, repeat the above steps one by one, starting with 1 and ending in step 7 (this step). For each step expand your investigation deeper into individual files and outward into related ones in your indexed graph and through terminal calls to inspect the files and folders of the project and their contents. If no issues are found, provide evidence or rationale confirming that the result appears clean.

NOTE: Investigate before removing linting errors for unused variables. Before attempting to remove an unused variable ensure that it's not unused because you forgot to use it or introduced a bug where you accidentally deleted code that is supposed to use it. Understand WHY the variable could've existed in the first place, and trace its origins. If it truly isn't needed anymore then remove it.

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. yesterday First seen · 40 lines · 7 tokens per session scan A ca9209db5522

Subscribe to this mod's changes

finalize is a cursor rule published in the GitHub repository zackiles/cursor-config (17 stars, last pushed 1y ago), licensed MIT. It adds 7 tokens to every session and 908 once invoked, about $0.0000 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.