You start in the frontend repository, and halfway through it turns out the real work is in the API next door. Quitting means losing the context you built up.
/cd ../api-server
This moves the session to a new primary working directory. The conversation stays. Type part of a path to get suggestions, and Tab accepts one.
The move is more than a change of folder. Claude Code loads the new directory’s CLAUDE.md and applies its project configuration: settings with their permission rules and hooks, .mcp.json servers, skills, subagents and env values. The previous project’s MCP servers are disconnected. If you have never worked in the new folder, you get the trust prompt first, with a list of what its settings would switch on. Decline and the session stays where it was.
Later, claude --resume from the new directory finds the session there.
How it differs from /add-dir: that one only adds file access to a second folder and keeps the first project in charge. /cd really switches project, which I think is the right choice when the focus has moved for good.
One leftover to know about: env values from the old directory’s settings stay in effect, with the new ones on top. Older versions before v2.1.246 didn’t apply the new settings until you resumed, so update if it seems to ignore them.
Further reading: Move the session to another directory, Commands: /cd