Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.219 ·

New DirectoryAdded hook event

You can now run a hook whenever a directory is added mid-session, including via /add-dir.

Use it now Notable New Features
JSON All of v2.1.219
Use it nowTier: how much it should matter to you
4Useful: my rating, 1 to 5
0Signal: worth watching, 1 to 5
HooksArea: what it touches
New FeaturesKind: in v2.1.219,
What probably matters to youSection of the release
What

Hooks gained a DirectoryAdded event that fires after a working directory is registered mid-session, so you can react to /add-dir and to SDK-driven directory registration.

Details
  • Described in the hook config as "After a working directory is added mid-session"; fires after the directory is registered and after the sandbox config is refreshed.
  • Hook input JSON carries the absolute directory and a source; the matcher can match on "slash_command" for /add-dir and "register_repo_root" for the SDK control request.
  • Registered in the hook config schema, the hook registry, the SDK hook-event enum and the /hooks UI.
  • Failure handling differs by path: for /add-dir a failure count is summarised to Claude and hook systemMessage output reaches Claude; for register_repo_root failures are debug-logged only, via "DirectoryAdded hook failed: ".
Evidence

"slash_command" for /add-dir, "register_repo_root" for the SDK control_request., After a working directory is added mid-session

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

Read from
Names in the bundleDirectoryAdded/add-dir/hooksslash_commandregister_repo_root
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeAdded DirectoryAdded hook that fires after /add-dir or the SDK register_repo_root control request registers a new working directory…

See this entry in the whole of v2.1.219 →

Feedback