Skip to content

Commit 711cb4e

Browse files
committed
docs: add >allow-git feature to safety-hooks Starlight docs
1 parent c57c665 commit 711cb4e

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docs-site/src/content/docs/plugins-detail/safety-hooks.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,32 @@ The `git add` hook applies layered protection:
121121
modified files are included, approval is
122122
required.
123123

124+
### Temporarily Allowing Staging & Commits
125+
126+
When you're in a workflow where you trust the agent
127+
to stage modified files and commit, you can
128+
temporarily disable the approval prompts using a
129+
`>allow-git` trigger. Type it directly at the prompt:
130+
131+
| Trigger | Effect |
132+
|---------|--------|
133+
| `>allow-git` | Allow both staging and commits |
134+
| `>allow-git staging` | Allow only staging modified files |
135+
| `>allow-git commit` | Allow only commits |
136+
| `>allow-git off` | Restore approval prompts |
137+
| `>allow-git status` | Show current state |
138+
139+
This is **session-scoped** — it only affects the
140+
current Claude Code session. Other concurrent sessions
141+
are unaffected, and the allowance is automatically
142+
gone when the session ends.
143+
144+
:::caution
145+
Dangerous operations like `git add -A`, `git add .`,
146+
and `git checkout --force` remain **always blocked**
147+
regardless of this setting.
148+
:::
149+
124150
### Environment File Protection
125151

126152
All operations on `.env` files are blocked:

0 commit comments

Comments
 (0)