AI News Daily한국어
← AI tool tips
Claude Code✓ Confirmed in official docsAdded Dec 3

How to log when a Claude Code turn is interrupted with the Interrupt hook

Claude Code 2.1.335 (December 3) added an Interrupt hook event. It fires when a turn is interrupted and says whether a person, another session or the system stopped it. Use it to find out later why a long-running task stopped.

  1. Update to 2.1.335 or later. Check with claude --version.

  2. Register the hook in .claude/settings.json. This one appends the JSON input the hook receives to a file.

{
  "hooks": {
    "Interrupt": [
      {
        "hooks": [
          { "type": "command", "command": "cat >> ~/.claude/interrupts.log; echo >> ~/.claude/interrupts.log" }
        ]
      }
    ]
  }
}
  1. Give the session a task, stop it with Esc, then open ~/.claude/interrupts.log. The changelog doesn't name the field that says who stopped the turn, and the hooks docs don't cover the event yet. Read the field names from the logged JSON, then swap in a script that, say, posts to Slack.

Get notified when a new tip lands

Tip alerts only go out in the app. Install it and turn notifications on.

Get the app

All tips →