5 pages for cwdchanged.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…treeCreate` hook is being removed | Clean up workspace resources | | `CwdChanged` | No | Yes | The working directory changes during a session | Reload environment variables per directory | | `FileChan…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…| "WorktreeCreate" | "WorktreeRemove" | "InstructionsLoaded" | "CwdChanged" | "FileChanged" | "MessageDisplay"; ``` ### `HookCallback` Hook callback function type. ```typescript theme={nu…
Hooks reference
Claude Code CLI · in the page
hooks
…eate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, FileChanged, and DirectoryAdded as standalone async events, PreModelSwitch as a standalone sequential event that runs…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…k up those changes on its own. Pairing a `SessionStart` hook with a `CwdChanged` hook fixes this. `SessionStart` loads the variables for the directory you launch in, and `CwdChanged` reloads them eac…
Week 13 · March 23–27, 2026
Claude Code CLI · in the page
whats-new/2026-w13
…y`managed-settings.d/` drop-in directory for layered policy fragments`CwdChanged` and `FileChanged` hook events for direnv-style setupsAgents can declare `initialPrompt` in frontmatter to auto-submit…