Skip to content
Documentation
Hook

Hooks

What d2 runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
d2
181 skill3 agents2 hooks

Claude Code

> /plugin marketplace add heathdutton/claude-d2-diagrams
> /plugin install d2@claude-d2-diagrams

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • Matchesstartup"${CLAUDE_PLUGIN_ROOT}/scripts/status.sh" --nudge

PreToolUse

  • MatchesAgentpython3 "${CLAUDE_PLUGIN_ROOT}/scripts/foreground-agents.py"
Read hooks/hooks.json
@heathdutton
Ships withd2

A Claude Code plugin that reads your codebase and draws its infrastructure and architecture with D2, then keeps those diagrams in step with the code as it changes. Command: /d2:diagram

181 skill3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
18
Star history of heathdutton/claude-d2-diagrams on GitHub, a chart by star-history.com

More plugins that ship hooks.

claude-code-mastery

claude-code-mastery

Gives you a guide to setting up Claude Code, covering global instructions, MCP servers, custom commands, hooks and skills, plus tools for generating commit messages and auditing code for security issues. This version is marked obsolete, with a newer starter kit recommended instead.

2 skills+2558
@thedecipherist@thedecipherist
Install Plugin
claudeforge

claudeforge

Automatically creates, enhances and maintains CLAUDE.md files for Claude Code projects, so you don't have to write and update them by hand.

3 hooks+1434
@alirezarezvani@alirezarezvani
Install Plugin
scaccogatto-okf

scaccogatto-okf

Gives your coding agent skills to author, maintain, validate and visualize Open Knowledge Format bundles, portable markdown knowledge that both your team and your agents can read. Includes a backfill skill for building a bundle from an existing repository's git history and session transcripts.

4 skills+3430
@scaccogatto@scaccogatto
Install Plugin
reviewable-html-workbench

reviewable-html-workbe…

Turns design docs and plan drafts into HTML pages you can comment on inline. Fires when you ask to review a design, preview a plan, or render visual output.

3 skills1 hook302
@u-ichi@u-ichi
Install Plugin
filetree

filetree

A Claude Code plugin that maintains FILETREE.md, a one-line description per file with content hashes for staleness detection. Lets the LLM grasp repo layout in a few hundred tokens before touching code.

1 skill+2164
@nekocode@nekocode
Install Plugin
fluencyloop

fluencyloop

Keeps you fluent in code that AI writes: each feature is designed, built with the reasoning behind each decision explained, and recorded as docs, decisions and review summaries, so the understanding stays with the code.

6 skills1 hook47
@baokhang83@baokhang83
Install Plugin
trigger-tree

trigger-tree

Shows which docs your AI agent actually discovers, using local telemetry with no token cost. Includes a CI gate that fails a pull request with the affected file and a suggested fix.

1 skill4 hooks16
@hedde@hedde
Install Plugin

Questions about the hooks in d2.

Which coding agents can use the hooks in d2?
The hooks in d2 install in Claude Code and Cursor: each runs Claude Code hooks from .claude/settings.json, so copy the hooks there.