מעודכן לאפריל 2026 20 דקות קריאה למפתחים ומשתמשים מתקדמים

מדריך Claude AI המלא
Tool Use, System Prompts, API ו-Extended Thinking

כל מה שצריך לדעת על Claude מבית Anthropic — מה מייחד אותו, איך כותבים System Prompts שעובדים, Tool Use צעד אחר צעד, ואיך בונים סוכנים חכמים עם ה-API.

200K
Context Window
Constitutional
AI Safety
#1
Coding Benchmarks

מה זה Claude?

Claude הוא מודל שפה גדול (LLM) מבית Anthropic — חברת AI שנוסדה ב-2021 על ידי לשעבר עובדי OpenAI, בראשות Dario Amodei ו-Daniela Amodei. ה-DNA של Anthropic הוא AI Safety — פיתוח מודלים בטוחים, יושרניים ושקופים יותר.

Claude נחשב לאחד המתחרים החזקים ביותר של GPT-4o, ובמספר תחומים — בעיקר כתיבת קוד, ניתוח מסמכים ו-הבנת הקשר ארוך — הוא פשוט מנצח.

הגרסאות הנוכחיות (אפריל 2026)

Claude Sonnet 4.6
הכי מומלץ
האיזון המושלם בין כוח למחיר. מצוין לקוד, כתיבה, ניתוח. ה-default לרוב המשתמשים.
$3 / $15 per 1M tokens
Claude Haiku 4.5
הכי מהיר
מהיר וזול. מתאים לאפליקציות עם latency נמוך, chatbots, ומשימות פשוטות.
$0.80 / $4 per 1M tokens
Claude Opus 4.6
Legacy
הגרסה הישנה החזקה ביותר. רלוונטי למשימות מורכבות במיוחד שדורשות עומק.
$15 / $75 per 1M tokens

מה מייחד את Claude?

השוואה מהירה: Claude vs ChatGPT vs Gemini

קריטריון Claude Sonnet 4.6 GPT-4o Gemini 2.5 Pro
Context Window 200K 128K 2M 🏆
כתיבת קוד מעולה 🏆 מצוין מצוין
עברית טוב מצוין 🏆 טוב
יושר ושקיפות מעולה 🏆 טוב טוב
Tool Use / Agents מעולה 🏆 מצוין טוב
Extended Thinking יש o1 / o3 יש 🏆
Artifacts / Canvas Artifacts 🏆 Canvas אין

מפת דרכים לשליטה ב-Claude

להלן מסלול למידה מובנה — מ-Zero ועד בניית סוכנים מתקדמים עם Claude API. כל שלב בנוי על הקודם.

Stage 1 ממשק Claude.ai — התחלה מהירה שבוע 1
Claude.ai Basicsהכרת הממשק, יצירת שיחות, שמירה בהיסטוריה
System Prompts בסיסייםהגדרת תפקיד ל-Claude לפני תחילת שיחה
Artifactsיצירת קוד, SVG ו-React components ישירות מהצ'אט
Stage 2 Prompt Engineering ו-Projects שבוע 2–3
Prompt Engineering לקלודXML tags, Chain of Thought, Role prompting
Projectsניהול זיכרון וקבצים לפי פרויקט בממשק Claude.ai
Memoryהוראות מתמשכות ו-Custom Instructions
Stage 3 Claude API — Python ו-TypeScript שבוע 3–4
Python SDKהתקנה, API key, Messages API ראשון
TypeScript SDK@anthropic-ai/sdk, async/await, error handling
Streamingstream_manager, on_text, real-time responses
Stage 4 Tool Use, Vision, Documents שבוע 4–6
Function Callingהגדרת כלים ב-JSON Schema, multi-turn tool use
Vision APIניתוח תמונות, screenshots, PDF documents
Document Analysisחילוץ מידע מובנה מ-PDF ו-HTML
Stage 5 Extended Thinking, Agents, MCP, Computer Use שבוע 6+
Extended Thinkingחשיבה עמוקה עם budget_tokens, מתאים לבעיות מורכבות
MCP ProtocolModel Context Protocol — חיבור Claude לכלים חיצוניים
Computer UseClaude שולט בדפדפן ובמחשב — ממלא טפסים, גולש, מבצע

System Prompts ב-Claude — עומק ומעשה

System Prompt הוא ההוראה שנשלחת ל-Claude לפני כל שיחה עם המשתמש. זה המקום בו אתה מגדיר מי הוא, מה הוא יודע, ומה הגבולות שלו.

מה מייחד System Prompts בקלוד?

