Sponsor Suno AI Music arrow_forward
Plugin

Prettier Markdown Hook

Automatically formats markdown files with prettier on Stop hook, with configurable organization and path exclusions

Type
Plugin
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026
Version
1.8.0
Author
Terry Li

What Prettier Markdown Hook is

Prettier Markdown Hook is a plugin published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A plugin is a package that bundles skills, slash commands, subagents, hooks, and MCP connectors so they install together. Plugins are plain files with a manifest at .claude-plugin/plugin.json, and they work in both Claude Code and Claude Cowork.

Installing Prettier Markdown Hook adds everything it ships in one step. Connectors inside a plugin still need to be connected separately, and hooks and subagents only run in Cowork and Claude Code, not in regular chat.

How to install Prettier Markdown Hook

Claude Code

  1. Add the repository as a plugin marketplace: claude plugin marketplace add jeremylongshore/tons-of-skills-marketplace
  2. Install the plugin: claude plugin install prettier-markdown-hook@<marketplace-name>, using the marketplace name from the repository's .claude-plugin/marketplace.json.
  3. Restart the session if the new skills or commands don't appear straight away.

Claude Cowork

  1. Open Customize → Plugins and choose Add marketplace.
  2. Enter jeremylongshore/tons-of-skills-marketplace (the owner/repo shorthand works for GitHub).
  3. Find Prettier Markdown Hook in the list, click Install, then connect any connectors it needs from its Connectors tab.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/productivity/prettier-markdown-hook/.claude-plugin/plugin.json, shared under the repository's MIT license. Read the full file on GitHub.

Automatically format markdown files with prettier when Claude stops responding, with configurable organization and path exclusions.

Overview

This Claude Code plugin provides a Stop hook that automatically formats markdown files in your workspace using prettier. It runs asynchronously in the background after every conversation, ensuring consistent markdown formatting without interrupting your workflow.

Features

  • ✅ Zero-Config Default: Works immediately after installation with sensible defaults
  • ✅ Organization Exclusions: Skip formatting for specific GitHub organizations (e.g., company repos)
  • ✅ Path Exclusions: Exclude specific directories or file patterns
  • ✅ AI Commit Messages: Optional AI-generated commit messages (opt-in)
  • ✅ Fire-and-Forget: Async execution (<10ms hook exit time)
  • ✅ XDG Compliant: Cross-platform default paths
  • ✅ Comprehensive Logging: All operations logged for debugging

How It Works

  1. Stop Hook: Triggers after Claude finishes responding
  2. Workspace Check: Verifies you're in a git workspace
  3. Exclusion Check: Skips excluded organizations/paths
  4. Format Files: Runs prettier on modified markdown files
  5. Auto Commit: Creates a conventional commit (optional AI message)
  6. Background Execution: All processing happens asynchronously

Installation

Prerequisites

Ensure these dependencies are installed and available in your PATH:

# Check dependencies
prettier --version  # 2.0 or higher
jq --version        # 1.6 or higher
git --version       # 1.8.5 or higher

Installation commands:

# macOS (Homebrew)
brew install prettier jq git

# npm/yarn (prettier)
npm install -g prettier
# or
yarn global add prettier

# Linux (Ubuntu/Debian)
apt-get install jq git
npm install -g prettier

Plugin Installation

Via Claude Code Marketplace:

# Add marketplace (if not already added)
/plugin marketplace add https://github.com/jeremylongshore/claude-code-plugins

# Install plugin
/plugin install prettier-markdown-hook

Manual Installation:

# Clone marketplace repository
git clone https://github.com/jeremylongshore/claude-code-plugins

# Copy plugin to Claude Code plugins directory
cp -r claude-code-plugins/plugins/productivity/prettier-markdown-hook \
      ~/.claude/plugins/prettier-markdown-hook

Verification

After installation, the hook will run automatically after Claude stops responding. Check the log file to verify:

# View log file (XDG-compliant path)
tail -f ~/.local/state/prettier-hook/format-markdown.log

# Or custom log location (if configured)
tail -f $PRETTIER_LOG_DIR/format-markdown.log

Configuration

Zero-Config (Default)

No configuration needed! The plugin works out-of-the-box with sensible defaults:

  • Formats all markdown files in workspace
  • Skips node_modules, .git, .github, .claude/skills, skills, plugins, file-history
  • Uses standard prettier formatting
  • Conventional commit messages
  • Logs to ~/.local/state/prettier-hook/

Custom Configuration

Create ~/.prettierrc-hook.json to customize behavior:

{
  "excludeOrgs": ["Eon-Labs", "CompanyName"],
  "excludePaths": ["docs/archive", "legacy/**/*.md"],
  "logDir": "~/.local/state/prettier-hook"
}

Configuration options:

Example configuration file is provided at config/.prettierrc-hook.json.example.

Environment Variables

Override configuration with environment variables (highest precedence):

# Custom config file location
export PRETTIER_CONFIG=~/my-custom-config.json

# Enable AI-generated commit messages (requires `claude` CLI)
export PRETTIER_ENABLE_AI_COMMITS=true

# Custom log directory
export PRETTIER_LOG_DIR=~/logs/prettier

Precedence: Environment Variables > Config File > Built-in Defaults

Organization Exclusions

Skip formatting for specific GitHub organizations (e.g., employer/client repos):

{
  "excludeOrgs": ["Eon-Labs", "MyCompany", "ClientOrg"]
}

Important: Organization names are case-sensitive and must match exactly:

  • ✅ Correct: "Eon-Labs" (matches github.com/Eon-Labs/repo)
  • ❌ Wrong: "eonlabs" (will not match)

Path Exclusions

Exclude specific directories or file patterns:

{
  "excludePaths": [
    "docs/archive",
    "legacy/**/*.md",
    "vendor",
    "third-party"
  ]
}

Path exclusions are additive to built-in defaults (not replacements).

AI Commit Messages (Opt-In)

Enable AI-generated commit messages via environment variable:

# In your shell profile (~/.zshrc, ~/.bashrc)
export PRETTIER_ENABLE_AI_COMMITS=true

Requirements:

  • claude CLI installed and in PATH
  • Environment variable set to true

Default behavior (AI disabled):

style: format markdown files with prettier

AI-generated example:

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Prettier Markdown Hook?

Prettier Markdown Hook is a plugin for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Automatically formats markdown files with prettier on Stop hook, with configurable organization and path exclusions

How do I install Prettier Markdown Hook in Claude Code?

Add the repository as a plugin marketplace: claude plugin marketplace add jeremylongshore/tons-of-skills-marketplace Install the plugin: claude plugin install prettier-markdown-hook@<marketplace-name>, using the marketplace name from the repository's .claude-plugin/marketplace.json. Restart the session if the new skills or commands don't appear straight away.

Can I use Prettier Markdown Hook in Claude Cowork?

Open Customize → Plugins and choose Add marketplace. Enter jeremylongshore/tons-of-skills-marketplace (the owner/repo shorthand works for GitHub). Find Prettier Markdown Hook in the list, click Install, then connect any connectors it needs from its Connectors tab.

Is Prettier Markdown Hook safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.