{"version":"2.1.334","anchor":"filechangedcwdchanged-watcher-ignores-stale-cwd-change-resu","canonical_anchor":"filechangedcwdchanged-watcher-ignores-stale-cwd-change-resu","heading":"Changing folders quickly no longer leaves the wrong files being watched","tier":"notice","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/filechangedcwdchanged-watcher-ignores-stale-cwd-change-resu","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### Changing folders quickly no longer leaves the wrong files being watched\n\nOnly the most recent `CwdChanged` hook result now updates which files `FileChanged` watches, so a slow earlier run cannot overwrite a newer one\n\n**What**\n\nA hook is a command you set up to run automatically when something happens. When the working folder changes, the `CwdChanged` hook runs, and its result updates which files the `FileChanged` hook watches.\n\nPreviously, the watch list was replaced every time a `CwdChanged` run finished. If you changed folders several times in quick succession, an older run that finished late could overwrite the result of a newer one. Claude Code now numbers each run and accepts only the result of the latest.\n\n**Why**\n\nMoving between folders quickly no longer risks leaving `FileChanged` watching files from a folder you have already left.\n\n- Area: Hooks\n- Names: `CwdChanged`, `FileChanged`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}