Claude "לוקח ברצינות" את ה-System Prompt יותר ממודלים מתחרים. הוא לא ינסה לעקוף אותו, ו-Constitutional AI מבטיח שהוא יפעל לפי ערכים מובנים גם כשמנסים לשכנע אותו אחרת.

lightbulb
Constitutional AI — מה זה?

Anthropic אימנה את Claude על "חוקה" — מערכת עקרונות אתיים. כש-Claude מקבל הוראה שמנוגדת לחוקה, הוא יסרב בעדינות ויסביר מדוע. זה הופך אותו לאמין יותר ב-Production מסביבות שדורשות עקביות.

Best Practices לSystem Prompt

Template מלא לסוכן Claude

אתה [תפקיד] המסייע ל[ארגון/משתמש].

<context>
[רקע על החברה, המוצר, או המשתמש]
</context>

<capabilities>
כישורים:
- [כישור 1]
- [כישור 2]
- [כישור 3]
</capabilities>

<constraints>
הגבלות:
- אל תענה על שאלות שאינן קשורות ל[נושא]
- תמיד [כלל חשוב]
- אם אינך יודע, אמור "אני לא יודע" ואל תבדה
</constraints>

<format>
פורמט תשובות:
השתמש ב-Markdown. היה תמציתי אך מלא.
תמיד סיים עם: "האם יש משהו נוסף שאתה רוצה לדעת?"
</format>
info
XML Tags ב-Claude — למה זה עובד?

בניגוד ל-GPT-4o שמגיב היטב ל-Markdown headers, Claude מגיב טוב יותר ל-XML Tags בתוך ה-System Prompt. Anthropic אפילו ממליצה על זה בתיעוד הרשמי — הוא "מבין" את המבנה ומשתמש בו לחלק את ההוראות לסגמנטים ברורים.

Tool Use / Function Calling — מעמיק

Tool Use (המכונה גם Function Calling) הוא היכולת של Claude לקרוא לפונקציות חיצוניות שאתה מגדיר. במקום לענות מידע מהזיכרון, Claude יכול לשאול מסד נתונים, לקרוא API, לשלוח מייל, או לבצע כל פעולה שתכתוב לו.

מחזור חיים של Tool Use

1
שאלת המשתמש — "מה מזג האוויר בתל אביב?"
2
Claude בוחר כלי — מחזיר stop_reason: "tool_use" עם שם הכלי והפרמטרים
3
הקוד שלך מריץ את הפונקציה — קריאה ל-API מזג אוויר, חזרה עם התוצאה
4
שליחת תוצאה בחזרה ל-Claude — Claude מעבד את המידע ומנסח תשובה סופית

קוד Python מלא — Tool Use

import anthropic

client = anthropic.Anthropic(api_key="sk-ant-...")

# הגדרת כלים
tools = [
  {
    "name": "get_weather",
    "description": "מחזיר מזג אוויר עדכני לעיר מסוימת",
    "input_schema": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string",
          "description": "שם העיר באנגלית, למשל: Tel Aviv"
        },
        "unit": {
          "type": "string",
          "enum": ["celsius", "fahrenheit"],
          "description": "יחידת טמפרטורה"
        }
      },
      "required": ["city"]
    }
  }
]

# קריאה ראשונה — Claude בוחר כלי
response = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=1024,
  tools=tools,
  messages=[
    {"role": "user", "content": "מה מזג האוויר בתל אביב היום?"}
  ]
)

# בדיקה אם Claude ביקש כלי
if response.stop_reason == "tool_use":
  tool_use = next(
    b for b in response.content if b.type == "tool_use"
  )

  print(f"Claude ביקש: {tool_use.name}")
  print(f"פרמטרים: {tool_use.input}")

  # הרצת הפונקציה שלנו
  tool_result = get_weather(
    tool_use.input["city"],
    tool_use.input.get("unit", "celsius")
  )

  # שליחת התוצאה בחזרה ל-Claude
  final_response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    tools=tools,
    messages=[
      {"role": "user", "content": "מה מזג האוויר בתל אביב היום?"},
      {"role": "assistant", "content": response.content},
      {
        "role": "user",
        "content": [{
          "type": "tool_result",
          "tool_use_id": tool_use.id,
          "content": str(tool_result)
        }]
      }
    ]
  )

  print(final_response.content[0].text)

Multi-turn Tool Use

ב-Multi-turn Tool Use, Claude יכול לקרוא לכמה כלים ברצף. למשל: "תמצא את כל ה-leads שלא הגיבו השבוע, שלח להם מייל follow-up, ועדכן את ה-CRM". Claude ינהל את הרצף בעצמו.

warning
שגיאות נפוצות ב-Tool Use

