Skip to content

Switch git permissions to deny/ask-based approach#69

Merged
ikuwow merged 4 commits intomasterfrom
feature/claude-git-permissions
Feb 16, 2026
Merged

Switch git permissions to deny/ask-based approach#69
ikuwow merged 4 commits intomasterfrom
feature/claude-git-permissions

Conversation

@ikuwow
Copy link
Owner

@ikuwow ikuwow commented Feb 16, 2026

Summary

  • git コマンドの権限管理を個別 allow リスト方式から deny/ask ベース方式に変更します
    • deny: force push, reset --hard, clean -f/-fd, checkout ., restore . など破壊的操作を禁止
    • ask: push, merge, rebase, reset, clean, stash drop/clear, branch -D, config など影響の大きい操作は毎回確認
    • allow: Bash(git *) で残りの git コマンドを一括許可(deny > ask > allow の評価順序を活用)
  • 全 Bash ルールの記法を :* から空白 * に統一します
  • force push は deny パターンに加え、git push 自体を ask にすることで二重防御しています

🤖 Generated with Claude Code

ikuwow and others added 4 commits February 16, 2026 12:06
- Add deny list for destructive git operations (force push, reset --hard,
  clean -f, checkout ., restore .)
- Add ask list for operations affecting shared state (push, merge, rebase,
  reset, clean, stash drop/clear, branch -D, config)
- Replace 12 individual git subcommand allows with single Bash(git *)
- Migrate all Bash rules from :* syntax to space * syntax

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace 20 individual gh subcommand rules with 7 using wildcard patterns:
- Bash(gh * list *) covers all list subcommands
- Bash(gh * view *) covers all view subcommands
- Bash(gh search *) covers search and search repos

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ikuwow ikuwow marked this pull request as ready for review February 16, 2026 03:20
@ikuwow ikuwow merged commit 03d5275 into master Feb 16, 2026
3 checks passed
@ikuwow ikuwow deleted the feature/claude-git-permissions branch February 16, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant