{"version":"2.1.317","anchor":"mcp-serve-shell-directory-held-and-gone-directory-handling","canonical_anchor":"mcp-serve-shell-directory-held-and-gone-directory-handling","heading":"Claude Code's MCP server keeps a shell working directory and handles a deleted one","tier":"notice","area":"MCP","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317\/e\/mcp-serve-shell-directory-held-and-gone-directory-handling","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317","markdown":"### Claude Code's MCP server keeps a shell working directory and handles a deleted one\n\nWhen Claude Code runs as an MCP server, its shell tool can keep a working directory between calls and refuses a command if that directory is gone\n\n**Unclear.** It is not clear how a client connected to `mcp serve` asks for the starting directory.\n\n**What**\n\n`mcp serve` runs Claude Code as an MCP server, meaning other programs can connect to it and use its tools. Its shell tool, which runs commands on your computer, can now keep a requested starting directory as the working directory for the session. This only happens when the directory is a plain directory inside the folder Claude Code was launched from.\n\nIf that directory has since been deleted, the next shell command is refused with a message naming the missing directory. Commands after that start from the launch folder.\n\n**Why**\n\nThe shell tool can now carry its working directory from one call to the next, within those limits. A deleted directory produces a clear error instead of a command running somewhere unexpected.\n\n- Area: MCP\n- Names: `claude mcp serve`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}