{"version":"2.1.200","anchor":"set-cwd-sdk-tool","canonical_anchor":"set-cwd-sdk-tool","heading":"set_cwd SDK Tool","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.200\/e\/set-cwd-sdk-tool","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.200","markdown":"### `set_cwd` SDK Tool\n\n**What**\n\nNew programmatic working-directory change mechanism for SDK hosts (e.g. Claude Desktop) \u2014 the headless twin of the interactive `\/cd` command.\n\n**Details**\n\n- Accepts `path` (required), `trust_accepted` (boolean), and `trusted_directory` (required if `trust_accepted` is true)\n- Runs the same validation, `Cd(...)` permission rules, and relocation path as the interactive `\/cd`\n- Returns structured responses: `ok` (with `cwd`, `changed`, `transcript_relocated`), `needs_trust` (when the directory requires a trust dialog), or `rejected` (with reason: `busy`, `not_found`, `not_a_directory`, `blocked_by_rule`, `unsafe_path`)\n- Rejects requests while a turn is in progress with a clear \"busy\" reason\n- The `trust_accepted` flow requires echoing back the exact directory string from the `needs_trust` response to pin the attestation\n- Paths containing invisible or non-printing characters are rejected as unsafe\n\n**Evidence**\n\nNew set_cwd handler (search for `\"A turn is in progress \u2014 the working directory can only change\"`, `\"set_cwd: invalid request \u2014 path must be a non-empty string\"`, `\"set_cwd: invalid request \u2014 trust_accepted requires trusted_directory\"`)"}