pre-commit-fix

pre-commit-fix is a command for Claude Code from greyhaven-ai/sygaldry. It costs 0 tokens per session (864 once invoked), scanned A, original, MIT.

A command that runs the project’s pre-commit checks and fixes the errors they find. Pre-commit checks are automated tests for code style and basic quality before changes are committed.

In plain words
What is it for?
Use it before committing code to inspect the repository, apply automatic fixes, resolve remaining issues, and rerun the checks.
Why use it?
It groups formatting, linting, import, file, configuration, and type-checking fixes into one repeatable workflow.

Command 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 commands/greyhaven-ai/sygaldry/pre-commit-fix
Clone the repo
git clone --depth 1 https://github.com/greyhaven-ai/sygaldry

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-fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/greyhaven-ai/sygaldry/pre-commit-fix.svg)](https://agentmods.dev/commands/greyhaven-ai/sygaldry/pre-commit-fix)
Your own site
<a href="https://agentmods.dev/commands/greyhaven-ai/sygaldry/pre-commit-fix"><img src="https://agentmods.dev/badge/commands/greyhaven-ai/sygaldry/pre-commit-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 864 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.00000 $0.00864
Opus 5 $0.00000 $0.00432
Sonnet 5 $0.00000 $0.00173
Haiku 4.5 $0.00000 $0.00086

Measured 4d ago against content hash 2e16bae7cbf7, 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-fix 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/commands/pre-commit-fix.md · 102 lines

How it starts

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

Run pre-commit workflow and systematically fix all errors found

  1. Check the current git status to understand what files we're checking:

    • Run git status to see modified files
    • Note which files will be checked by pre-commit
  2. Run initial pre-commit check to see all issues:

    • Execute task pre-commit or pre-commit run --all-files
    • Capture and analyze the output
  3. Fix issues in this order for efficiency: a) Auto-fixable formatting issues (these are quick wins):

    • Run task format to fix formatting with ruff
    • Run task lint to fix auto-fixable linting issues

    b) Import issues:

    • Ruff with isort will fix import ordering
    • Remove unused imports if any remain

    c) JSON/YAML formatting:

    • Pre-commit will auto-format JSON files
    • Fix any YAML syntax errors

    d) File issues:

    • Fix missing newlines at end of files
    • Fix mixed line endings
    • Remove any debug statements

    e) Type checking errors (if any):

    • Fix MyPy errors by adding type annotations
    • Handle missing imports for type checking
  4. After each category of fixes, run pre-commit again to verify:

    • pre-commit run --all-files
    • This ensures we haven't introduced new issues
  5. Final verification:

    • Run all tests: task test
    • Ensure no functionality was broken by the fixes
  6. Provide summary of all changes made

  7. If any errors persist that can't be auto-fixed:

    • Provide detailed explanation of each error
    • Show exact code locations and suggested fixes
    • Explain why manual intervention might be needed

Error Pattern Reference

Read the full file on GitHub · 102 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 · 102 lines · 0 tokens per session scan A 2e16bae7cbf7

Subscribe to this mod's changes

pre-commit-fix is a command published in the GitHub repository greyhaven-ai/sygaldry (11 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 864 tokens. 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.