What
Claude Code now notices when the directory it is running from has been deleted or renamed instead of failing with an opaque error. At startup it stops and tells you plainly what happened, and once running, hooks that would have executed in the missing directory fall back to a directory that still exists and carry on.
Details
- Starting Claude Code from a directory that no longer exists produces the message "The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory."
- The startup check reads the current working directory and distinguishes a missing directory from other read failures, giving a different message for each.
- The startup check runs unconditionally, with no flag or setting to turn it on or off.
- Before each hook runs, Claude Code verifies the hook's working directory still exists.
- If it is gone, the hook falls back to the directory Claude Code was started in, then the project root, then your home directory, and runs there rather than failing.
- The fallback warns once per missing directory, using the message fragment " no longer exists; running hooks from ".
Evidence
The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory., no longer exists; running hooks from
Strings lifted out of the shipped bundle, so the claim above can be checked against them.