Claude Code hook

TypeScript Quality Hooks

Hooks that run TypeScript type checks, ESLint and Prettier automatically after Claude edits files.

179 stars 14 forksHooks Source

Install

From source
git clone https://github.com/bartolli/claude-code-typescript-hooks.git

From the README

Claude Code Quality Hooks

Quality checks for different project types.

Official Documentation

Quick Start

1. Choose Your Project Type

2. Configure Claude Code

Add to .claude/settings.local.json and customize "command" quality-check.js path according to your project type (react-app, vscode-extension, node-typescript):

3. Done

Hook runs automatically when you edit files.

Features

- Catches errors before runtime
- Uses project-specific TypeScript configurations
- Auto-fixes trivial issues
- Project-aware rules (React hooks allow console.log, VS Code extensions don't)
- Immediate feedback during editing
- Prevents regressions

Project Types

React App

- Console allowed in components
- 'as any' warnings (not errors)
- JSX support

VS Code Extension

- Console blocked in extension code
- Console allowed in webview
- Strict TypeScript

Node.js TypeScript

- Console allowed (acceptable for CLI tools)
- 'as any' warnings (not errors)
- Optimized for server/client transport code

Configuration

Each hook has hook-config.json:

Environment Variable Overrides

Testing

Creating New Hooks

1. Copy existing hook folder
2. Edit hook-config.json
3. Customize rules as needed

Exit Codes

- Exit 0: All checks passed
  - File quality verified
  - Auto-fixes applied if enabled
  - Hook output suppressed by Claude Code

- Exit 2: Issues found
  - TypeScript compilation errors
  - ESLint errors that couldn't be auto-fixed
  - Prettier issues (if auto-fix disabled)
  - Full error report shown to agent

When running via Claude Code hooks:
- Exit 0: Silent success (no output shown)
- Exit 2: Full error report shown to user

When testing manually:
- All [INFO], [OK], [WARN] messages visible
- Useful for debugging hook behavior

Under the Hook

Hook Flow

Smart TypeScript Config…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
JavaScript
License
MIT
Last updated
26 August 2025

FAQ

What is TypeScript Quality Hooks?

Hooks that run TypeScript type checks, ESLint and Prettier automatically after Claude edits files. It is a hook for Claude Code, from bartolli/claude-code-typescript-hooks on GitHub.

How do I install TypeScript Quality Hooks?

Clone bartolli/claude-code-typescript-hooks from GitHub and follow the setup steps in its README.

Is TypeScript Quality Hooks popular?

bartolli/claude-code-typescript-hooks has 179 GitHub stars and 14 forks, and is included in 1 curated Claude Code list. It was last updated on 26 August 2025.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.