Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
claude code

Claude Code 2.1.335: Interrupt hook, ../ trap

Terminal prompt with a blinking cursor after sudo

Most Claude Code changelogs are a pile of small fixes, and 2.1.335 is no different in volume. But a few lines in it change how I'd think about hooks, plugins and MCP setup, so I read the changelog entry line by line. I only cover what the entry states. I haven't run these changes yet.

A hook event for interrupts

The entry adds an Interrupt hook event. It fires when a turn is interrupted and says whether a person, another session or the system stopped it. That last part is the useful bit. If you run agents unattended, "someone pressed Esc" and "another session cut this one off" are very different situations, and until now a hook couldn't tell them apart.

The same release adds source and via to the session.stop mod event, saying who sent the Stop and how it arrived. Together these give you enough to log an interruption with its cause instead of just noticing a session ended early.

Cloud sessions now load repo plugins, with a catch

Cloud sessions can now load the plugins and mods in a repository's .claude/skills. The changelog adds a warning right away: a hook that reaches out of its plugin's folder with ../ fails there and can block shell commands.

I'd treat that as an audit item. If a plugin hook calls a shared script by walking up the tree, it will probably work on your laptop and then block shell commands in a cloud session. The fix is to keep every path a hook uses inside the plugin directory, even if that means copying a helper script into each plugin.

Smaller items worth knowing

  • claude mcp add --web adds a remote MCP server as a claude.ai connector from the terminal, on paid plans.
  • requiredByOrganization now appears in claude plugin list --json for plugins your organization requires, which makes compliance checks scriptable.
  • Mods can call on() inside their session.start hook, so hooks can be registered after a fetch or an MCP call.
  • A fix for MCP servers with five-minute OAuth access tokens: they used to get a refresh before every request, and short-lived tokens are now used for half their lifetime.

The OAuth fix is the one I'd have hit in practice. Refreshing before every request on a five-minute token is wasteful and adds a failure point on each call. Using a token for half its lifetime is a sensible compromise.

The previous release matters too

Version 2.1.334 shipped just before it, and one item there fixes a plugin's SessionStart hook being skipped in terminal and background sessions when the plugin finished loading after the session started. If you rely on a plugin hook to inject context at startup, a silently skipped hook is exactly the kind of bug you don't notice. The same entry notes that a mod on that event can now hear it twice, so write such hooks to be idempotent.

My takeaway: hooks are growing into real lifecycle infrastructure, and the failure modes are shifting from "it errors" to "it quietly doesn't run". After updating I'll check my plugin hooks for ../ paths, make my startup hooks safe to run twice, and wire the new Interrupt event into my logs.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.