Remove Hook

VerifiedSafe

Removes a specific hook from the project's Claude settings. It first lists hooks, then asks the user to confirm which hook to remove, deletes it, and reports the result. Useful when you want to clean up or correct hook configurations without manual file editing.

Sby Skills Guide Bot
DevelopmentIntermediate
406/2/2026
Claude Code
#hooks#removal#configuration#claude-code

Recommended for

Our review

Removes a hook from the Claude Code project configuration, with user confirmation before deletion.

Strengths

  • Safe deletion with confirmation
  • Handles both settings.json and settings.local.json
  • Maintains JSON formatting
  • Displays hook count after removal

Limitations

  • Only removes one hook at a time
  • Requires user to know hook details (event, number, source)
  • Only works for Claude Code hooks
When to use it

When you need to remove a specific hook from your Claude Code configuration.

When not to use it

When you want to bulk delete hooks or modify hooks non-destructively.

Security analysis

Safe
Quality score92/100

This skill only reads and writes JSON configuration files within the project's .claude directory. It requires explicit user confirmation before deletion, uses no shell commands or network access, and poses no destructive or exfiltration risk.

No concerns found

Examples

Remove a hook with trigger phrase in Japanese
フックを削除してください
Remove specific hook by details
Remove the PreToolUse hook for the Write matcher from settings.local.json

name: remove-hook description: プロジェクトからフックを削除する。「フック削除」「フックを消して」「hook を削除」「フックを外して」「フック解除」「hook 削除」「フックを取り除いて」などで起動。 allowed-tools: [Read, Write, AskUserQuestion]

Remove Hook

プロジェクトからフックを削除します。

実行手順

  1. まず list-hooks スキルと同様にフック一覧を表示
  2. ユーザーに削除対象を確認:
    • イベント名(例: PreToolUse)
    • フック番号(例: 1)
    • ソースファイル(settings.json または settings.local.json)
  3. 確認後、該当するフックを削除
  4. 削除完了メッセージを表示

削除確認フォーマット

## フック削除

以下のフックを削除しますか?

| 項目 | 値 |
|------|-----|
| イベント | PreToolUse |
| マッチャー | Write |
| タイプ | command |
| コマンド | prettier --write "$FILE" |
| ソース | settings.json |

削除を実行する場合は「はい」と入力してください。

削除処理

  1. 対象ファイル(.claude/settings.json または .claude/settings.local.json)を読み込み
  2. hooks セクションから該当エントリを削除
  3. フック配列が空になった場合はイベントキーごと削除
  4. hooks オブジェクトが空になった場合は hooks キーごと削除
  5. ファイルを保存

出力フォーマット(削除完了時)

## 削除完了

以下のフックを削除しました:

- イベント: PreToolUse
- マッチャー: Write
- ソース: settings.json

現在のフック数: 2件

重要な注意事項

  • ✅ 削除前に必ず確認を求める
  • ✅ settings.local.json のフックも削除可能
  • ✅ 削除後にフック数を表示
  • ✅ JSON フォーマットを維持(インデント等)
  • ❌ 複数フックの一括削除は行わない(1つずつ確認)
Related skills