Mac で Claude Code を始める — インストールから subagent / MCP / hook まで(2026 年版) Mac で Claude Code を始める — インストールから subagent / MCP / hook まで(2026 年版)
- Claude Code は 2024 年末から 2026 年までで、ずいぶん別物になりました。
- 2025 年の頃は「ターミナルで使えるチャット型 AI」くらいの位置づけでしたが、2026 年現在は subagent(役割を分けた複数 AI)
Claude Code は 2024 年末の登場から 2026 年に至るまで、ターミナルで動く対話型 AI から、複数の自律エージェントを束ねる開発基盤へと姿を変えてきた。本稿では Mac での導入手順を起点に、subagent・MCP・hook という三つの中核機能を概観し、現在の使いどころを整理する。
導入はシンプルだ。Node.js を入れた環境で npm からパッケージを取得し、ターミナルで起動すれば、リポジトリの文脈を読み取りながらコードの生成や修正、テスト実行までを対話的に進められる。2025 年頃は「ターミナルで使えるチャット型 AI」という位置づけが中心だったが、現在は単発の補助を超えて、作業を任せる前提のツールへと比重が移ったと見られる。
大きな変化の一つが subagent だ。これは役割を分けた複数の AI を協調させる仕組みで、調査担当・実装担当・レビュー担当のようにタスクを分業させられる。メインのエージェントが全体を統括し、細かな処理を子エージェントに委ねることで、長い作業でも文脈の混線を抑えやすくなる。複雑なリファクタリングや大規模な探索で効果が出やすいとされる。
MCP(Model Context Protocol)は、AI と外部ツールを結ぶ共通規格として広がった。Anthropic が公開した仕様で、データベースやファイルシステム、各種 SaaS への接続を MCP サーバー経由で標準化する。対応サーバーを登録すれば、Claude Code から外部リソースを直接参照・操作でき、独自連携を都度作り込む手間が減る。OpenAI や Google なども含め他社の対応が進んでおり、エコシステムは拡大傾向にある。
2025 年の頃は「ターミナルで使えるチャット型 AI」くらいの位置づけでしたが、2026 年現在は subagent(役割を分けた複数 AI)
hook は特定のイベントに合わせて任意の処理を差し込む仕組みで、ファイル編集後の自動整形やテスト起動、通知などを自動化できる。これにより、AI の出力をそのまま開発フローへ組み込みやすくなる。
全体として、Claude Code は補助ツールから自律的な開発パートナーへ近づいたといえる。一方で権限管理やコスト、生成物のレビュー体制は依然として重要で、subagent や MCP を広く有効化する際は範囲を見極めたい。まずは小さな構成から試し、必要に応じて hook や外部連携を足していく進め方が無難だろう。
Claude Code has changed substantially between late 2024 and 2026, and anyone returning to it after a long break may not recognize the tool. What started as a terminal-based chat assistant has grown into a coordinated development environment built around three core ideas: subagents that split work across specialized roles, the Model Context Protocol (MCP) for connecting external tools and data, and hooks that automate steps in the coding loop. For Mac users in particular, the setup path has become smoother, and understanding these pieces matters because they define how the tool actually fits into a real workflow rather than acting as a novelty.
Installation on macOS is the natural first step. Claude Code typically runs as a command-line tool, so you start from the Terminal and authenticate against an Anthropic account or API key. Most users install via npm or a provided installer script, then run an initialization command inside a project directory. From there, Claude Code reads the local files, builds context, and lets you describe changes in natural language while it edits, runs, and verifies code on your behalf. The experience is closer to pair programming than to copy-pasting from a chat window, which is the main reason it has gained traction with developers who previously used web-based assistants.
The most visible evolution is the subagent model. Rather than one assistant trying to do everything, you can define agents with distinct responsibilities, such as one that focuses on writing tests, another that reviews code, and another that handles documentation. Each subagent operates with its own context and instructions, which appears to reduce confusion on larger tasks and keeps the main conversation cleaner. This mirrors a broader industry direction toward multi-agent orchestration, where a coordinator delegates to specialists. The trade-off is added complexity in configuration, so newcomers are generally advised to start with a single agent before splitting roles.
MCP is the second pillar and arguably the most consequential for integration. The Model Context Protocol is an open standard, introduced by Anthropic in late 2024, that lets AI clients talk to external servers exposing tools, files, and APIs in a consistent way. By configuring MCP servers, Claude Code can reach databases, issue trackers, browsers, or internal services without bespoke glue code for each one. The protocol has been widely adopted across editors and assistants, and many community-built servers exist for common platforms. On a Mac, setup usually involves editing a configuration file that lists the servers and their startup commands, after which the tools become available inside sessions.
Hooks round out the picture by letting you run custom scripts at defined points, such as before a commit, after a file edit, or when a task completes. This is where Claude Code starts to resemble a programmable build system: you can enforce linting, trigger tests, or block unsafe actions automatically. Used well, hooks reduce manual review and create guardrails, which is increasingly important as agents take more autonomous actions. Used carelessly, they can cause unexpected behavior, so testing them in a sandbox is sensible.
Context for newcomers helps here. Claude Code competes with and complements tools like GitHub Copilot, Cursor, and the various open-source agent frameworks, and the lines between them keep blurring as MCP support spreads. Subscription tiers, model availability, and rate limits change frequently, so pricing and exact capabilities should be checked against current documentation rather than assumed. Anyone evaluating these tools should also weigh data handling, since granting an agent access to repositories and external systems carries real security and compliance considerations.
Practically, a reasonable path is to install the tool, run it on a small project, and rely on plain conversation before layering on advanced features. Add one MCP server when you have a concrete integration need, define a subagent once a task clearly splits into roles, and introduce hooks only after the basics feel reliable. This staged approach avoids the common mistake of configuring everything at once and then struggling to debug. As of 2026, Claude Code is best understood not as a chatbot but as an extensible agentic platform, and the Mac setup is mostly about wiring these components together thoughtfully.
本ページの本文・要約は AI による自動生成です。正確性は元記事 (zenn.dev) をご確認ください。