1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Devcontainer で Claude Code を使う時はfeatures でインストール出来る

Last updated at Posted at 2025-03-16

Claude Code はNode.jsで動かすことができ、以下のようなコマンドでインストールできます。

npm install -g @anthropic/claude-code

CLI で動くため、Devcontainer 上で使うことができ、その際のDockerfile には、上記のコマンドを記載するように公式ドキュメントやサンプルコードに記載されています。

一方で、Anthropics の公式より、Devcontainer Features が提供されています。

これにより、Devcontainer の環境でのみ、Claude Code をインストールすることができます。

.devcontainer/devcontainer.json
{
  // ...他の設定の記述
  "features": {
    // コンテナでNode.jsをインストールしていない場合は、併せてインストールする
    "ghcr.io/devcontainers/features/node:1": {},
    "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
  }
}

Dockerfile の修正をせず、簡単にセットアップ出来る方法としてfeatures は便利なので、おすすめです。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?