CC-301c · Module 3
Team Hook Sharing
3 min read
Hooks configured in settings.json are personal — they apply only to the developer who configured them. Hooks configured in .claude/settings.json (the project-level settings file) are shared — they apply to every developer who clones the repository. This distinction is the mechanism for team-wide quality standards. A stop hook that runs tsc and ESLint, configured in the project-level settings file and committed to the repository, ensures that every developer on the team benefits from the quality loop regardless of their personal configuration.
The deployment pattern is straightforward. One developer builds and tests the hook pipeline — the stop hook, the formatting hook, the error classification logic. Once the pipeline is stable, they move the configuration from their personal settings to the project-level settings file. They commit the hook scripts alongside the configuration. Every developer who pulls the update immediately has the quality pipeline active in their Claude Code sessions.
Team hook sharing requires attention to portability. Hook scripts that reference absolute paths, personal tool installations, or machine-specific environment variables will break on other developers' machines. The portability checklist: use relative paths from the project root. Reference tools through npx or the project's node_modules/.bin/. Set required environment variables explicitly in the hook script. Include a fallback for optional tools — if prettier is not installed, skip formatting rather than crashing.
The settings file supports both settings.json (shared, committed) and settings.local.json (personal, gitignored). This allows a layered configuration: the team-wide quality hooks live in settings.json, and individual developers can add personal hooks in settings.local.json without affecting the team. A developer who wants stricter lint rules or additional spell-checking adds those hooks locally. The team baseline is the shared settings. Personal enhancements are opt-in.