コンテンツにスキップ

クイックスタート — 最初のエージェントを5分で

ゼロからリポジトリ内のファイルを読み、その内容を伝えるエージェントを立ち上げるまでの最短経路は、ターミナルでわずか5分です。

前提条件

  • macOS / Linux / WSL2
  • Node 22+
  • 動作するClaude Codeインストール(またはGCP Vertex設定済み — セットアップ参照)
  • 空のディレクトリ: mkdir my-first-agent && cd my-first-agent

ステップ1 · エージェントのホームを作成

Terminal window
mkdir -p .claude/agents

ステップ2 · SOULを書く

.claude/agents/file-reader.md を作成します。

---
agent_id: file-reader
model: claude-sonnet-4-6
---
# Identity
I am a file-reader. I read files in the working directory and summarise them.
# Workflow
When invoked:
1. List files in the current directory
2. Read the most recent .md or .txt file
3. Print a 3-line summary
4. Exit

ステップ3 · 読ませるファイルを置く

Terminal window
echo "# Hello World\n\nThis is my first file.\nLet's see if the agent reads it." > sample.md

ステップ4 · 起動

Terminal window
claude --agent file-reader

以下のような出力が得られるはずです。

[Reading sample.md...]
Summary:
- The file is titled "Hello World"
- Contains 3 short lines of plain prose
- Functions as a hello-world test for the file-reader agent

以上です。 動作するエージェントが完成しました。

ステップ5 · ツールを追加する

エージェントを実用的にするには、ツールを与えます。SOULにMCPサーバー参照を追加します。

mcp_servers:
- filesystem

これでエージェントは作業ディレクトリだけでなく、ディレクトリツリー全体を読めるようになります。実際のプロジェクトで試してみてください。

何が起きたのか

ステップLIFEOSAIが行ったこと
1エージェントのホームを作成 — .claude/agents/ がSOULの置き場所です
2SOULを記述 — アイデンティティ + ワークフロー + (任意で)ツール
3素材を与える — 作業ディレクトリ内のファイル
4起動 — Claude CodeがSOULを読み込み、ワークフローを実行し、結果を出力

同じパターンがスケールします。9エージェントのGuardrail Labは、9つのSOULにスキルとスケジュール起動を行うオーケストレーションレイヤーを足したものです。

次に読む