agentleFS
deciderdecider/claude-hooks/CLAUDE.md

claude-hooks

CLAUDE.md75 starsChanged 17 months agoMITView on GitHub

A Python-based hook system for Claude Code that provides automatic validation and quality checks.

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the installer to set up hooks in your project:

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claude Hooks

A Python-based hook system for Claude Code that provides automatic validation and quality checks.

Overview

This project provides Python hooks that integrate with Claude Code (claude.ai/code). Hooks allow you to run validation, linting, type checking, and other quality checks automatically during Claude sessions.

Available Hooks

Built-in Hooks

Code Quality

  • code-quality-validator: Enforces clean code standards (function length, nesting, etc.) after file edits

Package Management

  • check-package-age: Prevents installation of outdated npm/yarn packages

Notifications

  • task-completion-notify: System notifications for completed tasks (optional)

Installation

Run the installer to set up hooks in your project:

python3 install-hooks.py

Configuration

Hierarchical Configuration System

The hook system supports flexible, directory-specific configurations:

  1. Root Configuration: .claude/hooks.json defines default hooks
  2. Directory Overrides: Any directory can have .claude-hooks.json
  3. Configuration Inheritance: Settings cascade with local overrides

Example:

project/
├── .claude/hooks.json         # Default settings
├── backend/
│   └── .claude-hooks.json     # Stricter Python rules
└── frontend/
    └── .claude-hooks.json     # Different JS/React rules

Hook Introspection

# See all hooks in your project
python3 hooks/list_hooks.py list

# Check which hooks apply to a specific file
python3 hooks/list_hooks.py explain src/app.py

Architecture Notes

  • Written in Python for portability (no external dependencies)
  • Hook scripts stored in .claude/hooks/
  • Main configuration in .claude/hooks.json (JSON format)
  • Settings.json in .claude/settings.json for Claude integration
  • Three universal entry points: PreToolUse, PostToolUse, Stop
  • Each hook validates specific conditions and provides feedback
  • Hooks receive configuration via CLAUDE_HOOK_CONFIG environment variable

Manually maintained project documentation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.