1. שכחת לשלוח את tool_result בחזרה — Claude יחכה לתשובה ולא ימשיך. 2. שגיאה בJSON Schema — Claude לא יצליח להבין את הכלי. 3. description לא מדויק — Claude יבחר כלי לא נכון.

Extended Thinking — חשיבה עמוקה

Extended Thinking הוא מצב מיוחד ב-Claude Sonnet 4.6 שמאפשר למודל "לחשוב בקול" לפני שהוא עונה. בדומה ל-Chain of Thought, אך ב-scale גדול יותר — עם תקציב טוקנים ייעודי לחשיבה.

מה ההבדל מ-Chain of Thought רגיל?

מתי להשתמש ב-Extended Thinking?

קוד — הפעלת Extended Thinking

import anthropic

client = anthropic.Anthropic(api_key="sk-ant-...")

response = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=16000,
  thinking={
    "type": "enabled",
    "budget_tokens": 10000  # תקציב הטוקנים לחשיבה
  },
  messages=[{
    "role": "user",
    "content": """
    יש לי מערכת של 3 שרתים. שרת A עומד 40% מהזמן,
    שרת B עומד 70% מהזמן, שרת C עומד 20% מהזמן.
    מה הסיכוי שלפחות שני שרתים פועלים בו-זמנית?
    הסבר את הפתרון שלב אחר שלב.
    """
  }]
)

# איטרציה על blocks (יש thinking block + text block)
for block in response.content:
  if block.type == "thinking":
    print("--- תהליך חשיבה פנימי ---")
    print(block.thinking[:500], "...")  # הדפסת חלק
  elif block.type == "text":
    print("--- תשובה סופית ---")
    print(block.text)
tips_and_updates
כמה budget_tokens לתת?

בעיה פשוטה: 1,000–3,000. בעיה בינונית: 5,000–10,000. בעיה מורכבת מאוד: עד 32,000. שים לב ש-max_tokens חייב להיות גדול מ-budget_tokens.

Artifacts, Computer Use ו-Vision

Artifacts — יצירה ישירה מהצ'אט

Artifacts הוא פיצ'ר ייחודי ל-Claude.ai שמאפשר יצירת קבצים עם Preview בזמן אמת. כשאתה מבקש מ-Claude לכתוב קוד, הוא פותח Panel נפרד עם עורך + תצוגה מקדימה.

code
טיפ: בקש Artifacts מפורשות

כתוב "צור Artifact של..." כדי לאלץ Claude לפתוח את ה-Artifact Panel. בלי המילה הזו, הוא לפעמים יכתוב קוד inline בשיחה.

Computer Use — Claude שולט במחשב

Computer Use הוא capability ניסיוני שמאפשר ל-Claude לקבל screenshots של מסך ולבצע פעולות — לחיצות עכבר, הקלדה, גלילה. הוא רואה את המסך ומגיב לו.

Vision API — ניתוח תמונות ומסמכים

import anthropic
import base64

client = anthropic.Anthropic(api_key="sk-ant-...")

# קריאת תמונה
with open("screenshot.png", "rb") as f:
  image_data = base64.standard_b64encode(f.read()).decode("utf-8")

response = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=1024,
  messages=[{
    "role": "user",
    "content": [
      {
        "type": "image",
        "source": {
          "type": "base64",
          "media_type": "image/png",
          "data": image_data,
        },
      },
      {
        "type": "text",
        "text": "מה יש בתמונה? תתאר כל פרט."
      }
    ],
  }]
)

print(response.content[0].text)

Claude API — המדריך הטכני

התקנה ו-Authentication

# Python
pip install anthropic

# TypeScript / Node.js
npm install @anthropic-ai/sdk

# Environment variable (מומלץ — לא בקוד!)
export ANTHROPIC_API_KEY="sk-ant-api03-..."

Messages API — כל הפרמטרים

import anthropic

client = anthropic.Anthropic()  # לוקח מ-ANTHROPIC_API_KEY

message = client.messages.create(
  model="claude-sonnet-4-6",  # מודל
  max_tokens=1024,                      # מקסימום טוקנים בתשובה
  system="אתה עוזר מועיל בעברית.",    # System Prompt
  messages=[
    {
      "role": "user",
      "content": "מה ההבדל בין ML ל-AI?"
    }
  ]
)

print(message.content[0].text)
print(f"Input tokens: {message.usage.input_tokens}")
print(f"Output tokens: {message.usage.output_tokens}")

Streaming — תשובות בזמן אמת

import anthropic

client = anthropic.Anthropic()

