hooks-formatting — Claude Code plugin: event-driven file formatting
hooks-formatting — a plugin for Claude Code that runs JavaScript and Python formatting automatically on agent hooks — no manual trigger needed. Fires when the agent writes or modifies code.
MIT ★ 3,785 updated 2026-10-25
/plugin marketplace add davepoon/buildwithclaude
/plugin install hooks-formatting@buildwithclaudeWhat hooks-formatting does
hooks-formatting integrates with Claude Code and Cursor through the hooks system, which attaches actions to specific points in the agent's cycle. When code is generated or edited in a session, the plugin applies formatting before the file lands in the project.
Two hooks ship with it: format-javascript-files and format-python-files. Each one activates on the relevant event, so JS and Python files come out of every session already formatted.
To install in Claude Code, run /plugin marketplace add davepoon/buildwithclaude first, then /plugin install hooks-formatting@buildwithclaude. The marketplace connection is required before the second command will work.
What it helps with
- Auto-format JS files after the agent generates them
- Keep Python code style consistent without running a linter manually
- Wire formatting into the Claude Code hook lifecycle
- Remove the separate prettier or black step from a session
Example prompts for the agent
- Generate a
Button.jsxcomponent and format it on save - Write a Python CSV parser and make sure it comes out PEP 8 compliant
- Create several JS modules and apply formatting to all of them
How to install hooks-formatting
Plugin marketplace
/plugin marketplace add davepoon/buildwithclaude/plugin install hooks-formatting@buildwithclaudeStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about hooks-formatting
How do I install hooks-formatting in Claude Code?
Run /plugin marketplace add davepoon/buildwithclaude first, then /plugin install hooks-formatting@buildwithclaude.
What does hooks-formatting do?
It adds two agent hooks — format-javascript-files and format-python-files — that automatically format code whenever the agent creates or changes a file in the session.
Does hooks-formatting work in Cursor as well as Claude Code?
Yes, it supports both Claude Code and Cursor, though the marketplace install commands apply to Claude Code specifically.
Source text
hooks-formatting · MIT
Formatting Hooks - Event-driven automation hooks
© BuildWithClaude Community · MIT · davepoon/buildwithclaude