What
Programs that host Claude Code through the SDK can register hooks, which are their own code that Claude Code calls at set points. One such point is PostToolUse, which runs after a tool call succeeds. This release adds a cheaper way to learn which folder a shell command left you in.
shell_cwdis a new system message. It reports the folder a Bash or PowerShell call left its shell in.contextOnlyandreplacedByFrameare two new internal fields on SDK hook callbacks (hook matchers).- When a host marks a hook matcher
replacedByFrame: 'shell_cwd', Claude Code sendssystem/shell_cwdinstead of calling callbacks that only read the shell folder. Only those hosts receive the message.
Why
This changes the contract between Claude Code and the programs that host it, such as desktop apps. A host that only needs the shell's current folder can receive it as a message instead of running a hook after every command.
Names in the bundlecontextOnlyreplacedByFrame