Repository navigation
fix: uninstall.sh が存在しない claude uninstall サブコマンドを呼んでいた問題を修正(v0.78.3) - #176
Merged
Merged
Conversation
CLI 削除の確認に y と答えると、ネイティブ版・インストール方法を判別できない 場合・Git Bash で %LOCALAPPDATA%\Programs\claude が無い場合に claude uninstall を実行していた。Claude Code 2.1.291 の claude --help に uninstall コマンドは なく、Usage は claude [options] [command] [prompt] なので、この語はプロンプト として渡る形になる。ネイティブ版の分岐は失敗時に ~/.local/bin/claude だけを 消して完了と表示し、~/.local/share/claude が残っていた。 - uninstall.sh: claude uninstall の呼び出しを全廃し、公式のアンインストール 手順に合わせた。ネイティブ版は既定配置(ランチャーが ~/.local/share/claude/versions/ 内を指す symlink、データディレクトリが symlink を経由しない実ディレクトリ)と確認できた場合だけ ~/.local/bin/claude と ~/.local/share/claude を削除する。削除直前に同じ 確認をやり直し、再帰削除は検証済みの親ディレクトリの中から実ディレクトリに 対してだけ行う - uninstall.sh: Homebrew は brew uninstall --cask を使い、claude-code@latest cask も検出する。npm 版は従来どおり npm uninstall -g - uninstall.sh: カスタムランチャー、symlink、既定以外の場所への配置、判別 不能、Git Bash の旧配置は自動削除せず、公式ドキュメントの URL と方法別の 削除コマンドを表示する。削除後も claude が見つかる場合は警告する - ~/.claude と ~/.claude.json には触れない。確認プロンプトの数と順序、EOF を 「残す」と扱う点は変えていない - tests/unit/test-uninstall.sh: 使い捨ての HOME とスタブの claude / npm / brew による検証を 13 件追加(修正前コードでは 11 件が失敗) - tests/unit/test-codex-setup.sh: 同梱スクリプトがコマンド位置で呼ぶ claude / _claude_cli の第 1 階層サブコマンドが plugin / mcp 以外でない ことの静的ガードを追加(修正前コードでは uninstall.sh の 3 箇所を検出) - README.md / README.en.md / CHANGELOG.md: CLI 削除の範囲と、確認できない 配置では手動手順を表示することを追記 Git Bash の分岐は実機では未検証(_IS_MSYS を立てた擬似環境のテストのみ)。 Fixes #175
…どを修正(v0.78.4) claude uninstall 廃止の修正(#175)に対するレビュー指摘への対応。 - uninstall.sh: ネイティブ版の検出で、~/.local/bin の物理パスも既定の場所と 一致することを確認するようにした。これまでは ~/.local/bin が HOME 外への symlink でも、その中の claude が ~/.local/share/claude/versions/ 内を指して いれば既定配置と判定し、symlink の先にあるランチャーを削除していた。 ランチャーの削除も、データディレクトリと同じく物理パスを確認した親 ディレクトリの中から行う - uninstall.sh: 確認プロンプトの待機中に claude が PATH から消えると、y の 直後の command -v が失敗して何も表示せず終了コード 1 で終わっていた。 インストールされていないと表示して残りの処理を続ける - uninstall.sh: CLI 削除後の表示を「CLI の削除では ~/.claude と ~/.claude.json に触れていません」に改めた。同じ実行でキット管理ファイル (settings.json など)を削除した直後に「設定は削除していません」と読める 文言だった - tests/unit/test-uninstall.sh: symlink の ~/.local/bin、npm / Homebrew / ネイティブ版の削除失敗が失敗として表示されること、プロンプト待機中に claude が消えた場合の 5 件を追加し、既存 2 件に、検出後に ~/.local/bin が 差し替えられた場合の拒否と、Git Bash 擬似環境でデータディレクトリ・ ~/.local/bin が symlink の場合の拒否を加えた。CLI 削除の検証は計 18 件で、 main の uninstall.sh では 16 件が失敗する - README.md / README.en.md / CHANGELOG.md: 上記に合わせて記述と件数を更新
…削除しなかった問題を修正(v0.78.4) claude uninstall 廃止の修正(#175)に対するレビュー指摘(2 巡目)への対応。 - uninstall.sh: ~/.local/bin/claude に既定配置以外のもの(カスタムランチャー、 別の場所を指す symlink など)があると、npm / Homebrew の確認に進まず、手動 手順だけを表示していた。npm の prefix を ~/.local にしている環境では npm 版 のリンクがこの場所にあるため、npm 版なのに npm uninstall -g が実行されず、 インストール方法を確認できないと表示されていた。既定配置のネイティブ版で ない場合は、ランチャーの有無にかかわらず npm、Homebrew cask の順に確認し、 どちらにも見つからない場合だけ手動手順を表示する。既定配置以外のランチャー 自体は引き続きこのスクリプトからは削除せず、残っていれば「まだ見つかり ます」の警告で知らせる - tests/unit/test-uninstall.sh: 上記の 2 件(npm の prefix が ~/.local の配置、 Homebrew cask とカスタムランチャーの併存)を追加した。Git Bash 擬似環境の 検証には、データディレクトリの親(.local/share)が symlink の場合の拒否を 加えた。これまではデータディレクトリの物理パス比較を外しても全件が通って いた。CLI 削除の検証は計 20 件で、main の uninstall.sh では 18 件が失敗する - README.md / README.en.md / CHANGELOG.md: 上記に合わせて記述と件数を更新
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 6, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The changelog contains a future release date relative to the supplied current date.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces the invalid claude uninstall flow with safe, installation-specific removal.
Changes:
- Adds guarded native, npm, and Homebrew uninstall paths.
- Adds regression and security-focused tests.
- Updates bilingual documentation and changelog.
| File | Description |
|---|---|
uninstall.sh |
Implements verified CLI removal and manual guidance. |
tests/unit/test-uninstall.sh |
Tests removal paths and safety checks. |
tests/unit/test-codex-setup.sh |
Detects unknown Claude CLI subcommands. |
README.md |
Documents uninstall behavior in Japanese. |
README.en.md |
Documents uninstall behavior in English. |
CHANGELOG.md |
Records the v0.78.3 fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
uninstall.shの「Claude Code CLI もアンインストールしますか?」で y を選んだときに、現行 CLI に存在しないclaude uninstallサブコマンドを実行していた問題を修正します(v0.78.3、patch)。Fixes #175
原因
uninstall.shのネイティブ版・判別不能時・Git Bash の分岐がclaude uninstallを前提にしていたclaude --helpにuninstallはなく、Usage はclaude [options] [command] [prompt]なので、この語はプロンプトとして渡る形になる(実 CLI での実行結果は確認していない)~/.local/bin/claudeだけを消して「完了」と表示し、~/.local/share/claudeが残っていたユーザーに見える変更
claude uninstallの呼び出しを全廃し、公式手順に合わせた~/.local/share/claude/versions/内を指す symlink、~/.local/binと~/.local/share/claudeが symlink を経由しない実ディレクトリ)と確認できた場合だけ、~/.local/bin/claudeと~/.local/share/claudeを削除するnpm uninstall -g @anthropic-ai/claude-code、Homebrew 版はbrew uninstall --cask(claude-code@latestcask も検出)XDG_DATA_HOMEなどで移した配置、判別不能、Git Bash の旧配置(%LOCALAPPDATA%\Programs\claude)は自動削除せず、公式ドキュメントの URL と方法別コマンドを表示する~/.claude、~/.claude.json)は従来どおり触らず、削除後にその旨を表示する。確認プロンプトの数・順序は変えていない[0.78.3]を参照変更内容
uninstall.shrm -rfは確認済みの親ディレクトリ内の固定パスにだけ実行。i18n 文字列 3 つを ja / en に追加tests/unit/test-uninstall.shclaude/npm/brew)で CLI 削除経路を検証する 20 件を追加(修正前コードでは 18 件が失敗)tests/unit/test-codex-setup.shclaude <語>/_claude_cli <語>がplugin/mcp以外でないことの静的検査を追加(修正前コードではuninstall.shの 3 箇所を検出)README.md/README.en.mdCHANGELOG.md[0.78.3] - 2026-10-07の Fixedリスク
_IS_MSYSを立てた擬似環境での確認にとどまるbrew uninstall --cask/npm uninstall -gはスタブでのみ確認timeout 5 claude fooなど)実行した検査
shellcheck -S warning: 変更した .sh すべて(CI と同じ全ファイル実行も問題なし)tests/unit/test-uninstall.sh、test-codex-setup.sh、test-wce-backup-lifecycle.shを最小ランナーで実行: 全件 PASS(macOS、Bash 5.3)