# /cd Command

> It moves the session to a new folder. The chat stays.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** /cd, Change working directory

## Think of it like

It is like you take your notes to a new room. Then you work there.

## Definition

/cd moves the session to a new working folder and keeps the chat. Claude then works from that folder, as if the session had started there. Type part of a path to see matching folders, and press Tab to pick one. It is different from /add-dir, which keeps the first folder and adds a second one.

## Example

Lucy planned a change with Claude in the web app folder. The real work is in the API, so she runs /cd ../api and goes on with the same chat.

## Example code

```console
/cd ../api
```

Move this session to the api folder.

## Why it matters

You do not have to start over and explain the task again just because the work moved.

## Common mistake

Using /cd when you need both folders. After the move, the first folder is no longer where the session works. Use /add-dir for both.

## Three principles

- **Moves the session.** To a new folder.
- **Keeps the chat.** Nothing is lost.
- **Not /add-dir.** One folder, not two.

## Related terms

- [/add-dir Command](https://learn.benibix.com/term/ai/add-dir-command)
- [Claude Code Session](https://learn.benibix.com/term/ai/claude-code-session)
- [Working Directory](https://learn.benibix.com/term/development/working-directory)

## Told apart from

- [/add-dir vs /cd](https://learn.benibix.com/compare/add-dir-command-vs-cd-command): People often think /add-dir and /cd both just change folders. /add-dir keeps the folder the session started in and lets Claude work in a second one too. /cd moves the whole session to a new folder, so Claude works from there instead. Both keep the chat. Use /add-dir when the task needs both folders, and /cd when the work has moved.

## Taught in

- [Models, Goals and Folders](https://learn.benibix.com/learn/ai-claude-code-commands/models-goals-and-folders): Claude Code Commands, 6/17

![Two panels. With /add-dir the session keeps its folder and reaches a second one. With /cd the session leaves its folder and moves to another.](https://learn.benibix.com/diagrams/cmd-dirs.svg)

---

Source: https://learn.benibix.com/term/ai/cd-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
