pi-cd

A pi extension that changes pi's working directory with /cd — path autocomplete, interactive browser, and recent destinations

Packages

Package details

extension

Install pi-cd from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-cd
Package
pi-cd
Version
0.1.0
Published
Jul 26, 2026
Downloads
152/mo · 48/wk
Author
richardanaya
License
MIT
Types
extension
Size
24.7 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-cd

Change pi’s working directory mid-session with /cd.

Pi binds tools, skills, project config, and sessions to a cwd. This extension switches that cwd properly (new session file + runtime rebind), not a fake process.chdir alone.

Install

pi install npm:pi-cd

Or from a local checkout / git:

pi install ./pi-cd
pi install git:github.com/richardanaya/pi-cd

Reload pi (/reload) or restart.

Usage

Command What it does
/cd Interactive directory browser
/cd <path> Go to path (keeps conversation via session fork)
/cd -n <path> New empty session in path
/cd --new <path> Same as -n
/cd - Previous directory
/cd ~ Home
/cd .. Parent
/cd --recents Pick from recent destinations
/cd --clear-recents Clear recent list

While typing /cd …, argument completion lists directories (and specials -, ~, .., --new, --recents).

Browser keys

  • ↑↓ navigate
  • type filter
  • enter open folder, or confirm “Use this directory”
  • or select .. go up
  • esc cancel

Modes

  • DefaultSessionManager.forkFrom copies the current session history into a new session under the target cwd, then switches. Context travels with you.
  • --new / -n — fresh session in the target cwd (no history).

Recent destinations and the previous cwd are stored in ~/.pi/agent/pi-cd-state.json.

Why not just bash cd?

Bash tools run with the session cwd. Changing the shell’s directory inside one bash call does not rebind pi’s project root, tools, skills, or session storage. /cd does.

License

MIT © Richard Anaya