Claude Code が一般提供されたので概要をまとめて、Amazon Bedrock 経由で使ってみた
こんにちは!クラウド事業本部コンサルティング部のたかくに(@takakuni_)です。
X を見ていると、Claude 4 が登場したタイミングで、一般提供されたからなのか、Claude Code のユーザーがますます増加している印象を受けます。
私は普段、Roo Code (+ OpenAI) の組み合わせで、開発をしているのですが Claude Code がすごいと噂なので、まずはセットアップから始めてみたいと思います。
すでに Amazon Bedrock から接続した、Claude Code のセットアップ記事はあるものの、いくつか状況が変化している部分もあるため、書いてみたいと思います。
Claude Code
Claude Code とは Anthropic が作成したコーディングエージェントです。エージェントと CLI ベースでやり取りを行うのが特徴です。
Claude Code の主な機能として以下が紹介されています。
- コードベース全体のファイルを編集し、バグを修正する
- コードのアーキテクチャとロジックに関する質問に答える
- テスト、リンティング、その他のコマンドの実行と修正
- Git の履歴を検索し、マージの競合を解決し、コミットと PR を作成する
- ウェブ検索を使用して、インターネットからドキュメントやリソースを閲覧する
- エンタープライズ展開向けに Amazon Bedrock および Google Vertex AI と連携
以前までは研究プレビューとして、ベータ版で提供されていましたが、Claude 4 のリリースに合わせ、一般提供を開始しました。
Claude Code, now generally available, brings the power of Claude to more of your development workflow—in the terminal, your favorite IDEs, and running in the background with the Claude Code SDK.
IDE integrations
ベータ機能として、Visual Studio Code / JetBrains IDEs との統合をサポートしました。
New beta extensions for VS Code and JetBrains integrate Claude Code directly into your IDE. Claude’s proposed edits appear inline in your files, streamlining review and tracking within the familiar editor interface. Simply run Claude Code in your IDE terminal to install.
どんな機能なのかは後ほど触れていきますが、ドキュメントでは次のように表現されています。
- Quick launch: Use Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux) to open Claude Code directly from your editor, or click the Claude Code button in the UI
- Diff viewing: Code changes can be displayed directly in the IDE diff viewer instead of the terminal. You can configure this in /config
- Selection context: The current selection/tab in the IDE is automatically shared with Claude Code
- File reference shortcuts: Use Cmd+Option+K (Mac) or Alt+Ctrl+K (Linux/Windows) to insert file references (e.g., @File#L1-99)
- Diagnostic sharing: Diagnostic errors (lint, syntax, etc.) from the IDE are automatically shared with Claude as you work
やってみる
Claude Code のインストール
それでは Claude Code をインストールしてみましょう。とは言いつつも、以下のシステム要件をクリアする必要があります。
- OS
- macOS 10.15+
- Ubuntu 20.04+/Debian 10+
- Windows via WSL
- Hardware: 4GB RAM minimum
- Software:
- Node.js 18+
- git 2.23+ (optional)
- GitHub or GitLab CLI for PR workflows (optional)
- ripgrep (rg) for enhanced file search (optional)
- Network: Internet connection required for authentication and AI processing
- Location: Available only in supported countries
問題なければ npm install でインストールを行います。
npm install -g @anthropic-ai/claude-code
claude
コマンドを実行すると、フォルダを信頼するかどうかを聞かれるため、 Yes, proceed を選択します。
claude_code % claude
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Do you trust the files in this folder? │
│ │
│ claude_code │
│ │
│ Claude Code may read files in this folder. Reading untrusted files may lead Claude Code to behave in an unexpected ways. │
│ │
│ With your permission Claude Code may execute files in this folder. Executing untrusted code is unsafe. │
│ │
│ https://docs.anthropic.com/s/claude-code-security │
│ │
│ ❯ 1. Yes, proceed │
│ 2. No, exit │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Enter to confirm · Esc to exit
╭────────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: claude_code │
╰────────────────────────────────────────────────────────╯
Tips for getting started:
1. Ask Claude to create a new app or clone a repository
2. Run /terminal-setup to set up terminal integration
3. Use Claude to help with file analysis, editing, bash commands and git
4. Be as specific as you would with another engineer for the best results
※ Tip: Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts Missing API key · Run /login
Missing API key · Run /login
の通り、ログインできていないため API 実行はできていないですね。
> hey!
⎿ Invalid API key · Please run /login
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts Missing API key · Run /login
Amazon Bedrock との統合
Claude Code は Amazon Bedrock と統合しています。
そのため、Amazon Bedrock 経由で API 実行をしつつ Claude Code を体験できます。
Amazon Bedrock と統合するための準備を行います。モデル有効化画面から Claude 4 Sonnet を有効化します。
以下の環境変数を指定し、Claude Code が Amazon Bedrock を利用するように設定します。
AWS_PROFILE
は適宜変更しましょう。
# Claude Code で Amazon Bedrock を使用するための環境変数を設定
export CLAUDE_CODE_USE_BEDROCK=1
# 使用するモデルの指定
export ANTHROPIC_MODEL='apac.anthropic.claude-sonnet-4-20250514-v1:0'
# AWS 認証情報の設定
export AWS_REGION='ap-northeast-1'
export AWS_PROFILE='hoge'
Claude Code の起動
Claude Code を呼び出してみます。せっかくなので、VS Code 拡張を使ってみます。
私は Mac を利用しているので、 Cmd + esc
で起動してみます。Claude Code が起動してきました。
私が設定した apac.anthropic.claude-sonnet-4-20250514-v1:0
が認識されていますね。
「メモ帳を作って欲しいです。
」とお願いしてみました。必要な作業がリストアップされ、起動開始しました。今は HTML を作り始めているようですね。
CSS を含んだ、HTML ファイルの生成が行われています。IDE integration で言及されてた Diff viewing
はこのことのようです。
数分待つと、メモ帳が作成されたとのことです。
開いてみると、確かにメモ帳が作成されていますね。
複数メモを保管することもできていました。
/cost
/cost
を利用することで、今発生しているセッションに対してのコストを確認できます。
調べてみたところ、Amazon Bedrock 経由で Claude 4 を利用する場合は、 Cache read/write が効いていない様子でした。(今後改善があるかもしれません)
/mcp
Claude Code ですが、 MCP に対応しています。
/mcp
を実行すると、 MCP サーバーが設定されていないことがわかります。
私は AWS Documentation MCP Server をよく使うので、以下のコマンドで MCP サーバーの追加を行います。
claude mcp add aws-documentation-mcp-server uvx "awslabs.aws-documentation-mcp-server@latest"
MCP Server 追加の有無を聞かれるので Yes を選択します。
インストールできていました。claude mcp list
を実行することでステータスも確認できていますね。ただし、/mcp
はうまく動いていなさそうでした。
セッションを貼り直すと、/mcp
でも認識してくれるようになりました。
「Amazon Bedrock で Claude 4 がサポートしているか確認して欲しい。Claude Sonnet 4 と Claude 4 Opus の違いについても教えて欲しい」と伺うと、MCP が動き始めました。
いくつかのステップを挟み、最終的な回答は以下になりました。うまく答えられている様子です。
/init
繰り返しファイルを検索されるのを止めるために、メモリ機能を使っていきます。
プロジェクトメモリ(./CLAUDE.md
)、ユーザーメモリ(~/.claude/CLAUDE.md
)、プロジェクトメモリ(ローカル、非推奨)の3パターンがあるのですが、今回はプロジェクトメモリを作っていきます。
/init
を利用することで Claude Code 側でプロジェクトメモリの作成を自動化できます。
作成されたファイルは以下のとおりです。うまくプロジェクト構造がまとめられていますね
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a simple Japanese notepad web application built as a single HTML file with embedded CSS and JavaScript. The app provides a complete note-taking experience with local storage persistence.
## Architecture
**Single-File Application**: The entire application is contained within `notepad.html` - HTML structure, CSS styling, and JavaScript functionality are all embedded in one file.
**Core Components**:
- **UI Layer**: Blue-themed responsive interface with header, controls, editor, and notes list
- **Storage Layer**: Uses browser localStorage for data persistence
- **Note Management**: CRUD operations for notes with title, content, and timestamps
- **Import/Export**: JSON-based backup and restore functionality
**Data Structure**: Notes are stored as JSON objects with `id`, `title`, `content`, `createdAt`, and `updatedAt` fields.
## Key Features
- Real-time note editing with auto-save prompts
- Local storage persistence
- Export/import functionality via JSON files
- Responsive design for mobile and desktop
- Keyboard shortcuts (Ctrl/Cmd+S to save, Ctrl/Cmd+N for new note)
- Unsaved changes detection with confirmation prompts
## Development Notes
Since this is a client-side only application with no build process, changes can be made directly to the HTML file and tested by opening it in a web browser. The application is entirely self-contained with no external dependencies.
The Japanese interface indicates this was built for Japanese users, with all UI text and messaging in Japanese.
まとめ
「Claude Code が一般提供されたので概要をまとめて、Amazon Bedrock 経由で使ってみた」でした。
VS Code と統合してから触り始めた民ですが、Cmd + esc
の組み合わせでささっと起動して、操作できるのクセになりますね。Roo Code との差はある程度、触ってみてからになりますが、ガンガン触ってみて、掴んでいけたらと思いました。
クラウド事業本部コンサルティング部のたかくに(@takakuni_)でした!