Claude Code HookGit Workflow133 installs

Auto Git Add

Automatically stage modified files with git add after editing. Helps maintain a clean git workflow by staging changes as they're made.

Install with the Claude Code Templates CLI
$ npx claude-code-templates@latest --hook="git-workflow/auto-git-add" --yes

Requires Claude Code. The command adds this hook to your project's .claudedirectory — nothing runs on ToolZip's servers.

What's inside this hook

Component source

{

"description": "Automatically stage modified files with git add after editing. Helps maintain a clean git workflow by staging changes as they're made.",

"hooks": {

"PostToolUse": [

{

"matcher": "Edit|MultiEdit|Write",

"hooks": [

{

"type": "command",

"command": "if [[ -n \"$CLAUDE_TOOL_FILE_PATH\" ]] && git rev-parse --git-dir >/dev/null 2>&1; then git add \"$CLAUDE_TOOL_FILE_PATH\" 2>/dev/null || true; fi"

}

]

}

]

}

}

Type
Hook
Category
Git Workflow
Installs
133
Source
GitHub ↗

Related Claude Code Hooks

HookGit Workflow

Smart Commit

Intelligent git commit creation with automatic message generation and validation. Creates meaningful commits based on file changes.

398 installsView →
HookAutomation

Simple Notifications

Send desktop notifications when Claude Code finishes working or needs user input. Works on macOS and Linux systems.

1k installsView →
HookPre-Tool

Update Search Year

Automatically adds current year to WebSearch queries when no year is specified. This hook intercepts WebSearch tool usage and appends the current year to queries that don't already contain a year, ensuring search results are current and relevant.

361 installsView →
HookDevelopment Tools

Smart Formatting

Smart code formatting based on file type. Automatically formats code using Prettier, Black, gofmt, rustfmt, and other language-specific formatters.

326 installsView →
HookDevelopment Tools

Lint On Save

Automatically run linting tools after file modifications. Supports ESLint for JavaScript/TypeScript, Pylint for Python, and RuboCop for Ruby.

324 installsView →
HookMonitoring

Context Timeline

Real-time browser visualization of Claude Code's context window and subagent/tool execution as a git-graph timeline. Opens http://localhost:7878 on SessionStart with a vertical timeline (most recent on top), one column per agent (main + subagents branching from their Task tool call). Tool calls are color-coded by type (Read=green, Edit/Write=orange, Bash=red, Grep/Glob=cyan, Task=purple, Web=yellow, MCP=gray). Right sidebar shows context-window usage (tokens/200K) with cache_read/cache_creation/input/output breakdown plus per-subagent mini-context. Reads ~/.claude/projects/<encoded-cwd>/<session_id>.jsonl directly — no data replication, no network calls. Pure stdlib Python, zero pip dependencies. Persistent daemon HTTP server on port 7878 (auto-fallback 7879-7888 if busy; override with CONTEXT_TIMELINE_PORT env var). Watchdog auto-shutdown after 1h of inactivity. Disable browser auto-open with CONTEXT_TIMELINE_NO_BROWSER=1. Manual shutdown: python3 .claude/hooks/context-timeline.py --shutdown

259 installsView →

Catalog data and component content are sourced from the open-source davila7/claude-code-templates project (MIT license). ToolZip curates the listing and writes original descriptions; every component links back to its original source. Claude Code is a product of Anthropic. ToolZip is an independent catalog and is not affiliated with or endorsed by Anthropic.