0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Windows】WSLでClaudeCodeを使えるようにする

0
Last updated at Posted at 2026-03-11

WSLでClaudeCodeを使えるようにする

# 1.WindowsにWSLをインストールする
wsl --install
# 2.WSLのコンソール画面を開く
wsl

これ以降は、WSLのコンソール画面上での作業となる

# 3.パッケージを最新に更新する
sudo apt update && sudo apt upgrade -y
# 4.WSL環境に証明書ファイルをコピーしてくる
sudo cp "/mnt/c/Users/hideaki.honda/Desktop/sample.crt" /usr/local/share/ca-certificates/
# 5.証明書を登録する
sudo update-ca-certificates
# 6.WSL環境にClaudeをインストールする
curl -fsSL https://claude.ai/install.sh | bash
# 7.PATHを通す
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

# 8.Claudeコマンドが機能することを確認する(バージョン確認)
claude --version

tips

・WSLのターミナルでClaude Codeを使うと応答が遅い場合の対処

/mnt/c/Users/username/Desktopのようなパスで実行すると、Windowsのファイルシステムということもあり遅い
/home/usernameの配下で作業したほうが断然早い
Windowsのエクスプローラからフォルダアクセスする場合のパスは以下となる
\wsl.localhost\Ubuntu\home\username

・シェルをbashからzshに切り替える

以下のコマンドを実行後にターミナルを再起動する
初回起動時に設定ファイルを作るか聞かれるので、2(おすすめ設定)を入力する

# zshインストール
sudo apt update && sudo apt install -y zsh
# bashからzshに切替
chsh -s $(which zsh)
# パスを通す
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

さらに「oh my zsh」を入れると、テーマやプラグインを追加できより便利になる

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

おすすめプラグイン
https://copicode.com/templates/zsh/customize-zsh-with-oh-my-zsh-ja.php

・tmuxをインストールする

tmuxを入れると画面分割やセッション引き継ぎなど非常に便利

# Ubuntu / Debian系
sudo apt update && sudo apt install -y tmux

# バージョン確認
tmux -V

# 最低限の設定
touch ~/.tmux.conf

# ここでは割愛するけどconfファイルに設定を行う

# 設定の反映
tmux source ~/.tmux.conf
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?