Loading...
    • 개발자 가이드
    • API 참고자료
    • MCP
    • 리소스
    • 릴리스 노트
    Search...
    ⌘K

    첫 번째 단계

    Claude 소개빠른 시작

    모델 및 가격

    모델 개요모델 선택하기Claude 4.5의 새로운 기능Claude 4.5로 마이그레이션모델 지원 중단가격 정책

    Claude로 빌드하기

    기능 개요Messages API 작업컨텍스트 윈도우프롬프트 작성 모범 사례

    기능

    프롬프트 캐싱컨텍스트 편집확장된 사고스트리밍 메시지배치 처리인용다국어 지원토큰 카운팅임베딩비전PDF 지원Files API검색 결과Google Sheets 애드온

    도구

    개요도구 사용을 구현하는 방법토큰 효율적인 도구 사용세밀한 도구 스트리밍Bash 도구코드 실행 도구컴퓨터 사용 도구텍스트 편집기 도구웹 페치 도구웹 검색 도구메모리 도구

    에이전트 스킬

    개요빠른 시작Skill 작성 모범 사례Skills 사용하기

    Agent SDK

    개요Agent SDK 참조 - TypeScriptPython SDK

    가이드

    스트리밍 입력권한 처리세션 관리Agent SDK 호스팅시스템 프롬프트 수정하기SDK에서의 MCP사용자 정의 도구SDK의 서브에이전트SDK의 슬래시 명령어SDK의 에이전트 스킬비용 및 사용량 추적할 일 목록SDK의 플러그인

    API의 MCP

    MCP 커넥터원격 MCP 서버

    타사 플랫폼의 Claude

    Amazon BedrockVertex AI

    프롬프트 엔지니어링

    개요프롬프트 생성기프롬프트 템플릿 사용하기프롬프트 개선기명확하고 직접적으로예시(멀티샷 프롬프팅) 사용Claude가 생각하도록 하기(CoT)XML 태그 사용Claude에게 역할 부여하기 (시스템 프롬프트)Claude의 응답 미리 채우기복잡한 프롬프트 체이닝긴 컨텍스트 팁확장 사고 팁

    테스트 및 평가

    성공 기준 정의하기테스트 케이스 개발평가 도구 사용하기지연 시간 줄이기

    보안 강화

    환각 현상 줄이기출력 일관성 높이기탈옥 완화handle-streaming-refusals프롬프트 유출 감소Claude의 캐릭터 유지

    관리 및 모니터링

    Admin API 개요사용량 및 비용 APIClaude Code Analytics API
    Console
    가이드

    SDK의 플러그인

    Agent SDK를 통해 명령어, 에이전트, 스킬 및 훅을 사용하여 Claude Code를 확장하는 사용자 정의 플러그인 로드

    플러그인을 사용하면 프로젝트 전체에서 공유할 수 있는 사용자 정의 기능으로 Claude Code를 확장할 수 있습니다. Agent SDK를 통해 로컬 디렉터리에서 플러그인을 프로그래밍 방식으로 로드하여 에이전트 세션에 사용자 정의 슬래시 명령어, 에이전트, 스킬, 훅 및 MCP 서버를 추가할 수 있습니다.

    플러그인이란 무엇인가요?

    플러그인은 다음을 포함할 수 있는 Claude Code 확장 패키지입니다:

    • 명령어: 사용자 정의 슬래시 명령어
    • 에이전트: 특정 작업을 위한 전문화된 서브에이전트
    • 스킬: Claude가 자율적으로 사용하는 모델 호출 기능
    • 훅: 도구 사용 및 기타 이벤트에 응답하는 이벤트 핸들러
    • MCP 서버: Model Context Protocol을 통한 외부 도구 통합

    플러그인 구조 및 플러그인 생성 방법에 대한 완전한 정보는 플러그인을 참조하세요.

    플러그인 로드

    옵션 구성에서 로컬 파일 시스템 경로를 제공하여 플러그인을 로드합니다. SDK는 여러 위치에서 여러 플러그인을 로드하는 것을 지원합니다.

    TypeScript
    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    for await (const message of query({
      prompt: "Hello",
      options: {
        plugins: [
          { type: "local", path: "./my-plugin" },
          { type: "local", path: "/absolute/path/to/another-plugin" }
        ]
      }
    })) {
      // Plugin commands, agents, and other features are now available
    }
    Python
    import asyncio
    from claude_agent_sdk import query
    
    async def main():
        async for message in query(
            prompt="Hello",
            options={
                "plugins": [
                    {"type": "local", "path": "./my-plugin"},
                    {"type": "local", "path": "/absolute/path/to/another-plugin"}
                ]
            }
        ):
            # Plugin commands, agents, and other features are now available
            pass
    
    asyncio.run(main())

    경로 사양

    플러그인 경로는 다음과 같을 수 있습니다:

    • 상대 경로: 현재 작업 디렉터리를 기준으로 확인됨 (예: "./plugins/my-plugin")
    • 절대 경로: 전체 파일 시스템 경로 (예: "/home/user/plugins/my-plugin")

    경로는 플러그인의 루트 디렉터리(.claude-plugin/plugin.json을 포함하는 디렉터리)를 가리켜야 합니다.

    플러그인 설치 확인

    플러그인이 성공적으로 로드되면 시스템 초기화 메시지에 나타납니다. 플러그인을 사용할 수 있는지 확인할 수 있습니다:

    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    for await (const message of query({
      prompt: "Hello",
      options: {
        plugins: [{ type: "local", path: "./my-plugin" }]
      }
    })) {
      if (message.type === "system" && message.subtype === "init") {
        // Check loaded plugins
        console.log("Plugins:", message.plugins);
        // Example: [{ name: "my-plugin", path: "./my-plugin" }]
    
        // Check available commands from plugins
        console.log("Commands:", message.slash_commands);
        // Example: ["/help", "/compact", "my-plugin:custom-command"]
      }
    }

    플러그인 명령어 사용

    플러그인의 명령어는 충돌을 피하기 위해 플러그인 이름으로 자동 네임스페이스됩니다. 형식은 plugin-name:command-name입니다.

    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    // Load a plugin with a custom /greet command
    for await (const message of query({
      prompt: "/my-plugin:greet",  // Use plugin command with namespace
      options: {
        plugins: [{ type: "local", path: "./my-plugin" }]
      }
    })) {
      // Claude executes the custom greeting command from the plugin
      if (message.type === "assistant") {
        console.log(message.content);
      }
    }

    CLI를 통해 플러그인을 설치한 경우 (예: /plugin install my-plugin@marketplace), SDK에서 설치 경로를 제공하여 사용할 수 있습니다. CLI로 설치된 플러그인은 ~/.claude/plugins/에서 확인하세요.

    완전한 예제

    플러그인 로드 및 사용을 보여주는 전체 예제입니다:

    import { query } from "@anthropic-ai/claude-agent-sdk";
    import * as path from "path";
    
    async function runWithPlugin() {
      const pluginPath = path.join(__dirname, "plugins", "my-plugin");
    
      console.log("Loading plugin from:", pluginPath);
    
      for await (const message of query({
        prompt: "What custom commands do you have available?",
        options: {
          plugins: [
            { type: "local", path: pluginPath }
          ],
          maxTurns: 3
        }
      })) {
        if (message.type === "system" && message.subtype === "init") {
          console.log("Loaded plugins:", message.plugins);
          console.log("Available commands:", message.slash_commands);
        }
    
        if (message.type === "assistant") {
          console.log("Assistant:", message.content);
        }
      }
    }
    
    runWithPlugin().catch(console.error);

    플러그인 구조 참조

    플러그인 디렉터리는 .claude-plugin/plugin.json 매니페스트 파일을 포함해야 합니다. 선택적으로 다음을 포함할 수 있습니다:

    my-plugin/
    ├── .claude-plugin/
    │   └── plugin.json          # Required: plugin manifest
    ├── commands/                 # Custom slash commands
    │   └── custom-cmd.md
    ├── agents/                   # Custom agents
    │   └── specialist.md
    ├── skills/                   # Agent Skills
    │   └── my-skill/
    │       └── SKILL.md
    ├── hooks/                    # Event handlers
    │   └── hooks.json
    └── .mcp.json                # MCP server definitions

    플러그인 생성에 대한 자세한 정보는 다음을 참조하세요:

    • 플러그인 - 완전한 플러그인 개발 가이드
    • 플러그인 참조 - 기술 사양 및 스키마

    일반적인 사용 사례

    개발 및 테스트

    전역으로 설치하지 않고 개발 중에 플러그인을 로드합니다:

    plugins: [
      { type: "local", path: "./dev-plugins/my-plugin" }
    ]

    프로젝트별 확장

    팀 전체의 일관성을 위해 프로젝트 저장소에 플러그인을 포함합니다:

    plugins: [
      { type: "local", path: "./project-plugins/team-workflows" }
    ]

    여러 플러그인 소스

    다양한 위치의 플러그인을 결합합니다:

    plugins: [
      { type: "local", path: "./local-plugin" },
      { type: "local", path: "~/.claude/custom-plugins/shared-plugin" }
    ]

    문제 해결

    플러그인이 로드되지 않음

    플러그인이 초기화 메시지에 나타나지 않으면:

    1. 경로 확인: 경로가 플러그인 루트 디렉터리(.claude-plugin/을 포함하는)를 가리키는지 확인하세요
    2. plugin.json 검증: 매니페스트 파일이 유효한 JSON 구문을 가지고 있는지 확인하세요
    3. 파일 권한 확인: 플러그인 디렉터리를 읽을 수 있는지 확인하세요

    명령어를 사용할 수 없음

    플러그인 명령어가 작동하지 않으면:

    1. 네임스페이스 사용: 플러그인 명령어는 plugin-name:command-name 형식이 필요합니다
    2. 초기화 메시지 확인: 명령어가 올바른 네임스페이스와 함께 slash_commands에 나타나는지 확인하세요
    3. 명령어 파일 검증: 명령어 마크다운 파일이 commands/ 디렉터리에 있는지 확인하세요

    경로 확인 문제

    상대 경로가 작동하지 않으면:

    1. 작업 디렉터리 확인: 상대 경로는 현재 작업 디렉터리에서 확인됩니다
    2. 절대 경로 사용: 안정성을 위해 절대 경로 사용을 고려하세요
    3. 경로 정규화: 경로 유틸리티를 사용하여 경로를 올바르게 구성하세요

    참고 항목

    • 플러그인 - 완전한 플러그인 개발 가이드
    • 플러그인 참조 - 기술 사양
    • 슬래시 명령어 - SDK에서 슬래시 명령어 사용
    • 서브에이전트 - 전문화된 에이전트 작업
    • 스킬 - Agent Skills 사용
      © 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