Loading...
    • 開発者ガイド
    • API リファレンス
    • MCP
    • リソース
    • リリースノート
    Search...
    ⌘K

    はじめの一歩

    Claudeの紹介クイックスタート

    モデルと料金

    モデル概要モデルの選択Claude 4.5の新機能Claude 4.5への移行モデルの廃止予定価格設定

    Claudeで構築する

    機能概要Messages API の使用コンテキストウィンドウプロンプトのベストプラクティス

    機能

    プロンプトキャッシングコンテキスト編集拡張思考ストリーミングメッセージバッチ処理引用多言語サポートトークンカウント埋め込みビジョンPDFサポートFiles API検索結果Google Sheetsアドオン

    ツール

    概要ツール使用の実装方法トークン効率的なツール使用細粒度ツールストリーミングBashツールコード実行ツールコンピュータ使用ツールテキストエディタツールWeb fetch toolウェブ検索ツールメモリツール

    エージェントスキル

    概要クイックスタートスキル作成のベストプラクティスAPIでエージェントスキルを使用する

    Agent SDK

    概要Agent SDK リファレンス - TypeScriptPython SDK

    ガイド

    ストリーミング入力権限の処理セッション管理Agent SDKのホスティングシステムプロンプトの変更SDK内のMCPカスタムツールSDKにおけるサブエージェントSDKでのスラッシュコマンドSDK内のエージェントスキルコストと使用量の追跡Todo リストSDK のプラグイン

    API内のMCP

    MCPコネクタリモートMCPサーバー

    Claude on 3rd-party platforms

    Amazon BedrockVertex AI

    プロンプトエンジニアリング

    概要プロンプトジェネレータープロンプトテンプレートの使用プロンプト改善ツール明確で直接的な指示例(マルチショットプロンプト)を使用してClaudeの動作を導くClaudeに考えさせる(CoT)XMLタグを使用Claudeに役割を与える(システムプロンプト)Claudeの応答を事前入力複雑なプロンプトのチェーン化長文コンテキストのヒント拡張思考のヒント

    テストと評価

    成功基準を定義するテストケースを開発する評価ツールの使用レイテンシの削減

    ガードレールを強化

    幻覚を減らす出力の一貫性を高めるジェイルブレイクの軽減handle-streaming-refusalsプロンプトリークの削減Claudeのキャラクターを維持

    管理とモニタリング

    Admin API概要使用量とコストAPIClaude Code Analytics API
    Console
    ガイド

    Todo リスト

    整理されたタスク管理のためにClaude Agent SDKを使用してtodoを追跡・表示する

    Todo追跡は、タスクを管理し、ユーザーに進捗を表示するための構造化された方法を提供します。Claude Agent SDKには、複雑なワークフローを整理し、タスクの進行状況についてユーザーに情報を提供するのに役立つ組み込みのtodo機能が含まれています。

    Todoのライフサイクル

    Todoは予測可能なライフサイクルに従います:

    1. タスクが特定されたときにpendingとして作成される
    2. 作業が開始されたときにin_progressにアクティブ化される
    3. タスクが正常に完了したときに完了する
    4. グループ内のすべてのタスクが完了したときに削除される

    Todoが使用される場合

    SDKは以下の場合に自動的にtodoを作成します:

    • 3つ以上の異なるアクションを必要とする複雑な複数ステップのタスク
    • 複数の項目が言及されているユーザー提供のタスクリスト
    • 進捗追跡の恩恵を受ける重要な操作
    • ユーザーがtodo整理を求める明示的な要求

    例

    Todo変更の監視

    TypeScript
    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    for await (const message of query({
      prompt: "React アプリのパフォーマンスを最適化し、todoで進捗を追跡する",
      options: { maxTurns: 15 }
    })) {
      // Todo更新はメッセージストリームに反映されます
      if (message.type === "tool_use" && message.name === "TodoWrite") {
        const todos = message.input.todos;
        
        console.log("Todoステータス更新:");
        todos.forEach((todo, index) => {
          const status = todo.status === "completed" ? "✅" : 
                        todo.status === "in_progress" ? "🔧" : "❌";
          console.log(`${index + 1}. ${status} ${todo.content}`);
        });
      }
    }
    Python
    from claude_agent_sdk import query
    
    async for message in query(
        prompt="React アプリのパフォーマンスを最適化し、todoで進捗を追跡する",
        options={"max_turns": 15}
    ):
        # Todo更新はメッセージストリームに反映されます
        if message.get("type") == "tool_use" and message.get("name") == "TodoWrite":
            todos = message["input"]["todos"]
            
            print("Todoステータス更新:")
            for i, todo in enumerate(todos):
                status = "✅" if todo["status"] == "completed" else \
                        "🔧" if todo["status"] == "in_progress" else "❌"
                print(f"{i + 1}. {status} {todo['content']}")

    リアルタイム進捗表示

    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    class TodoTracker {
      private todos: any[] = [];
      
      displayProgress() {
        if (this.todos.length === 0) return;
        
        const completed = this.todos.filter(t => t.status === "completed").length;
        const inProgress = this.todos.filter(t => t.status === "in_progress").length;
        const total = this.todos.length;
        
        console.log(`\n進捗: ${completed}/${total} 完了`);
        console.log(`現在作業中: ${inProgress} タスク\n`);
        
        this.todos.forEach((todo, index) => {
          const icon = todo.status === "completed" ? "✅" : 
                      todo.status === "in_progress" ? "🔧" : "❌";
          const text = todo.status === "in_progress" ? todo.activeForm : todo.content;
          console.log(`${index + 1}. ${icon} ${text}`);
        });
      }
      
      async trackQuery(prompt: string) {
        for await (const message of query({
          prompt,
          options: { maxTurns: 20 }
        })) {
          if (message.type === "tool_use" && message.name === "TodoWrite") {
            this.todos = message.input.todos;
            this.displayProgress();
          }
        }
      }
    }
    
    // 使用方法
    const tracker = new TodoTracker();
    await tracker.trackQuery("todoを使用して完全な認証システムを構築する");

    関連ドキュメント

    • TypeScript SDK リファレンス
    • Python SDK リファレンス
    • ストリーミング vs シングルモード
    • カスタムツール
    • Todoのライフサイクル
    • Todoが使用される場合
    • Todo変更の監視
    © 2025 ANTHROPIC PBC

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    © 2025 ANTHROPIC PBC