# Streaming
with client.messages.stream(
  model="claude-sonnet-4-6",
  max_tokens=1024,
  messages=[{"role": "user", "content": "כתוב סיפור קצר"}]
) as stream:
  for text in stream.text_stream:
    print(text, end="", flush=True)

TypeScript SDK

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
});

const message = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  system: "אתה עוזר מועיל.",
  messages: [
    { role: "user", content: "שלום קלוד!" }
  ],
});

console.log(message.content[0].text);

טבלת תמחור — אפריל 2026

מודל Input (per 1M) Output (per 1M) Context מומלץ לְ
Claude Sonnet 4.6 $3.00 $15.00 200K Production כללי, קוד
Claude Haiku 4.5 $0.80 $4.00 200K נפח גבוה, chatbots
Claude Sonnet 4.6 $3.00 $15.00 200K Extended Thinking
Claude Opus 4.6 $15.00 $75.00 200K Legacy בלבד

5 פרויקטים מעשיים עם Claude

להלן 5 פרויקטים מדורגים לפי רמת קושי — מ-Hello World ועד Multi-Agent System מלא.

מתחיל פרויקט 1: Document Analyzer

קלוד קורא PDF ומחלץ מידע מובנה — שמות, תאריכים, סכומים, פריטי פעולה.

import anthropic, base64, json

client = anthropic.Anthropic()

def analyze_document(pdf_path: str) -> dict:
    with open(pdf_path, "rb") as f:
        pdf_data = base64.standard_b64encode(f.read()).decode()

    response = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=2048,
        system="""אתה מנתח מסמכים מקצועי.
חלץ מהמסמך ומחזיר JSON עם השדות:
- summary: סיכום קצר (2-3 משפטים)
- key_dates: מערך תאריכים חשובים
- action_items: מערך פריטי פעולה
- parties: שמות הצדדים המעורבים""",
        messages=[{
            "role": "user",
            "content": [
                {
                    "type": "document",
                    "source": {
                        "type": "base64",
                        "media_type": "application/pdf",
                        "data": pdf_data
                    }
                },
                {"type": "text", "text": "נתח את המסמך הזה"}
            ]
        }]
    )

    return json.loads(response.content[0].text)

result = analyze_document("contract.pdf")
print(result)
בינוני פרויקט 2: Code Review Bot

סוכן שבודק Pull Requests, מזהה בעיות, ומציע שיפורים קונקרטיים — כולל דוגמאות קוד.

import anthropic

client = anthropic.Anthropic()

REVIEWER_SYSTEM = """אתה מהנדס בכיר המבצע Code Review.
לכל בעיה שאתה מוצא, ספק:
1. תיאור הבעיה
2. רמת חומרה: CRITICAL / MAJOR / MINOR
3. דוגמת קוד מתוקן

בדוק: ביצועים, אבטחה, קריאות, Best Practices."""

def review_code(code: str, language: str = "python") -> str:
    response = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=3000,
        system=REVIEWER_SYSTEM,
        messages=[{
            "role": "user",
            "content": f"בצע Code Review על הקוד הבא ({language}):\n\n```{language}\n{code}\n```"
        }]
    )
    return response.content[0].text

with open("my_code.py") as f:
    code = f.read()

review = review_code(code)
print(review)
בינוני פרויקט 3: Customer Support Agent עם Tool Use + CRM

סוכן תמיכה שמחובר ל-CRM — מושך פרטי לקוח, קורא היסטוריית פניות, ומעדכן tickets בזמן אמת.

crm_tools = [
  {
    "name": "get_customer_info",
    "description": "מושך פרטי לקוח לפי מספר ID",
    "input_schema": {
      "type": "object",
      "properties": {
        "customer_id": {"type": "string"}
      },
      "required": ["customer_id"]
    }
  },
  {
    "name": "create_ticket",
    "description": "פותח ticket תמיכה חדש",
    "input_schema": {
      "type": "object",
      "properties": {
        "customer_id": {"type": "string"},
        "subject": {"type": "string"},
        "priority": {
          "type": "string",
          "enum": ["low", "medium", "high", "critical"]
        }
      },
      "required": ["customer_id", "subject", "priority"]
    }
  }
]

response = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=2048,
  system="אתה נציג תמיכה מקצועי. יש לך גישה ל-CRM. ענה ללקוחות בצורה חמה ומקצועית.",
  tools=crm_tools,
  messages=[{
    "role": "user",
    "content": "היי, לקוח מספר 12345 מתלונן שהזמנה שלו לא הגיעה"
  }]
)
מתקדם פרויקט 4: Computer Use Automation

