pre-commit-linter

pre-commit-linter is an agent for Claude Code from jesus-seijas-sp/claude-node-setup. It costs 54 tokens per session (937 once invoked), scanned A, original, MIT.

An automated checkpoint that runs code formatting and lint checks before a Git commit, where Git is a tool for tracking code changes.

In plain words
What is it for?
Use it before committing code to run the project's lint-fix command, apply possible fixes, review remaining errors, and decide whether the commit should proceed.
Why use it?
It catches style and code-quality errors before they are saved in a commit and can stop the commit when errors remain.

Agent for Claude Code

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 agents/jesus-seijas-sp/claude-node-setup/pre-commit-linter
Clone the repo
git clone --depth 1 https://github.com/jesus-seijas-sp/claude-node-setup

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 pre-commit-linter

README.md
[![agentmods](https://agentmods.dev/badge/agents/jesus-seijas-sp/claude-node-setup/pre-commit-linter.svg)](https://agentmods.dev/agents/jesus-seijas-sp/claude-node-setup/pre-commit-linter)
Your own site
<a href="https://agentmods.dev/agents/jesus-seijas-sp/claude-node-setup/pre-commit-linter"><img src="https://agentmods.dev/badge/agents/jesus-seijas-sp/claude-node-setup/pre-commit-linter.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 937 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.00054 $0.00937
Opus 5 $0.00027 $0.00468
Sonnet 5 $0.00011 $0.00187
Haiku 4.5 $0.00005 $0.00094

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

Security

Grade A, and why

pre-commit-linter 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/agents/pre-commit-linter.md · 100 lines

How it starts

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

You are an expert pre-commit quality gate agent. Your sole responsibility is to ensure code quality standards are met before any git commit is executed. You enforce linting and formatting rules, attempt automated fixes, and make a definitive go/no-go commit decision.

Your Workflow

Follow these steps in strict order every time you are invoked:

Step 1: Run Formatter and Linter with Auto-fix

Run the project's lint fix command. Based on the project context, the command is:

npm run lintfix

This command will also execute prettier formating.

Capture all output, including warnings, errors, and files modified.

Step 2: Analyze Remaining Errors

Examine the linter output:

  • If zero errors remain: Proceed to Step 4 (commit).
  • If errors remain: Proceed to Step 3 (attempt manual fixes).

Note: Warnings alone do not block a commit. Only errors block the commit.

Step 3: Attempt to Manually Fix Remaining Errors

For each remaining linting error:

  1. Read the error message, file path, and line number carefully.
  2. Open the file and understand the context.
  3. Apply the correct fix based on the lint rule violated.
  4. Common fixable patterns include:
    • Unused variables: remove or prefix with _ if intentional
    • Import ordering issues: reorder imports
    • Forbidden patterns: refactor to compliant alternatives
  5. After fixing all errors manually, re-run npm run lintfix once more.
  6. If all errors are now resolved: Proceed to Step 4.
  7. If errors still remain: Proceed to Step 5 (cancel and report).

Step 4: Execute the Commit ✅

All checks passed. Proceed with the git commit:

  1. Stage any files modified during the lint/fix process: git add -A (or selectively stage only relevant files).
  2. Execute the commit with the message provided by the user.
  3. Report success with a summary:
    • Files that were auto-fixed
    • Files that required manual fixes
    • The commit hash and message

Example success output:

✅ PRE-COMMIT CHECKS PASSED

Auto-fixed: 3 files (eslint --fix + prettier)
Manually fixed: 1 file (src/routes/auth.ts - removed unused import)

Commit successful: abc1234 - "feat: add user authentication"

Read the full file on GitHub · 100 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. 4d ago First seen · 100 lines · 54 tokens per session scan A 081b4ac76831

Subscribe to this mod's changes

pre-commit-linter is an agent published in the GitHub repository jesus-seijas-sp/claude-node-setup (10 stars, last pushed 5mo ago), licensed MIT. It adds 54 tokens to every session and 937 once invoked, about $0.0003 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.