Claude Code hook
CC Hooks Ts
Define Claude Code hooks with full type safety.
Install
git clone https://github.com/sushichan044/cc-hooks-ts.gitFrom the README
cc-hooks-ts
Define Claude Code hooks with full type safety using TypeScript.
See examples for more usage examples.
- cc-hooks-ts
- Installation
- Basic Usage
- Define a Hook
- Configure Claude Code
- Tool Specific Hooks
- Custom Tool Types Support
- Advanced Usage
- Conditional Hook Execution
- Advanced JSON Output
- Async JSON Output (Experimental)
- Documentation
- Development
- How to follow the upstream changes
- If a Dependabot PR already exists
- If no Dependabot PR exists
- License
- Contributing
Starting with versions 2.0.42, we will raise our version number to match Claude Code whenever Hook-related changes occur.
This ensures we can adopt newer type definitions while maintaining compatibility.
Installation
Basic Usage
Define a Hook
Configure Claude Code
Then, load defined hooks in your Claude Code settings at ~/.claude/settings.json.
Tool Specific Hooks
In PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, and PermissionDenied events, you can define hooks specific to tools by specifying tool names in the trigger configuration.
For example, you can create a hook that only runs before the Read tool is used:
Then configure it in Claude Code settings:
The same trigger shape also works for permission hooks:
Custom Tool Types Support
You can add support for custom tools by extending the tool type definitions.
This is useful when you want to your MCP-defined tools to have type-safe hook inputs.
Advanced Usage
Conditional Hook Execution
You can conditionally execute hooks based on runtime logic using the shouldRun function.
If shouldRun returns false, the hook will be skipped.
Advanced JSON Output
Use context.json() to return structured JSON output with advanced control over…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.
Details
- Repository
- sushichan044/cc-hooks-ts
- Type
- Hooks
- Language
- TypeScript
- License
- MIT
- Last updated
- 3 November 2026
- Topics
- claude-codetypescript
- Listed in
- awesome-claude-code-hooks
FAQ
What is CC Hooks Ts?
Define Claude Code hooks with full type safety. It is a hook for Claude Code, from sushichan044/cc-hooks-ts on GitHub.
How do I install CC Hooks Ts?
Clone sushichan044/cc-hooks-ts from GitHub and follow the setup steps in its README.
Is CC Hooks Ts popular?
sushichan044/cc-hooks-ts has 39 GitHub stars and 1 forks, and is included in 1 curated Claude Code list. It was last updated on 3 November 2026.
More hooks
Evolving Lite
50primeline-ai/evolving-lite
A self-evolving Claude Code plugin. Context routing, memory bootup, smart delegation, self-correction — out of the box.
agent-guard
38JeongJaeSoon/agent-guard
Secret-leak guardrails for Claude Code and Codex, also usable as git hooks and in CI.
Claude Warden
60johnzfitch/claude-warden
Security hooks and monitoring for Claude Code — quiet overrides, SSRF protection, MCP compression, OTEL tracing
Claude Code Zero
53LeeJuOh/claude-code-zero
Complete Claude Code plugin marketplace — agents, skills, hooks, commands, rules, MCPs.
claude-warden
32banyudu/claude-warden
Command safety filter hook that parses shell pipelines and judges each sub-command separately.
Jev Axi
46shiftynick/jev-axi
Agent-ergonomic CLI for TypeSafe's Jev: fast calibrated judgments (pick, rate, check, rank, triage, guard) from the shell
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.