Claude ממלא טפסים, מנווט באתרים, ומבצע אוטומציות על מסך אמיתי ללא API.

import anthropic

client = anthropic.Anthropic()

# Computer Use tools מובנים ב-Claude
response = client.messages.create(
  model="claude-sonnet-4-6",
  max_tokens=4096,
  tools=[
    {
      "type": "computer_20241022",
      "name": "computer",
      "display_width_px": 1920,
      "display_height_px": 1080
    }
  ],
  messages=[{
    "role": "user",
    "content": "פתח את הדפדפן, כנס ל-google.com וחפש 'Anthropic Claude'"
  }]
)

# Claude יחזיר screenshot actions — לחיצות, הקלדות וכו'
for block in response.content:
  if hasattr(block, "type") and block.type == "tool_use":
    print(f"Action: {block.name} — {block.input}")
מתקדם פרויקט 5: Multi-Agent System

Claude Sonnet 4.6 כ-Orchestrator + Claude Haiku 4.5 כ-Workers לאופטימיזציה של עלות ומהירות.

import anthropic, json

client = anthropic.Anthropic()

def orchestrate(task: str) -> list:
    """Sonnet מחלק למשימות קטנות"""
    resp = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        system="חלק את המשימה ל-3 תת-משימות. החזר JSON בלבד: {\"subtasks\": [...]}",
        messages=[{"role": "user", "content": task}]
    )
    return json.loads(resp.content[0].text)["subtasks"]

def execute_subtask(subtask: str) -> str:
    """Haiku מבצע כל תת-משימה — זול ומהיר"""
    resp = client.messages.create(
        model="claude-haiku-4-5-20251001",
        max_tokens=512,
        messages=[{"role": "user", "content": subtask}]
    )
    return resp.content[0].text

# הרצה
subtasks = orchestrate("כתוב דוח שיווקי על מוצר AI חדש")
results = [execute_subtask(s) for s in subtasks]
print("\n\n".join(results))

גיליון עזר — Claude API

מודלים ו-Model IDs

Model ID שם מתי
claude-sonnet-4-6 Sonnet 4.6 רוב המקרים + Extended Thinking
claude-haiku-4-5-20251001 Haiku 4.5 מהיר וזול
claude-opus-4-6 Opus 4.6 Legacy בלבד

API Endpoints

# Base URL
https://api.anthropic.com/v1/

# Messages (עיקרי)
POST /messages

# Headers נדרשים
x-api-key: sk-ant-...
anthropic-version: 2023-06-01
content-type: application/json

Tool Use Boilerplate — Python

import anthropic

client = anthropic.Anthropic()

def run_tool_loop(user_message: str, tools: list, tool_runner) -> str:
    """לולאת Tool Use אוטומטית"""
    messages = [{"role": "user", "content": user_message}]

    while True:
        response = client.messages.create(
            model="claude-sonnet-4-6",
            max_tokens=4096,
            tools=tools,
            messages=messages
        )

        if response.stop_reason != "tool_use":
            # Claude סיים — מחזיר תשובה סופית
            return response.content[0].text

        # הוסף תגובת Claude להיסטוריה
        messages.append({"role": "assistant", "content": response.content})

        # בצע כל הכלים שביקש
        tool_results = []
        for block in response.content:
            if block.type == "tool_use":
                result = tool_runner(block.name, block.input)
                tool_results.append({
                    "type": "tool_result",
                    "tool_use_id": block.id,
                    "content": str(result)
                })

        messages.append({"role": "user", "content": tool_results})

Prompt Templates מהירים

סיכום מסמך
סכם את המסמך הבא ב-3 נקודות.
כל נקודה: מקסימום 20 מילה.
פורמט: רשימה ממוספרת.

<document>
{{DOCUMENT}}
</document>
חילוץ JSON
חלץ מהטקסט הבא JSON מובנה.
החזר JSON בלבד, ללא הסבר.

Schema:
{name, email, phone, company}

טקסט: {{TEXT}}
Code Review
בצע Code Review. ציין:
- בעיות אבטחה (CRITICAL)
- בעיות ביצועים (MAJOR)
- שיפורי קריאות (MINOR)

```{{LANGUAGE}}
{{CODE}}
```
תרגום + שיפור
תרגם לעברית ושפר את הניסוח.
שמור על טון {{TONE}}.
מקסימום {{MAX_WORDS}} מילים.

טקסט מקורי:
{{TEXT}}
rocket_launch

מוכן להתחיל?

כנס ל-claude.ai ונסה את הממשק חינם, או קבל API key ב-console.anthropic.com ותתחיל לבנות עם הדוגמאות מהמדריך הזה.