Created
March 7, 2026 20:08
-
-
Save skydiver/66e7b03438a4a9856b5e7b8cffb9b718 to your computer and use it in GitHub Desktop.
Claude Code: format .md files on save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "PostToolUse": [ | |
| { | |
| "matcher": "Edit|Write", | |
| "hooks": [ | |
| { | |
| "type": "command", | |
| "command": "bash -c 'FILE=$(cat | jq -r \".tool_input.file_path // empty\"); if [[ \"$FILE\" == *.md ]] && command -v prettier &>/dev/null; then prettier --write --prose-wrap preserve \"$FILE\" 2>/dev/null || true; fi'" | |
| } | |
| ] | |
| } | |
| ] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm install -g prettier