Skip to content

Fix: Ensure commands and skills directories exist during install#17

Merged
brobertsaz merged 1 commit intobrobertsaz:mainfrom
williamclavier:fix/install-subdirectories
Dec 3, 2025
Merged

Fix: Ensure commands and skills directories exist during install#17
brobertsaz merged 1 commit intobrobertsaz:mainfrom
williamclavier:fix/install-subdirectories

Conversation

@williamclavier
Copy link
Contributor

Problem

When users have an existing ~/.claude/ directory from a prior Claude Code installation, the install.sh script skips creating the commands/ and skills/ subdirectories. This causes the symlink creation to fail silently, leaving users without access to /claude-os-init and other commands.

Root Cause

The installation script only creates the subdirectories if ~/.claude/ doesn't exist:

if [ ! -d "$USER_CLAUDE_DIR" ]; then
    mkdir -p "${USER_CLAUDE_DIR}/commands"
    mkdir -p "${USER_CLAUDE_DIR}/skills"
else
    echo "${USER_CLAUDE_DIR} already exists"
fi

If the directory already exists, it skips creating the subdirectories, leading to:

ln: /Users/user/.claude/commands/claude-os-init.md: No such file or directory

Solution

This PR adds two lines after the conditional to ensure the subdirectories are always created:

# Ensure commands and skills subdirectories exist (even if .claude already existed)
mkdir -p "${USER_CLAUDE_DIR}/commands"
mkdir -p "${USER_CLAUDE_DIR}/skills"

Testing

Tested the fix by:

  1. Removing ~/.claude/commands and ~/.claude/skills
  2. Running the updated install.sh script
  3. Verifying all 8 commands and 3 skills were symlinked successfully
  4. Confirming /claude-os-init is now available in Claude Code

Impact

This is a minimal, safe change that:

  • ✅ Fixes the bug for users with existing ~/.claude/ directories
  • ✅ Doesn't affect new installations (subdirectories already created)
  • ✅ Uses mkdir -p which is idempotent and safe to run multiple times
  • ✅ No breaking changes

Fixes issue reported by users where /claude-os-init command was not available after installation.

Previously, if ~/.claude already existed from a prior Claude Code
installation, the install script would skip creating the commands/
and skills/ subdirectories. This caused symlink creation to fail
silently, leaving users without access to /claude-os-init and other
commands.

This fix ensures the subdirectories are always created, regardless
of whether ~/.claude already exists.

Fixes issue where /claude-os-init command was not available after
running install.sh on systems with existing ~/.claude directory.
@brobertsaz
Copy link
Owner

Thank you @williamclavier :)

@brobertsaz brobertsaz merged commit c9d7b61 into brobertsaz:main Dec 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments