Command reference ยท Cursor CLI
/add-dir
Adds another directory to a multi-root session at runtime.
/add-dir adds an extra directory to the running session to work across multiple repos at once. Slash skills and custom commands from the new directory refresh immediately; a restart is only needed for the agent to auto-discover new skills. Documented in the official changelog, not (yet) listed in the command reference table.
โ WHEN TO USE IT?
Pull in a second, related repo to the running session
/add-dir ../shared-lib โ to coordinate changes across both repos at once
Reuse the directory combination later
/add-dir ../shared-lib โ then save it as a set with /save-workspace
โ WHEN NOT TO?
The multi-root combination is already known before starting
Adding it later mid-session is then an unnecessary extra step.
Better: Use --add-dir <path> at startup (repeatable, combinable with --workspace)
Working on just a single directory
An extra root directory grows the context the agent has to track.
Better: Skip /add-dir and stick to one workspace
SOURCES
- Cursor Docs โ Changelog โ cursor.com