update-claude

Install a shell function that safely updates Claude Code in nvm environments by avoiding ENOTEMPTY errors

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "update-claude" with this command: npx skills add amu815/update-claude-skill/amu815-update-claude-skill-update-claude

update-claude Skill

What this skill does

When invoked, install the update-claude shell function into the user's shell configuration file. This function safely updates Claude Code (@anthropic-ai/claude-code) in nvm environments by removing the old package directory before reinstalling, which avoids the common ENOTEMPTY error.

Instructions

  1. Detect the user's shell by checking $SHELL (bash or zsh).
  2. Determine the rc file path:
    • For zsh: ${ZDOTDIR:-$HOME}/.zshrc
    • For bash: $HOME/.bashrc
  3. Check if the update-claude function already exists in the rc file. If it does, inform the user and skip.
  4. Append the following function to the rc file:

# Claude Code updater - avoid ENOTEMPTY errors in nvm environments
update-claude() {
  echo "Current version: $(claude --version 2>/dev/null || echo 'unknown')"
  local pkg_dir="$(npm root -g)/@anthropic-ai/claude-code"
  echo "Package path: $pkg_dir"
  echo "Removing old version..."
  rm -rf "$pkg_dir"
  echo "Installing latest version..."
  npm install -g @anthropic-ai/claude-code@latest
  if [ $? -eq 0 ]; then
    echo "Update complete! Version: $(claude --version)"
  else
    echo "Installation failed. Check error logs."
    return 1
  fi
}
  1. Source the rc file to make the function immediately available.
  2. Confirm success to the user by showing which file was modified.

Usage after installation

The user can run update-claude in their terminal at any time to safely update Claude Code.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

github-tools

Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.

Archived SourceRecently Updated
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated