cd-permanent

Change the working directory to a validated path within the project root.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/YoniChechik/claude-code-config --skill cd-permanent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cd-permanent
Source: https://github.com/YoniChechik/claude-code-config/tree/main/skills/cd-permanent
Command: npx skills add https://github.com/YoniChechik/claude-code-config --skill cd-permanent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables you to move the current working directory to a path inside the active project tree, without risking navigation outside the base session directory.

Core Features & Use Cases

  • Permanent in-session change: Navigate to any subpath within the project root and keep the session's working directory updated.
  • Safe path validation: Uses project root discovery and realpath-based checks to ensure you never leave the project tree.
  • Use case: When working on a monorepo, quickly switch from your current folder to a nested package without typing long paths.

Quick Start

Change directory to a path inside the project tree, for example: /path/to/project/subdir

Frequently Asked Questions about cd-permanent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I permanently change directory within a project tree in bash?

To permanently change directory within a project tree in bash, this Skill navigates to the target path and updates the session's working directory. It validates the path using project root detection and realpath checks before applying the change directory command.

How can I prevent my shell session from leaving the project root directory?

To prevent your shell session from leaving the project root directory, this Skill validates containment before changing directories. It uses git rev-parse for project root detection and realpath for target path resolution to block navigation outside the base directory.

What is the best way to cd into nested subpaths in a monorepo safely?

The best way to cd into nested subpaths in a monorepo safely is using path validation to ensure containment. This Skill resolves the target path and confirms it remains inside the project root before executing the directory change.

Does cd path validation require git to detect the project root?

Yes, cd path validation requires git to detect the project root. This Skill relies on git rev-parse to discover the project root and realpath to resolve the target path, ensuring the directory change remains safely within the tree.

Why does my change directory command fail when targeting a path outside the project tree?

Your change directory command fails when targeting a path outside the project tree because this Skill intentionally prevents leaving the session's base directory. It validates containment against the project root and blocks any navigation attempt that escapes the tree.

Can I switch working directories without typing long paths in a bash session?

Yes, you can switch working directories without typing long paths in a bash session. This Skill allows you to navigate to any subpath within the project root and permanently updates the session's working directory after validating the target path.