Skip to content
Back to skills

Cd Permanent

ASecurity

Change directory permanently within the session (project tree only)

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsbashgit

Works with

  • claude code

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill cd-permanent --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cd Permanent?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cd Permanent
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-cd-permanent-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-cd-permanent-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "cd-permanent"
description: "Change directory permanently within the session (project tree only)"
argument-hint: "[path]"
---

## Instructions

### Step 1: Parse and Validate Path

Parse `$ARGUMENTS` as the target path.

If empty: Show usage: `/cd-permanent <path>`

### Step 2: Check if Path is Within Project

```bash
# Get project root and target real path
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
TARGET_PATH=$(realpath -m "$ARGUMENTS" 2>/dev/null || echo "$ARGUMENTS")
```

Check if `$TARGET_PATH` starts with `$PROJECT_ROOT`:
- If YES: Continue to Step 3
- If NO: Continue to Step 4

### Step 3: Change Directory (Within Project)

```bash
cd "$TARGET_PATH"
pwd
```

Confirm: "Changed directory to: [new path]"

### Step 4: Outside Project

Cannot change directory outside the project tree. Claude Code enforces staying within the base directory where the session started.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.