Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By karanb192v1.1.0MITIn 1 marketplace
Automatically stages each file Claude edits with git add, so git status and pre-commit review show exactly what Claude changed. Says it makes no network calls and never force-adds gitignored files.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
git-staging, auto-staging, pre-commit-review, git-index, gitignore, posttooluse-hook, claude-code, hooks ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Automatically git stages files after Claude modifies them, so
git statusalways shows exactly what Claude touched.
A PostToolUse hook fires after every Edit and Write call, resolves the modified file's path (relative paths are resolved against the session's cwd), checks that it lives inside a git repo, and runs git add on it. Review becomes trivial: the staged set IS Claude's change set, and nothing needs manual staging before you commit. The hook stays synchronous on purpose: staging must complete before any later git commit in the same turn sees the index.
/plugin marketplace add karanb192/claude-code-hooks # once per machine
/plugin install auto-stage@claude-code-hooks
Restart Claude Code, done. (Or from a shell: claude plugin install auto-stage@claude-code-hooks.)
| Event | Runs | What happens |
|---|---|---|
PostToolUse (Edit|Write) | sync | Resolves the file path, skips files outside a git repo, runs git add -- <file> in the file's directory, logs the outcome. |
Every outcome (STAGED, SKIP, ERROR) is appended to ~/.claude/hooks-logs/<date>.jsonl. The hook always exits 0 and prints {}; it never blocks the tool call, even on malformed input.
None. The hook has no tunables, no safety levels, and no ask mode. The only environment variable it reads is HOME, to place its log under ~/.claude/hooks-logs/.
.env, keys, etc.) fail git add and the failure is logged; nothing is ever force-added.execFileSync, so quotes, $(), and backticks in a filename cannot break out, and -- stops a leading dash from being read as a git option.fs, path, and child_process (for git), so everything stays on your local machine.Version 1.1.0 also supports Codex CLI 0.169.0. Install from a shell:
codex plugin marketplace add karanb192/claude-code-hooks
codex plugin add auto-stage@claude-code-hooks
Open /hooks in Codex and approve the plugin, including after updates. Its synchronous PostToolUse hook stages each path in a successful native apply_patch call. Added and updated files, deletions, and both sides of renames are included. Relative paths use the event's working directory. Git receives literal paths as arguments, never shell text or wildcard pathspecs. Ignored files are never force-added.
This stages the whole file, including any edits already present in it. Review git diff --cached before committing. Shell writes, shell-invoked patches, MCP tools and remote environments are outside this port's scope. Failed native patches do not emit the successful post-tool event; partially applied failures need manual review and staging.
Codex runs approved hooks outside its sandbox. This adapter requires a trusted Git executable and stages only within the session cwd's repository: nested repositories, submodules, bare repositories and other repositories are skipped. It disables Git's filesystem monitor and hooks for its commands, and skips files with a Git filter attribute (including LFS files) so their clean/process commands cannot run through this hook. Configured filter commands are also disabled during staging. Stage filtered files yourself through a normal sandboxed command. Your installed Git, Git configuration and plugin installation must remain trusted; this adapter does not sandbox Git itself. See Git's configuration reference and index-change hook.
When installed alongside format-code, hook execution order is not guaranteed. Run git add after reviewing the formatted result if you need the index to contain it. Neither plugin commits anything. Errors are logged and do not block Codex. Diagnostics go to $CODEX_HOME/hooks-logs (default ~/.codex/hooks-logs). Remove with codex plugin remove auto-stage@claude-code-hooks.
The event contract is checked against Codex 0.169.0's native patch handler. Live checks record the tested host and limits.
/plugin uninstall auto-stage@claude-code-hooks
Part of claude-code-hooks.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub karanb192/claude-code-hooks --plugin auto-stagePlugins from other owners that cover similar ground