Skip to content

Repository files navigation

claude-format-hooks

Go 1.27+ License: MIT CI

A Claude Code PostToolUse hook that formats/lints a file right after Write/Edit/MultiEdit/NotebookEdit writes it


Single global Go binary (format-dispatch), no per-repo setup. Native in-process formatters for JSON, shell, and Go; everything else routes to biome, prettier, taplo, markdownlint-cli2, sqlfluff, ruff/black, rustfmt, terraform fmt (or tofu fmt), and buf.

Quick start

git clone git@github.com:Rethunk-Tech/claude-format-hooks.git
cd claude-format-hooks
./install.sh

Install, prerequisites, config, and uninstall: HUMANS.md.

Highlights

  • Native JSON, shell, Go — in-process; JSON preserves key order.
  • --check for CI — reports files needing format; distinct exit codes. --write applies them.
  • --doctor — every formatter, the extensions it owns, and whether its tool is installed.
  • Real tools for everything else — honors project config; no config-presence gate.
  • Silent on success, always exits 0 — failures reach both the operator and the model.
  • One ./install.sh — wires Claude and Cursor hooks globally.

Documentation

Document Purpose
Humans guide Install, configuration, troubleshooting
Agents guide Architecture, layout, invariants
Contributing Build, test, and pull request workflow
Security Vulnerability reporting
Changelog Release history
Code of conduct Community standards
License MIT License

License

Copyright (c) 2026 Rethunk Tech. Licensed under the MIT License — see LICENSE.

About

Claude Code PostToolUse format/lint dispatcher hook (Go; native JSON/shell/Go, external biome/prettier/taplo/markdownlint/sqlfluff/ruff/rustfmt/terraform)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages