סיכום עברי בלתי רשמי של תיעוד Claude Code — התקנה, עקרונות ליבה, ניהול קונטקסט, CLAUDE.md, מצבי הרשאות, workflows יומיומיים, ואסטרטגיות לעבודה יעילה במקביל.
Claude Code הוא סוכן קוד אגנטי שגר בטרמינל שלך, מבין את הקוד־בייס שלך, ועוזר לקודד מהר יותר על־ידי ביצוע משימות שגרתיות, הסבר על קוד מורכב, וטיפול ב-Git workflows — הכול דרך פקודות בשפה טבעית.
בניגוד ל-chatbot שעונה על שאלות ומחכה, Claude Code קורא קבצים, מריץ פקודות, מבצע שינויים, ופותר בעיות באופן אוטונומי בזמן שאתה צופה, מכוון מחדש, או מתרחק לגמרי. במקום לכתוב קוד בעצמך ולבקש מ-Claude לבדוק, אתה מתאר מה אתה רוצה — ו-Claude מבין איך לבנות את זה: חוקר, מתכנן, ומיישם.
כלי השלמת קוד מציעים את השורה או הפונקציה הבאה כשאתה מקליד. Claude Code פועל ברמת הפרויקט: קורא את כל הקוד־בייס, מתכנן גישה על־פני קבצים מרובים, מבצע שינויים, מריץ בדיקות, ומבצע איטרציות על כשלים. אתה מגדיר את היעד וסוקר את התוצאה — במקום לכוון כל צעד.
אם השתמשת בכלי AI אחרים לקוד, הנה איפה Claude Code שונה:
| כלי | הגישה | היכן Claude Code שונה |
|---|---|---|
| GitHub Copilot | השלמה אוטומטית בזמן הקלדה | עובד ברמת המשימה ולא ברמת השורה. מתכנן multi-file, מריץ tests, מתקן את עצמו. |
| Cursor / Windsurf | IDE עם chat ו-RAG על הקוד | הקוד מודגם בפועל, לא מחפש סמנטית. רץ פקודות, בודק UI, מתקן baga in real time. גם עובד ב-CLI ו-CI. |
| Aider | CLI דומה במהותו | הרבה יותר מנגנונים מובנים — Skills, Hooks, MCP, plan mode, auto mode, checkpoints. אינטגרציה native עם VS Code/JetBrains/Web. |
| ChatGPT / Claude.ai | Chat ללא גישה לקוד | אתה לא צריך להעתיק קוד פנימה. Claude קורא, עורך, מריץ — ואתה רק מאשר. |
| Devin / similar agents | סוכן אוטונומי בענן | Claude Code רץ אצלך — אתה רואה כל פעולה, יכול לעצור, יש לך checkpoints. גם רץ ב-CI כשצריך. |
אם אתה משתמש ב-Cursor — Claude Code לא מחליף אותו, הוא משלים. תוסף Claude Code עובד בתוך Cursor, ונותן לך גם את ה-chat וה-completions של Cursor וגם את הסוכנות של Claude Code. הרבה משתמשים מריצים את שניהם.
| פלטפורמה | מתי להשתמש |
|---|---|
| Terminal CLI | הממשק העיקרי. הכי גמיש, הכי חזק, הכי הרבה שליטה. |
| VS Code / Cursor | מתאים לזרימה ויזואלית — diffs בתוך העורך, @-mentions, היסטוריית שיחות. |
| Desktop app | ניהול sessions במקביל, בדיקת diffs ויזואלית, scheduled tasks. |
| Web (claude.ai/code) | משימות ארוכות שרצות בענן, ללא הגדרה מקומית. |
| JetBrains | WebStorm, PyCharm, IntelliJ — תוסף עם תצוגת diffs אינטראקטיבית. |
| GitHub Actions / Slack | אוטומציה: code review, triage של issues, מעבר מבאג ל-PR. |
כל הממשקים מתחברים לאותו מנוע — קבצי CLAUDE.md, settings, ו-MCP servers שלך עובדים בכולם.
ההתקנה לוקחת כדקה. כל ההתקנות הנייטיביות מתעדכנות אוטומטית ברקע — לא צריך לתחזק.
curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The token '&&' is not a valid statement separator — אתה ב-PowerShell ולא ב-CMD. אם 'irm' is not recognized — אתה ב-CMD ולא ב-PowerShell. ה-prompt מציג PS C:\ ב-PowerShell ו-C:\ ב-CMD. מומלץ להתקין Git for Windows כדי ש-Claude יוכל להשתמש ב-Bash; אחרת הוא יחזור ל-PowerShell ככלי shell.
# macOS Homebrew brew install --cask claude-code # Windows WinGet winget install Anthropic.ClaudeCode # Linux: apt, dnf, apk זמינים גם הם
brew upgrade claude-code או winget upgrade Anthropic.ClaudeCode מדי פעם. ההתקנה הנייטיבית (curl/irm) — מתעדכנת לבד.
cd /path/to/your/project claude
בפעם הראשונה תתבקש להתחבר. אפשר להיכנס עם מנוי Claude (Pro / Max / Team / Enterprise), עם חשבון Anthropic Console (API עם קרדיטים מוקדמים), או דרך Bedrock / Vertex AI / Foundry לחברות.
what does this project do? what technologies does this project use? where is the main entry point? explain the folder structure
Claude קורא את הקבצים לפי הצורך — אין צורך להוסיף קונטקסט ידנית. אחרי שהבנת את הקוד, אפשר לעבור לעבודה ממשית: "add a hello world function to the main file" או "there's a bug where users can submit empty forms — fix it".
VS Code הוא הסביבה הויזואלית המומלצת ל-Claude Code אם אתה לא חי בטרמינל. התוסף הרשמי נותן לך diffs מצוירים בתוך העורך, @-mentions עם השלמה אוטומטית, היסטוריית שיחות, ויכולת לפתוח כמה sessions במקביל בתוך טאבים נפרדים. אותו תוסף בדיוק עובד גם ב-Cursor, Windsurf, ו-Kiro.
שלוש דרכים, מהמהירה לאיטית:
vscode:extension/anthropic.claude-code (או cursor:extension/anthropic.claude-code)אם אתה ב-Windsurf או Kiro — אותו דבר, או דרך Open VSX registry.
אם התוסף לא מופיע אחרי התקנה: Developer: Reload Window מה-Command Palette.
אחרי ההתקנה, יש 4 דרכים לפתוח את הפאנל. שים לב לאייקון Spark (✱) — זה המזהה הויזואלי של Claude Code בכל מקום:
בפעם הראשונה תופיע מסך sign-in. לחץ Sign in וסיים את האישור בדפדפן. אם אתה רואה "Not logged in · Please run /login" — התוסף יפתח את מסך ההתחברות אוטומטית. אם לא — Developer: Reload Window.
ANTHROPIC_API_KEY ב-shell אבל עדיין רואה sign-in: VS Code לא בהכרח יורש את משתני הסביבה של ה-shell שלך. הפתרון: פתח את VS Code מטרמינל עם code . כך שיירש משתני סביבה — או פשוט התחבר עם חשבון Claude.
סמן טקסט בעורך — Claude רואה אותו אוטומטית. לחץ Alt+K (Windows/Linux) או Option+K (Mac) כדי להוסיף ל-prompt הפניית @-mention עם שורות (לדוגמה @app.ts#5-10).
כש-Claude רוצה לערוך קובץ — תופיע השוואה מצד-לצד של המקור מול ההצעה. אתה יכול:
טייפ @ ושם חלקי — VS Code מציע התאמות. @auth ימצא auth.js או AuthService.ts. עבור תיקיות, הוסף סלאש: @src/components/.
פיצ'ר חבוי ועוצמתי. במקום להעתיק שגיאות מהטרמינל, הפנה ישירות:
@terminal:bash explain this error @terminal:dev-server why is the server crashing
הפרומפט-בוקס מציג ויזואלית כמה מהקונטקסט אתה צורך. לחץ על / ובחר Usage כדי לראות פרטים מלאים.
טוגל ב-/ מאפשר ל-Claude לחשוב יותר עמוק על בעיות מורכבות. ההיגיון מופיע בשיחה כבלוקים מקופלים. Ctrl+O פותח/סוגר את כל ה-thinking blocks בסשן.
Shift+Enter מוסיף שורה חדשה בלי לשלוח. שימושי לפרומפטים ארוכים.
ב-VS Code, plan mode פותח את התוכנית כמסמך markdown מלא — אתה יכול להוסיף הערות inline לפני ש-Claude מתחיל. זה הרבה יותר טוב מ-CLI.
גרור את הפאנל לאן שמתאים לך:
VS Code זוכר את ההעדפה שלך.
"Open in New Tab" או "Open in New Window" מה-Command Palette פותח שיחה נוספת עם היסטוריה וקונטקסט עצמאיים. נקודה צבעונית קטנה על אייקון Spark של הטאב מציינת:
כפתור Session history בראש פאנל Claude נותן גישה להיסטוריה. חיפוש לפי keyword או דפדוף לפי זמן (היום, אתמול, 7 ימים אחרונים...). שיחות חדשות מקבלות שם אוטומטי לפי ההודעה הראשונה שלך. רחף מעל סשן כדי לערוך שם או למחוק.
אם אתה משתמש גם ב-Claude Code on the Web, טאב Remote מציג סשנים מ-claude.ai — לחיצה מורידה אותם להמשך מקומי.
פתח עם Ctrl+, → Extensions → Claude Code:
| הגדרה | ברירת מחדל | למה זה טוב |
|---|---|---|
useTerminal | false | מעבר למצב CLI במקום ה-panel הגרפי |
initialPermissionMode | default | החלף ל-plan או acceptEdits אם אלה מצבי ברירת המחדל שלך |
preferredLocation | panel | sidebar אם אתה מעדיף לצד הקוד |
autosave | true | שמירה אוטומטית לפני קריאה/כתיבה של Claude |
useCtrlEnterToSend | false | true = Ctrl+Enter לשליחה (Enter מוסיף שורה). מועדף עבור פרומפטים ארוכים |
enableNewConversationShortcut | false | true מאפשר Ctrl+N לסשן חדש |
respectGitIgnore | true | הסתרה של קבצי .gitignore מחיפוש |
usePythonEnvironment | true | הפעלת ה-Python environment של ה-workspace אם יש |
הוסף "$schema": "https://json.schemastore.org/claude-code-settings.json" ל-settings.json כדי לקבל autocomplete ו-validation מובנים ב-VS Code.
טייפ /plugins ב-prompt box כדי לפתוח ממשק גרפי לניהול plugins. שני טאבים:
בעת התקנה — בחר scope:
אחרי שתתקין את תוסף Claude in Chrome (1.0.36+), תוכל לכתוב @browser בפרומפט:
@browser go to localhost:3000 and check the console for errors @browser fill out the registration form and submit @browser take a screenshot of the dashboard and tell me what's broken
זהו הפיצ'ר הקריטי לפיתוח web — נפרט עליו בפרק 9.
אם אתה אוהב את ה-CLI אבל רוצה תצוגת diffs ב-VS Code, פתח את הטרמינל המובנה (Ctrl+`) והרץ claude. ה-CLI מתחבר אוטומטית ל-IDE לתצוגת diff ושיתוף diagnostics. אם אתה משתמש בטרמינל חיצוני, הרץ /ide בתוך Claude כדי לחבר.
| פיצ'ר | CLI | תוסף VS Code |
|---|---|---|
| Commands ו-Skills | הכל | חלקי (טייפ / כדי לראות) |
| הגדרת MCP | כן | חלקי — הוסף ב-CLI, נהל קיימים עם /mcp |
| Checkpoints | כן | כן |
! bash shortcut | כן | לא |
| Tab completion | כן | לא |
היתרון הגדול: ההיסטוריה משותפת. אם התחלת שיחה בתוסף, claude --resume בטרמינל ימשיך אותה — ולהפך.
| פעולה | קיצור |
|---|---|
| מעבר בין עורך ל-Claude | Ctrl+Esc / Cmd+Esc |
| פתיחת שיחה חדשה בטאב | Ctrl+Shift+Esc / Cmd+Shift+Esc |
| שיחה חדשה (אם הופעל) | Ctrl+N / Cmd+N |
| הוסף @-mention של הקובץ הנוכחי | Alt+K / Option+K |
| הרחב/כווץ thinking blocks | Ctrl+O |
| שורה חדשה ב-prompt | Shift+Enter |
Developer: Reload Windowב-macOS Tahoe ומעלה, ה-Game Overlay חוטף את הקיצור הזה. פתרון: System Settings → Keyboard → Keyboard Shortcuts → Game Controllers → ביטול ה-Game Overlay. או הקצה קיצור אחר ב-VS Code Keyboard Shortcuts.
claude מהטרמינל המובנה — אולי תקבל הודעת שגיאה מפורטתהבנה בסיסית של מה קורה בפועל מתחת למכסה משנה לחלוטין את האופן שבו תעבוד עם Claude. אם תבין את ה-loop ואת המגבלות שלו, תפסיק להילחם במערכת ותתחיל לעבוד איתה.
LLM רגיל מקבל טקסט ומחזיר טקסט. סוכן (agent) הוא LLM שיש לו כלים ויכולת לקרוא לכלים, לקרוא את התוצאה, ולחשוב שוב. זה הכל. השאר זה לולאה:
┌─────────────────────────────────────────┐ │ 1. אתה שולח prompt │ │ ↓ │ │ 2. Claude חושב │ │ ↓ │ │ 3. Claude מחליט: לענות או לקרוא לכלי? │ │ ↓ │ │ 4. אם כלי → קריאה (Read/Edit/Bash/...) │ │ ↓ │ │ 5. תוצאת הכלי חוזרת לClaude │ │ ↓ │ │ 6. חוזרים ל-2 — Claude חושב שוב │ │ ↓ │ │ ... עד שClaude מחליט שסיים │ │ ↓ │ │ 7. תשובה אליך │ └─────────────────────────────────────────┘
כל איטרציה של 2-6 נקראת turn. משימה אחת שלך עשויה לדרוש 5-50 turns. במצב headless אפשר להגביל מספר turns דרך --max-turns 10 (בעיקר ל-CI ולמשימות אוטונומיות).
איך זה נראה turn-by-turn:
| Turn | מה Claude עושה | tokens שנצרכים |
|---|---|---|
| 1 | קורא את הקובץ: Read auth.ts | ~600 (תוכן הקובץ) |
| 2 | מריץ Bash: npm run typecheck | ~200 (פלט השגיאה) |
| 3 | חושב: "השגיאה ב-line 42 — type 'undefined' לא תואם" | ~50 |
| 4 | קורא קובץ קשור: Read types/user.ts כדי להבין את ה-type | ~300 |
| 5 | Edit auth.ts — מוסיף null check | ~150 |
| 6 | Bash: npm run typecheck — מאמת שהשגיאה נעלמה | ~100 |
| 7 | "תוקן. הוספתי null check בשורה 42." | ~30 |
זה ~1,430 tokens לתיקון פשוט. למשימה מורכבת — הכפל ב-10. למשימה ענקית — ב-50. מכאן החשיבות העצומה של ניהול קונטקסט (פרק 5).
| כלי | תפקיד | מה ה-token cost? |
|---|---|---|
Read | קריאת קובץ | גודל הקובץ (יכול להיות גדול) |
Edit | עריכה ממוקדת — replace string | קטן (רק ההבדל) |
Write | יצירת קובץ חדש או החלפה מלאה | גודל התוכן |
Bash | הרצת פקודות shell | גודל הפלט (זהירות עם find /) |
Grep | חיפוש regex בקבצים | קטן יחסית (תוצאות ספציפיות) |
Glob | מציאת קבצים לפי pattern | קטן (רק רשימת נתיבים) |
WebFetch | שליפת URL | גודל הדף |
WebSearch | חיפוש בגוגל | בינוני (תוצאות + snippets) |
Task | האצלה ל-subagent | גדול ב-subagent, קטן בקונטקסט הראשי שלך |
Grep ו-Glob על פני Read של כל הקבצים — זה זול יותר. אם אתה רואה שClaude קורא 20 קבצים ברצף, זה הסימן להפנות אותו ל-subagent עם "use a subagent to investigate ...".
| גישה | איך מגיעים לקוד | מתי זה נכשל |
|---|---|---|
| chat רגיל (ChatGPT) | אתה מעתיק קוד פנימה | קוד גדול, צריך הרבה קבצים, אין הקשר |
| RAG (Cursor chat) | חיפוש סמנטי בקוד-בייס בעת ה-prompt | הקוד שצריך לא דומה סמנטית לשאלה |
| Agentic (Claude Code) | Claude קורא, מריץ פקודות, ובוחר בעצמו מה לקרוא | קונטקסט מתמלא, או שClaude לא יודע לאן לחפש |
היתרון של agentic: Claude יכול להריץ את הקוד ולראות מה קורה — לבדוק tests, להריץ build, לבדוק UI. זה מה שהופך את התוצאה מ-"קוד שנראה סביר" ל-"קוד שעובד".
Claude יוצר checkpoint לפני כל שינוי בקובץ. זה אומר שאתה יכול לתת לClaude לנסות גישה מסוכנת ואם זה לא עבד — לחזור אחורה ב-Esc Esc או ב-/rewind. ה-checkpoints נמשכים גם בין סשנים. הם לא תחליף ל-git, אבל הם משלימים אותו: git שומר על הגרסאות שלך, checkpoints שומרים על ההיסטוריה של מה שClaude עשה.
רוב ה-best practices נובעים ממגבלה אחת: חלון הקונטקסט מתמלא מהר, וביצועים יורדים ככל שהוא מתמלא.
חלון הקונטקסט מחזיק את כל השיחה — כל הודעה, כל קובץ ש-Claude קרא, וכל פלט פקודה. סשן debugging אחד או חקירת קוד־בייס יכולים בקלות לצרוך עשרות אלפי tokens. כש-LLM מתקרב למגבלה, הביצועים יורדים: Claude מתחיל "לשכוח" הוראות מוקדמות יותר ועושה יותר טעויות.
ניהול הקונטקסט הוא הכישור החשוב ביותר. זה מה שמבדיל בין משתמש שמתסכל לבין משתמש שיוצר תוצאות.
Claude Sonnet 4.6 ו-Opus 4.6 — חלון של 200,000 tokens. נשמע הרבה, נכון? בוא נראה לאן זה הולך:
| מקור | tokens טיפוסי | % מהקונטקסט |
|---|---|---|
| System prompt של Claude Code | ~3,000 | 1.5% |
| CLAUDE.md (אם קצר ומסודר) | ~1,500 | 0.75% |
| Auto memory (200 שורות ראשונות) | ~3,000 | 1.5% |
| הגדרות MCP servers (10 שרתים) | ~5,000 | 2.5% |
| Skills available (10 skills) | ~2,000 | 1% |
| קריאת קובץ בינוני (300 שורות) | ~3,500 | 1.75% |
| /init מלא של פרויקט | ~10,000-20,000 | 5-10% |
| סשן debugging של 30 דקות | ~50,000 | 25% |
סשן ארוך עם הרבה קריאות קבצים יכול להגיע ל-150K במהירות. סביב 70-80% התחלה לראות ירידה בביצועים — Claude שוכח הוראות, חוזר לטעויות שכבר תיקנת, או מתחיל לעשות דברים שלא ביקשת.
הפקודה הכי שימושית לבדיקת מצב. מציגה:
ב-VS Code, הפרומפט-בוקס מציג ויזואלית כמה context אתה צורך. ב-CLI אפשר להגדיר custom status line שיציג זאת תמיד. אם אתה רואה את האחוז עולה בצורה דרמטית — זה הזמן להתערב.
אם סיימת משימה אחת ואתה עובר לאחרת — תמיד /clear. סשן ארוך עם תוכן לא-רלוונטי גורם ל-Claude להתבלבל. עדיף להתחיל סשן נקי עם prompt טוב יותר מאשר להמשיך סשן ארוך עם תיקונים מצטברים.
כשהקונטקסט מתקרב למגבלה, Claude מבצע compaction אוטומטית. מה זה עושה בפועל: Claude מסכם את כל מה שעבדתם עליו עד עכשיו לפסקה צפופה (קוד שעבר edit, החלטות שהתקבלו, קבצים מרכזיים), ואז מוחק את ההיסטוריה המפורטת. זה משחרר 60-80% מהקונטקסט. עלות: פרטים קטנים אובדים.
אפשר לשלוט: /compact Focus on the API changes — Claude יכלול את כל מה שקשור ל-API ויוותר על השאר. שימושי כשאתה יודע מה החשוב.
גם בלי /compact ידני, Claude מבצע auto-compaction סביב 95%. פרויקט root CLAUDE.md שורד את ה-compaction ונטען מחדש; CLAUDE.md מקונן בתת-תיקיות לא, עד שClaude קורא קובץ באותה תיקייה שוב.
הכלי החזק ביותר לשמירה על קונטקסט נקי. אם אתה צריך לחקור משהו במורכב בקוד-בייס:
use subagents to investigate how our authentication system handles token refresh, and whether we have any existing OAuth utilities I should reuse.
ה-subagent חוקר ב-context window נפרד ומחזיר רק את הסיכום (אולי 500 tokens) — בלי לזהם את הקונטקסט הראשי שלך עם 20 קריאות קבצים.
שאלת תקציב מהירה שלא צריכה להיכנס להיסטוריה? /btw מציג תשובה ב-overlay נפרד שלא נכנס לשיחה. שימושי כשאתה עובד על משימה גדולה ופתאום צריך לבדוק "what's the syntax for X?".
כל פעולה של Claude יוצרת checkpoint. Esc Esc או /rewind פותחים תפריט שחזור — אפשר לשחזר רק שיחה, רק קוד, או שניהם. זה אומר שאתה יכול לבקש מ-Claude לנסות משהו מסוכן ואם זה לא עובד — לחזור אחורה.
CLAUDE.md הוא קובץ markdown שמתווסף לשורש הפרויקט ונקרא אוטומטית בתחילת כל שיחה. זה המקום ל-coding standards, החלטות ארכיטקטורה, ספריות מועדפות, ו-checklists. בלעדיו אתה חוזר על אותן הוראות בכל סשן.
הרץ /init בפרויקט — Claude ינתח את הקוד ויצור CLAUDE.md מותאם עם פקודות build, מסגרות בדיקה, ו-conventions שזיהה. זה המסד; ממנו תזקק במשך הזמן.
# Code style
- Use ES modules (import/export) syntax, not CommonJS (require)
- Destructure imports when possible (eg. import { foo } from 'bar')
# Workflow
- Be sure to typecheck when you're done making a series of code changes
- Prefer running single tests, and not the whole test suite, for performance
לכל שורה, שאל: "האם הסרת השורה הזו תגרום ל-Claude לטעות?" אם לא — מחק. קבצי CLAUDE.md מנופחים גורמים ל-Claude להתעלם מההוראות שלך — חוקים חשובים נאבדים בתוך הרעש.
אם Claude ממשיך לעשות משהו שלא רצית למרות שיש כלל נגד זה — ה-CLAUDE.md כנראה ארוך מדי. תקצר.
| מיקום | טווח | שימוש |
|---|---|---|
./CLAUDE.md | פרויקט (משותף) | commit ל-git, נקרא ע"י כל הצוות |
./CLAUDE.local.md | אישי לפרויקט | .gitignore — לא משותף |
~/.claude/CLAUDE.md | מכל הפרויקטים | העדפות אישיות גלובליות |
parent/CLAUDE.md | תיקייה הורית | useful ל-monorepos |
See @README.md for project overview and @package.json for available npm commands.
# Additional Instructions
- Git workflow: @docs/git-instructions.md
- Personal overrides: @~/.claude/my-project-instructions.md
Claude Code v2.1.59 ומעלה כולל מערכת זיכרון אוטומטית. Claude כותב לעצמו הערות תוך כדי עבודה: פקודות build, תובנות debugging, החלטות ארכיטקטורה — בלי שאתה תכתוב כלום.
הקבצים נשמרים ב-~/.claude/projects/<project>/memory/. ה-200 שורות הראשונות (או 25KB) של MEMORY.md נטענות בכל שיחה. את השאר Claude קורא לפי דרישה.
לבדוק / לערוך — /memory בתוך סשן.
לפרויקטים גדולים, פצל את ההוראות לקבצים נפרדים. אפשר גם לקבוע שחוק יטען רק כש-Claude עובד עם קבצים מסוימים:
---
paths:
- "src/api/**/*.ts"
---
# API Development Rules
- All API endpoints must include input validation
- Use the standard error response format
- Include OpenAPI documentation comments
הרבה פרויקטים כבר מגדירים AGENTS.md ל-Cursor, Aider, או כלים אחרים. Claude Code לא קורא AGENTS.md ישירות — אבל קל לחבר:
@AGENTS.md
## Claude-specific
Use plan mode for changes under `src/billing/`.
Prefer pnpm test:unit over the full suite for performance.
זה טוען את ה-AGENTS.md שלך ומוסיף הנחיות ספציפיות ל-Claude. אם אין לך תוספות — אפשר symlink:
ln -s AGENTS.md CLAUDE.md
(ב-Windows symlinks דורשים הרשאות admin או Developer Mode — עדיף להשתמש ב-@AGENTS.md.)
טיפ נוסף: /init בפרויקט שכבר יש בו AGENTS.md (או .cursorrules, .windsurfrules) קורא אותו אוטומטית ומשלב את החלקים הרלוונטיים ב-CLAUDE.md החדש.
ארגונים יכולים לפרוס CLAUDE.md ברמת המכונה שמשפיע על כל המשתמשים — לא ניתן לעקוף:
/Library/Application Support/ClaudeCode/CLAUDE.md/etc/claude-code/CLAUDE.mdC:\Program Files\ClaudeCode\CLAUDE.mdשימושי ל-coding standards של החברה, חוקי security, או הוראות compliance שחייבות לחול. נפרס דרך MDM, Group Policy, או Ansible.
בלי ה-feedback loop הזה, ה-CLAUDE.md שלך יישאר חלש. אלה הטריגרים שאומרים "תוסף":
CLAUDE.md הוא מקום ל-"דברים שClaude לא יכול להסיק מקריאת הקוד". אם הוא יכול — מחק את השורה.
ברירת המחדל היא ש-Claude מבקש רשות לכל פעולה שמשנה את המערכת — כתיבת קובץ, פקודת Bash, קריאה ל-MCP. זה בטוח אבל מתיש. Shift+Tab מחליף בין מצבים.
| מצב | מה Claude יכול לעשות בלי לשאול | מתי |
|---|---|---|
default | קריאת קבצים | התחלה, עבודה רגישה |
acceptEdits | קריאה ועריכה של קבצים | עבודה איטרטיבית שאתה סוקר |
plan | קריאה בלבד — מציע תוכנית | חקירה, תכנון refactor |
auto | הכל, עם classifier ברקע | משימות ארוכות |
bypassPermissions | הכל, ללא בדיקות | containers / VMs מבודדים בלבד |
dontAsk | רק כלים מאושרים מראש | סביבות נעולות, CI |
אולי המצב החשוב ביותר לעבודה רצינית. Claude קורא קבצים, חוקר, ומציע תוכנית — בלי לערוך כלום. אתה סוקר את התוכנית, מתקן אם צריך, ואז מאשר.
claude --permission-mode plan
או באמצע סשן: Shift+Tab כדי להיכנס. Ctrl+G פותח את התוכנית בעורך הטקסט שלך לעריכה ישירה.
זמין ל-Team / Enterprise / API plans, דורש Sonnet 4.6 או Opus 4.6. במקום להפסיק אותך עם prompts, מודל classifier נפרד בודק כל פעולה לפני ביצוע — חוסם הסלמת היקף, תשתית לא-מוכרת, ופעולות שנראות מונעות מ-prompt injection.
חוסם כברירת מחדל: הורדת והרצת קוד (curl | bash), שליחת מידע רגיש לשרתים חיצוניים, deploys ל-production, מחיקה המונית, force push, push ישיר ל-main.
מאפשר כברירת מחדל: פעולות מקומיות בתיקיית העבודה, התקנת dependencies שכבר ב-lock file, בקשות HTTP read-only, push לבראנץ' שאתה התחלת.
בידוד ברמת מערכת ההפעלה — מגביל גישה ל-filesystem ולרשת ומאפשר ל-Claude לעבוד יותר בחופשיות בתוך גבולות מוגדרים. כך אפשר להפעיל Claude עם auto mode בלי דאגה שיגיע למקומות לא רצויים. זמין דרך /sandbox.
השיטה היומיומית לצמצם interruptions: הוסף פקודות בטוחות שאתה מכיר ל-allowlist. /permissions בתוך session פותח ממשק אינטראקטיבי, או שאתה עורך ידנית את .claude/settings.json.
allow — מבוצע ללא שאלהask — שואל למרות שיש allow אחר (ל-override במקרים רגישים)deny — חוסם מוחלט. עוקף allow.{
"permissions": {
"allow": [
"Bash(pnpm install)",
"Bash(pnpm dev)",
"Bash(pnpm build)",
"Bash(pnpm test:*)",
"Bash(pnpm lint)",
"Bash(pnpm typecheck)",
"Bash(git status)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push)",
"Bash(npx drizzle-kit:*)",
"WebFetch(domain:localhost)",
"WebFetch(domain:docs.claude.com)"
],
"ask": [
"Bash(rm:*)",
"Bash(git push --force:*)"
],
"deny": [
"Bash(rm -rf /)",
"Read(./.env.production)",
"Read(./.env.local)",
"Write(./db/migrations/*)"
]
}
}
הסינטקס מאפשר רמות שונות של גמישות:
| Pattern | תופס |
|---|---|
Bash(git commit) | בדיוק git commit ללא ארגומנטים |
Bash(git commit *) | git commit -m "..." וכל וריאציה |
Bash(git:*) | כל פקודות git ללא יוצא מן הכלל (זהירות!) |
Bash(pnpm test:*) | pnpm test, pnpm test:unit, pnpm test:e2e וכו' |
Read(./src/**) | קריאת כל קובץ תחת src/ |
WebFetch(domain:localhost) | כל URL ב-localhost |
deny תמיד עוקף allow. זה אומר שאתה יכול להגדיר Bash(git:*) ב-allow ועדיין לחסום Bash(git push --force:*) ב-deny — וזה יעבוד.
Bash(git:*) נראה נוח, אבל הוא מאפשר גם git push --force-with-lease, git reset --hard, git clean -fdx. לפרויקט production עדיף להגדיר רק את הפקודות הספציפיות שאתה משתמש בהן.
כל פעם ש-Claude שואל הרשאה לפקודה שאתה תמיד מאשר, הוסף ל-allow. אחרי שבועיים יהיה לך allowlist מותאם בדיוק לזרימת העבודה שלך.
הזרימה האידיאלית לרוב המשתמשים:
acceptEdits (אתה סומך על Claude לערוך, אבל סוקר commands)Claude קורא קבצים ועונה לשאלות בלי לבצע שינויים.
read /src/auth and understand how we handle sessions and login. also look at how we manage environment variables for secrets.
I want to add Google OAuth. What files need to change? What's the session flow? Create a plan.
Ctrl+G לפתיחת התוכנית בעורך לעריכה ישירה.
implement the OAuth flow from your plan. write tests for the callback handler, run the test suite and fix any failures.
commit with a descriptive message and open a PR
give me an overview of this codebase explain the main architecture patterns used here what are the key data models? how is authentication handled? trace the login process from front-end to database
I'm seeing an error when I run npm test [paste full error and stack trace] Find the root cause, write a failing test that reproduces it, then fix it.
find functions in NotificationsService.ts that are not covered by tests add tests for the notification service following our existing patterns add test cases for edge conditions run the new tests and fix any failures
Refactoring טוב הוא איטרטיבי, לא mass change. הזרימה:
# שלב 1: מצא מטרות find deprecated API usage in our codebase. group by category. # שלב 2: למד את הגישה look at how we handle errors in the newer routes (@src/api/v2/). why is that pattern better than the old try/catch in @src/api/v1/? # שלב 3: refactor incrementally — קובץ אחד, עם tests refactor @src/api/v1/users.ts to use the v2 error pattern. keep the public API identical (no behavioral changes). run the existing tests after — they must all still pass. # שלב 4: אם הצליח, חזור על אותו דפוס now do the same for @src/api/v1/products.ts. follow the exact same approach.
זרימה זו מונעת את "הfix-everything-at-once" שהוא דרך ודאית לשבור את הקוד.
# מצא חוסרים find functions without proper JSDoc comments in @src/api/handlers/ # צור תיעוד שמתאים לסטנדרט שלך add JSDoc comments to the undocumented functions. match the style of the existing documented functions in this folder. include @param, @returns, @throws, and a one-line summary. # שפר את התיעוד עם דוגמאות for the public API functions, add a short @example block showing typical usage. # ודא שהתיעוד עוקב אחר הסטנדרט שלכם check that all docs include the security considerations section where it applies (authentication, input validation).
summarize the changes I've made to the authentication module create a pr enhance the PR description with more context about the security improvements
אחרי gh pr create, ה-session מקושר אוטומטית ל-PR. כדי לחזור: claude --from-pr 1234 או הדבק את כתובת ה-PR ב-/resume.
גרור תמונה לחלון, או הדבק עם Ctrl+V (לא Cmd+V!). שימושי במיוחד עבור:
explain the logic in @src/utils/auth.js what's the structure of @src/components? show me the data from @github:repos/owner/repo/issues
# המשך השיחה האחרונה בתיקייה claude --continue claude -c # בחר שיחה מרשימה claude --resume claude -r # name session לזיהוי קל יותר /rename oauth-migration
פיתוח web עם Claude Code שונה מפיתוח backend בכך שיש לך לולאת משוב ויזואלית — מה שאתה רואה בדפדפן הוא האמת. הפרק הזה מראה איך לנצל את זה: מבניית רכיב לפי mockup, דרך debugging חי בדפדפן, ועד אוטומציה מלאה של בדיקות UI.
Claude Code לא רואה את הדפדפן שלך כברירת מחדל. יש שלוש דרכים לחבר אותו:
| שיטה | מה זה | מתי לשימוש |
|---|---|---|
| הדבקת screenshot | Ctrl+V או drag & drop | שינוי חד-פעמי לפי mockup |
| Chrome extension | --chrome או @browser | פיתוח רציף — Claude רואה את הקונסול, את ה-DOM, ויכול ללחוץ ולמלא טפסים |
| Claude in Chrome | תוסף נפרד | לעבודה בדפדפן עצמאית, גם בלי VS Code |
זה הכלי שהופך את Claude מ-"כותב קוד עיוור" ל-"מפתח שבודק את עצמו". הוא:
claude --versionclaude --chrome, או באמצע סשן: /chrome/chrome → "Enabled by default"גרור צילום מסך / mockup מ-Figma לתוך הפרומפט. סמן את הקובץ הקיים אם יש בסיס.
[paste screenshot] implement this design as a React component. follow the patterns in @src/components/ui/Card.tsx for styling. use Tailwind only — no new CSS files. the data shape is in @types/dashboard.ts
@browser open localhost:3000/dashboard take a screenshot, compare it to the mockup I gave you, list every visual difference, and fix them one by one
@browser resize the viewport to 375px wide, take a screenshot, check if the layout breaks, and fix any issues
במקום להעתיק ידנית stack traces, תן ל-Claude לראות את הקונסול ישירות:
@browser open localhost:3000 and check the console for errors when the page loads. filter for hydration errors specifically. trace the source in the code and fix it.
שים לב — תגיד ל-Claude מה לחפש, לא "show me all console output". לוגים יכולים להיות מאוד מילוליים.
@browser open localhost:3000/checkout, fill the form with test data, click Submit, and watch the network tab. tell me what request goes out and what response comes back. then check if the UI updates correctly.
במקום לכתוב E2E tests, תן לClaude לעבור על user flow:
@browser test the registration flow: 1. go to /signup 2. try submitting with empty fields - verify error messages appear 3. try invalid email - verify validation 4. try mismatched passwords - verify error 5. submit valid data - verify redirect to /dashboard report any issues
אם אתה בונה אפליקציה בעברית, כך נראה CLAUDE.md אופייני:
# Project: SaaS dashboard, Hebrew-first
## Stack
- Next.js 15 (App Router), React 19
- Tailwind CSS 4, shadcn/ui components
- Supabase Auth + Postgres
- Drizzle ORM
## UI conventions
- Hebrew-first, RTL primary direction (`dir="rtl"` on html)
- ALL components must support RTL via CSS logical properties
- Use `ps-` (padding-inline-start), not `pl-` (padding-left)
- Use `me-` (margin-inline-end), not `mr-` (margin-right)
- Numbers and dates: Intl API with locale `he-IL`
- Variable names, function names, file names: English
- User-facing strings: Hebrew, in i18n files only (no inline strings)
## Components
- Server Components by default (App Router)
- Add 'use client' only when needed: state, effects, browser APIs
- Reuse from @src/components/ui — don't create new primitives
- New components match existing patterns (look at @src/components/Card.tsx)
## Forms
- react-hook-form + zod for all forms
- Server actions for submission, not API routes
- Loading states via useFormStatus
## Build commands
- `pnpm dev` — start dev server
- `pnpm build` — production build (run before commits to catch errors)
- `pnpm lint` — eslint, run before commits
- `pnpm typecheck` — TypeScript check
I'm getting "Text content does not match server-rendered HTML" on /dashboard. @browser open the page, copy the full error from the console. trace which component is causing it, identify why server and client diverge, and fix it. typical causes: Date.now(), Math.random(), client-only state in server component.
the cart updates inconsistently. use a subagent to investigate: 1. how state flows from CartProvider to CartButton 2. where mutations happen 3. is there race condition between optimistic updates and server response? report findings, then propose a fix before implementing.
@browser open localhost:3000/products and measure load time. check the network tab — list the 5 slowest requests. check for: unnecessary re-renders, large bundle, missing image optimization, N+1 queries. propose fixes ordered by impact.
[paste screenshot of broken layout] the Sidebar overflows on mobile. @browser open localhost:3000 in 375px width, inspect the .sidebar element, tell me what's causing the overflow, and fix it without breaking desktop.
/permissions → הוסף WebFetch(domain:localhost) כדי שClaude לא יבקש רשות בכל פעםהפרק הזה מראה איך לבנות פיצ'ר שלם — DB, API, UI, tests — בסטאק מודרני (Next.js 15 + Drizzle + Supabase). הדוגמה: הוספת מערכת תגיות (tags) לפוסטים ב-PostForYou-style app. הזרימה זהה לכל סטאק.
מתחילים בונים פיצ'רים ב-"מהקוד החוצה" — מתחילים מהקומפוננט בדף ומקווים שזה יתחבר ל-DB. זרימה הפוכה עובדת טוב יותר עם Claude:
כל שלב נשען על הקודם, ו-Claude יכול לוודא את עצמו לאורך הדרך.
Shift+Tab עד שתגיע ל-plan mode. אז:
I want to add tags to posts. Each post can have multiple tags. Tags should be reusable across posts. Users can filter posts by tag. Read @src/db/schema/posts.ts and @src/db/schema/users.ts to understand the existing patterns. Then propose a plan that covers: - DB schema changes (tables, relations) - Migration approach - Drizzle queries needed - Server actions for CRUD - UI components: tag input on post edit, tag filter on listing - minimal tests Don't write any code yet. Just the plan.
סקור את התוכנית, תקן אם צריך (Ctrl+G פותח את התוכנית בעורך), ואז צא מ-plan mode והתחל ליישם.
following the plan, implement step 1 only: the DB schema changes. requirements: - new `tags` table: id, name, slug, created_at - new `post_tags` join table: post_id, tag_id (composite primary key) - relations defined in @src/db/schema/index.ts - match the style of existing tables (camelCase columns in code, snake_case in DB) after writing the schema, generate a Drizzle migration: `pnpm drizzle-kit generate` show me the generated SQL before we apply it.
Claude יכתוב את ה-schema, יריץ את הפקודה, ויציג את ה-SQL. אם זה נראה תקין — אשר את ה-migration.
step 2: queries. create @src/db/queries/tags.ts with: - getAllTags(): returns all tags ordered by name - getTagsForPost(postId): returns tags attached to a post - attachTagsToPost(postId, tagIds): replaces all tags for a post - getPostsByTag(tagSlug): returns posts with a given tag, paginated use Drizzle's prepared statements where it makes sense. match the patterns in @src/db/queries/posts.ts. add JSDoc comments on each function.
step 3: server actions.
create @src/app/posts/[id]/_actions.ts.
add a `updatePostTags` server action:
- accepts postId and array of tag names (existing or new)
- uses zod to validate input
- creates new tags as needed (upsert by slug)
- updates the join table
- revalidates the relevant paths
- returns { ok: true } or { ok: false, error: string }
include the auth check — only the post owner can update tags.
follow the pattern in @src/app/posts/[id]/_actions.ts existing actions.
step 4: UI. build a TagInput component at @src/components/posts/TagInput.tsx: - input with autocomplete from existing tags - chips for selected tags - add tag with Enter, remove with X - Hebrew RTL — use ps-/me- not pl-/mr- - match the styling of @src/components/ui/Input.tsx then integrate it into the post edit form at @src/app/posts/[id]/edit/page.tsx. on submit, call the updatePostTags server action. show toast on success/error using @src/components/ui/Toast.
@browser open localhost:3000/posts/1/edit (login as the post owner). test: 1. add a new tag "marketing" - verify it gets created 2. add an existing tag - verify autocomplete works 3. remove a tag - verify it disappears 4. submit - verify the toast shows 5. reload - verify the tags persisted if anything breaks, check the console, identify the cause, and fix.
step 6: tests. write minimal tests: - @src/db/queries/tags.test.ts: test the four query functions with a test database. use the patterns in posts.test.ts - @src/app/posts/[id]/_actions.test.ts: test updatePostTags including the auth case (non-owner gets rejected) run them: `pnpm test tags`. fix any failures.
commit these changes. the message should describe the feature in present tense, list the main files added/changed, and reference any patterns followed.
במקום לבקש "build me a tag system" שיגרום ל-Claude לקרוא 50 קבצים ולמלא את הקונטקסט בכל פיסת מידע — אנחנו:
אם הפיצ'ר הוא רק backend (cron job, webhook handler, queue processor), הזרימה דומה אבל בלי שלבים 4-5:
Bug אינו פיצ'ר — לא מתחילים מ-schema, מתחילים מהסימפטום:
הזרימה הזו (failing test → fix → green) היא קלאסית, אבל עם Claude היא יעילה במיוחד כי הוא יכול גם לכתוב את הטסט וגם לתקן.
הדיוק של ההוראות שלך משפיע ישירות על איכות התוצאה. Claude יכול להסיק כוונה, אבל הוא לא קורא מחשבות.
"add tests for foo.py"
"write a test for foo.py covering the edge case where the user is logged out. avoid mocks."
"why does ExecutionFactory have such a weird api?"
"look through ExecutionFactory's git history and summarize how its api came to be"
"add a calendar widget"
"look at how existing widgets are implemented on the home page. HotDogWidget.php is a good example. follow the pattern to implement a new calendar widget that lets the user select a month and paginate forwards/backwards. build from scratch without libraries other than the ones already used."
"fix the login bug"
"users report that login fails after session timeout. check the auth flow in src/auth/, especially token refresh. write a failing test that reproduces the issue, then fix it"
לפיצ'רים גדולים, התחל בתיאור מינימלי ובקש מ-Claude לראיין אותך:
I want to build [brief description]. Interview me in detail using the AskUserQuestion tool. Ask about technical implementation, UI/UX, edge cases, concerns, and tradeoffs. Don't ask obvious questions, dig into the hard parts I might not have considered. Keep interviewing until we've covered everything, then write a complete spec to SPEC.md.
כשה-spec מוכן, התחל סשן חדש להרצת ה-implementation. הסשן החדש מקבל קונטקסט נקי שמתמקד רק בהרצה — ויש לך spec כתוב להפנות אליו.
הרבה משתמשים מקלידים את כל ההקשר. יש דרכים יעילות יותר:
explain the auth flow in @src/auth/login.ts compare @src/api/v1/users.ts with @src/api/v2/users.ts review the changes in @ (כל הפרויקט)
Ctrl+V (או drag-and-drop) — Screenshots של errors, mockups, diagrams. Claude מנתח תמונות native:
[paste error screenshot] trace this in our code and fix it [paste Figma mockup] implement this design as a React component matching @src/components/ui patterns
# headless — תוצאה חד-פעמית cat error.log | claude -p "summarize the errors and group by frequency" # git diff לסקירה git diff main | claude -p "review for bugs and security issues" # tail ל-monitoring חי tail -f app.log | claude -p "alert me on any 500 errors"
במקום להעתיק שגיאות, השתמש ב-@terminal:name כדי שClaude יראה את הפלט ישירות:
@terminal:dev-server why does the build keep failing?
רוב הזמן רוצים ספציפיות. אבל יש מצבים שבהם prompt רחב מועיל:
הכלל: תהיה ספציפי כשאתה יודע מה אתה רוצה. תהיה עמום כשאתה רוצה לגלות.
/rewind — תפריט שחזור לנקודות קודמות./clear — איפוס מלא של הקונטקסט.הכלל: אם תיקנת את Claude יותר מפעמיים על אותו דבר — הקונטקסט מזוהם. /clear והתחל מחדש עם prompt טוב יותר שכולל את מה שלמדת. סשן נקי עם prompt טוב כמעט תמיד מנצח סשן ארוך עם תיקונים.
זה הדבר היחיד הכי חזק שאתה יכול לעשות.
Claude מבצע הרבה יותר טוב כשהוא יכול לאמת את העבודה שלו — להריץ בדיקות, להשוות screenshots, ולוודא פלטים. בלי קריטריוני הצלחה ברורים, הוא עלול להפיק משהו שנראה נכון אבל לא עובד. ואז אתה הופך להיות לולאת המשוב היחידה — וכל טעות דורשת את תשומת לבך.
"implement a function that validates email addresses"
"write a validateEmail function. example test cases: user@example.com is true, invalid is false, user@.com is false. run the tests after implementing"
"make the dashboard look better"
"[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them"
"the build is failing"
"the build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don't suppress the error"
תוסף הדפדפן Claude in Chrome פותח טאבים, בודק את ה-UI, ומבצע איטרציות עד שהקוד עובד. לחלופין: test suite, linter, או פקודת Bash שבודקת פלט. השקיע בכך שה-verification שלך יהיה חזק.
במקום לבדוק את עצמך אחרי כל שינוי, תן ל-Claude להריץ ולתקן את עצמו עד שעובר. זה הופך אותו מ"כותב קוד" ל"פותר בעיה":
implement the rate limiter for our API. then enter this loop: 1. run `pnpm test rate-limiter` 2. if any test fails, read the failure, fix the code, go to step 1 3. if all pass, run `pnpm typecheck` 4. if typecheck fails, fix and go to step 1 5. if all green, stop and summarize what you did stop conditions: - all checks green (success) - you've made the same fix attempt twice (regression — abort and ask me) - 10 iterations maximum
למה זה עובד: Claude מקבל קריטריוני סיום ברורים ויודע מתי להפסיק. הקוד עוזב את המחשב שלך רק אחרי שעבר את כל הבדיקות.
exit criteria טוב מורכב משלושה חלקים:
migrate the user routes from Express to Hono. success: - all existing tests in tests/routes/users.* pass - `pnpm build` succeeds - no TypeScript errors failure (abort and report): - more than 5 iterations of fix attempts - same error appears 2 times in a row - any tests outside the routes/ folder break report: - list of files changed - any tests that needed to be updated - any new dependencies added - anything that surprised you or required judgment
בלי הגנה, Claude יכול להיתקע ב-loop של "fix → test fails → fix differently → test fails →...". שתי הגנות:
--max-turns ב-headless mode — מספר מקסימלי של פעולות, Claude מסיים אם הגיעלמשימות אינטראקטיביות (לא headless), אתה תראה אם Claude מסתבך ותעצור עם Esc. למשימות אוטונומיות זה קריטי.
| סוג | חוזק | מתי |
|---|---|---|
| "בדוק שזה נראה הגיוני" | חלש | exploration, refactor קוסמטי |
typecheck | בינוני | TypeScript / Python typed |
lint | בינוני | סגנון, איכות בסיסית |
unit tests קיימים | חזק | שינוי ב-business logic |
| unit tests חדשים שClaude כותב | חזק מאוד | פיצ'ר חדש |
@browser verification | חזק מאוד | UI changes |
| integration / E2E tests | הכי חזק | פיצ'רים קריטיים, payment flows |
תמיד תבחר את הרמה הגבוהה ביותר שזמינה לך. אם אין tests לדבר שאתה משנה — בקש מClaude לכתוב אחד לפני התיקון.
מעבר ל-CLAUDE.md ו-Skills, יש מנגנונים נוספים להתאמת Claude Code: Hooks שמריצים סקריפטים בנקודות בזרימת העבודה, ו-Subagents שמאפשרים האצלת עבודה לסוכנים מתמחים בקונטקסט נפרד. MCP — חיבור לכלים חיצוניים — מקבל פרק נפרד (פרק 14) בגלל החשיבות והעומק שלו.
Hooks מריצים סקריפטים אוטומטית בנקודות בזרימת העבודה של Claude. בניגוד להוראות ב-CLAUDE.md שהן בגדר עצה, hooks הם דטרמיניסטיים ומבטיחים שהפעולה תקרה. דוגמאות שימוש:
PreToolUse — לפני כל קריאה לכלי. יכול לחסום או לאשר.PostToolUse — אחרי קריאה לכלי. שימושי לעיצוב/lint אחרי edit.UserPromptSubmit — כשהמשתמש שולח promptSessionStart · SessionEnd — בתחילה/סוף סשןInstructionsLoaded — אחרי טעינת CLAUDE.md ו-rulesבכל פעם ש-Claude עורך קובץ JS/TS, מריצים prettier. matcher מסנן את ה-hook לכלי ספציפי.
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "npx prettier --write \"$CLAUDE_TOOL_FILE_PATH\"",
"run_if": "$CLAUDE_TOOL_FILE_PATH =~ \\.(js|ts|tsx|jsx)$"
}
]
}
]
}
}
PreToolUse יכול לחסום פעולה ע"י החזרת exit code לא-אפס. כך מונעים מClaude לכתוב קבצים ב-db/migrations/ בטעות:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_FILE_PATH\" | grep -q 'db/migrations/'; then echo 'BLOCKED: migrations dir is read-only' >&2; exit 1; fi"
}
]
}
]
}
}
PostToolUse שמזהה כשל בפקודת build ושולח hook ל-Slack:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "if [ \"$CLAUDE_TOOL_EXIT_CODE\" != \"0\" ] && echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'pnpm build'; then curl -X POST $SLACK_WEBHOOK_URL -d '{\"text\":\"Build failed in '$CLAUDE_PROJECT_NAME'\"}'; fi"
}
]
}
]
}
}
matcher מסנן hook לכלים ספציפיים. תומך ב-regex:
"Edit" — רק כלי Edit"Edit|Write" — Edit או Write"Bash" — כל פקודות Bash".*" — הכל (זהירות, יקר ב-performance)הדרך הקלה ביותר ליצור hook — לבקש מClaude:
Write a hook that runs pnpm typecheck after every Edit on .ts files, and blocks the commit if it fails. Add it to .claude/settings.json.
/hooks בתוך session מציג את ה-hooks הפעילים. אם hook לא מופעל כשציפית — בדוק:
echo "$CLAUDE_TOOL_FILE_PATH" זמניSubagents רצים בקונטקסט נפרד עם סט כלים משלהם. שימושיים למשימות שקוראות הרבה קבצים או דורשות מיקוד מיוחד. הגדרה ב-.claude/agents/:
---
name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
model: opus
---
You are a senior security engineer. Review code for:
- Injection vulnerabilities (SQL, XSS, command injection)
- Authentication and authorization flaws
- Secrets or credentials in code
- Insecure data handling
Provide specific line references and suggested fixes.
אומר ל-Claude להשתמש: "Use a subagent to review this code for security issues."
Claude Code מגיע עם כמה subagents מובנים שאפשר להפעיל מיד:
הפעלה מתוך skill עם context: fork:
---
name: research
description: Deep research on a topic
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly...
/plugin פותח את ה-marketplace. Plugins מחברים skills, hooks, subagents, ו-MCP servers ליחידה אחת. עבור שפות מוטיפסות, התקן code intelligence plugin שמספק ל-Claude ניווט מדויק בסמלים וזיהוי שגיאות אוטומטי אחרי עריכות.
אמור ל-Claude להשתמש ב-CLI tools כמו gh, aws, gcloud, sentry-cli. אלו הדרך החסכונית ביותר ב-context לעבוד עם שירותים חיצוניים. גם כלים שלא מכיר — נסה: "Use 'foo-cli-tool --help' to learn about foo tool, then use it to solve A, B, C."
Model Context Protocol הוא סטנדרט פתוח שמחבר Claude למאות כלים, בסיסי נתונים, ו-APIs. כשאתה מוצא את עצמך מעתיק נתונים מ-Jira, Notion, או Postgres לתוך הצ'אט — זה הסימן להתקין שרת MCP. אחרי החיבור, Claude יכול לקרוא ולפעול ישירות במקום לעבוד ממה שהדבקת.
השיטה הנפוצה לשירותי ענן. רוב ספקי MCP פופולריים תומכים בזה:
# תחביר בסיסי claude mcp add --transport http <name> <url> # דוגמה: חיבור ל-Notion claude mcp add --transport http notion https://mcp.notion.com/mcp # דוגמה עם Bearer token claude mcp add --transport http secure-api https://api.example.com/mcp \ --header "Authorization: Bearer your-token"
השרת רץ כתהליך מקומי במחשב שלך. מתאים לכלים שצריכים גישה למערכת או לסקריפטים מותאמים:
# דוגמה: חיבור ל-Postgres קריאה בלבד claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \ --dsn "postgresql://readonly:pass@prod.db.com:5432/analytics" # דוגמה: Airtable עם API key claude mcp add --transport stdio --env AIRTABLE_API_KEY=YOUR_KEY airtable \ -- npx -y airtable-mcp-server
--transport, --env, --scope, --header) חייבים לבוא לפני שם השרת. ה--- (כפול) מפריד בין שם השרת לפקודה והארגומנטים שלה.
Server-Sent Events. הוחלף ב-HTTP. השתמש רק אם אין אופציה אחרת:
claude mcp add --transport sse asana https://mcp.asana.com/sse
# רשימה של כל השרתים claude mcp list # פרטים על שרת ספציפי claude mcp get github # מחיקה claude mcp remove github # מתוך Claude — סטטוס ו-OAuth /mcp
| Scope | נטען ב | משותף עם הצוות? | נשמר ב |
|---|---|---|---|
local (ברירת מחדל) | פרויקט נוכחי בלבד | לא | ~/.claude.json |
project | פרויקט נוכחי | כן, דרך git | .mcp.json בשורש |
user | כל הפרויקטים שלך | לא | ~/.claude.json |
# שרת לכל הפרויקטים שלך (user scope) claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic # שרת לפרויקט, משותף עם הצוות (project scope) claude mcp add --transport http paypal --scope project https://mcp.paypal.com/mcp
שרתים ב-project scope נשמרים ב-.mcp.json בשורש הפרויקט. תכליתו להיות commit ל-git כך שכל הצוות מקבל אותם שרתים:
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"postgres": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@bytebase/dbhub", "--dsn", "${DATABASE_URL}"],
"env": {}
}
}
}
לאבטחה, Claude מבקש אישור לפני שימוש בשרתים מ-.mcp.json. לאיפוס: claude mcp reset-project-choices.
תחביר נתמך:
${VAR} — מתרחב לערך של VAR${VAR:-default} — VAR אם מוגדר, אחרת default{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}
הרבה שרתים דורשים OAuth. Claude Code תומך מובנה:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp/mcpל-revoke: ב-/mcp בחר "Clear authentication".
שרתי MCP יכולים לחשוף resources שאתה יכול להפנות אליהם עם @:
Can you analyze @github:issue://123 and suggest a fix? Please review the API documentation at @docs:file://api/authentication Compare @postgres:schema://users with @docs:file://database/user-model
https://api.githubcopilot.com/mcp/ — PR reviews, issues, brancheshttps://mcp.sentry.dev/mcp — מעקב errorshttps://mcp.notion.com/mcp — קריאה/כתיבה של דפים@bytebase/dbhubhttps://mcp.stripe.com — נתונים פיננסייםאלפי שרתים נוספים ב-github.com/modelcontextprotocol/servers. השתמש בשרתי MCP של צד שלישי על אחריותך — Anthropic לא בודקת את כולם. היזהר במיוחד עם שרתים שיכולים להביא תוכן לא-אמין (סיכון prompt injection).
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp # בתוך Claude: /mcp # חבר עם OAuth # ואז: What are the most common errors in the last 24 hours? Show me the stack trace for error ID abc123 Which deployment introduced these new errors?
צור Personal Access Token ב-GitHub settings, ואז:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \ --header "Authorization: Bearer YOUR_GITHUB_PAT" # שימוש: Review PR #456 and suggest improvements Create a new issue for the bug we just found Show me all open PRs assigned to me
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \ --dsn "postgresql://readonly:pass@prod.db.com:5432/analytics" # שאילתות בשפה טבעית: What's our total revenue this month? Show me the schema for the orders table Find customers who haven't made a purchase in 90 days
אם התחברת ל-Claude Code עם חשבון claude.ai, שרתי MCP שהוספת ב-claude.ai/customize/connectors זמינים אוטומטית גם ב-Claude Code. /mcp מציג אותם עם סימון שהם מ-claude.ai.
MCP servers טוענים את ה-tools שלהם לקונטקסט. אם יש לך הרבה שרתים, זה צורך הרבה tokens אפילו לפני שהתחלת. Tool Search מופעל כברירת מחדל ודוחה טעינה — Claude מחפש כלים רק כשהוא צריך אותם, ורק הכלים שבאמת נדרשים נכנסים לקונטקסט.
אם אתה רוצה שכלים מסוימים תמיד יהיו זמינים בלי חיפוש:
{
"mcpServers": {
"core-tools": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"alwaysLoad": true
}
}
}
Claude מציג אזהרה אם פלט של MCP tool עובר 10,000 tokens. הגבול הקשה הוא 25,000. אם שרת מחזיר תדיר תוצאות גדולות:
export MAX_MCP_OUTPUT_TOKENS=50000 claude
אפשר להשתמש ב-Claude Code עצמו כ-MCP server שאפליקציות אחרות (כמו Claude Desktop) יכולות להתחבר אליו:
claude mcp serve
Skills הם הדרך העיקרית להרחיב את היכולות של Claude. כל skill הוא קובץ SKILL.md עם הוראות; Claude מוסיף אותו ל-toolkit שלו ומפעיל אותו אוטומטית כשרלוונטי, או שאתה מפעיל ישירות עם /skill-name.
מתי ליצור skill: אם אתה מעתיק שוב ושוב את אותן הוראות, checklist, או פרוצדורה רב-שלבית לתוך השיחה — או אם קטע ב-CLAUDE.md הפך לפרוצדורה במקום עובדה. בניגוד ל-CLAUDE.md, גוף ה-skill נטען רק כשמשתמשים בו, אז חומר ייחוס ארוך כמעט לא עולה דבר עד שאתה זקוק לו.
.claude/commands/. הם מוזגו עם skills. קובץ ב-.claude/commands/deploy.md וקובץ ב-.claude/skills/deploy/SKILL.md שניהם יוצרים /deploy ועובדים זהה. הקבצים הקיימים שלך ממשיכים לעבוד; skills פשוט מוסיפים יכולות נוספות (תיקיה לקבצי תמיכה, frontmatter, טעינה אוטומטית).
נבנה skill שמסכם את השינויים הלא-מקומיטים ב-git ומדגיש סיכונים. Claude יטען אותו אוטומטית כשתשאל על השינויים שלך, או שתוכל להפעיל ישירות עם /summarize-changes.
mkdir -p ~/.claude/skills/summarize-changes
---
description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks to review their diff.
---
## Current changes
!`git diff HEAD`
## Instructions
Summarize the changes above in two or three bullet points, then list any risks you notice such as missing error handling, hardcoded values, or tests that need updating. If the diff is empty, say there are no uncommitted changes.
השורה !`git diff HEAD` היא הזרקת context דינמי — Claude Code מריץ את הפקודה ומחליף את השורה בפלט שלה לפני ש-Claude רואה את התוכן. זה עוצמתי במיוחד.
פתח פרויקט git, עשה עריכה כלשהי, והרץ claude. שאל "what did I change?" או הפעל ישירות עם /summarize-changes.
| טווח | נתיב | חל על |
|---|---|---|
| אישי | ~/.claude/skills/<name>/SKILL.md | כל הפרויקטים שלך |
| פרויקט | .claude/skills/<name>/SKILL.md | הפרויקט הזה (commit ל-git) |
| Plugin | <plugin>/skills/<name>/SKILL.md | איפה שה-plugin מופעל |
| ארגוני | managed settings | כל המשתמשים בארגון |
Live change detection: עריכת skill ב-session פעיל נכנסת לתוקף מיד, בלי restart. רק יצירת תיקיית skills חדשה לגמרי דורשת restart.
Conventions, patterns, style guides, ידע דומיין. רץ inline כך ש-Claude משתמש בו לצד הקונטקסט של השיחה.
---
name: api-conventions
description: API design patterns for this codebase
---
When writing API endpoints:
- Use RESTful naming conventions
- Return consistent error formats
- Include request validation
הוראות צעד-צעד לפעולה ספציפית: deployments, commits, יצירת קוד. בדרך כלל אתה מפעיל אותם ישירות עם /skill-name. הוסף disable-model-invocation: true כדי שClaude לא יפעיל אוטומטית.
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---
Deploy the application:
1. Run the test suite
2. Build the application
3. Push to the deployment target
| שדה | תפקיד |
|---|---|
name | שם תצוגה. ברירת מחדל: שם התיקייה. אותיות קטנות, מספרים, מקפים, עד 64 תווים. |
description | מומלץ. מה ה-skill עושה ומתי להשתמש. Claude משתמש בזה להחליט מתי להפעיל. עד 1,536 תווים. |
when_to_use | קונטקסט נוסף עם trigger phrases ודוגמאות. נוסף ל-description ונספר באותה תקרה. |
argument-hint | רמז ב-autocomplete. לדוגמה: [issue-number]. |
arguments | שמות לארגומנטים מסומנים, ל-substitution כמו $issue. |
disable-model-invocation | true = רק אתה יכול להפעיל. לטריגר ידני בלבד. |
user-invocable | false = רק Claude יכול להפעיל. לידע רקע שלא רלוונטי כפקודה. |
allowed-tools | כלים ש-Claude יכול להשתמש בהם בלי לבקש רשות כשה-skill פעיל. |
model | override של מודל לטרן הזה. לדוגמה: opus, inherit. |
effort | low / medium / high / xhigh / max — רמת מאמץ. |
context: fork | הרץ את ה-skill ב-subagent מבודד. |
agent | איזה subagent להשתמש כש-context: fork. לדוגמה: Explore, Plan. |
hooks | hooks ספציפיים ל-lifecycle של ה-skill הזה. |
paths | glob patterns. ה-skill נטען אוטומטית רק כשעובדים עם קבצים תואמים. |
shell | bash (ברירת מחדל) או powershell. לסקריפטי inline על Windows. |
$ARGUMENTS — כל הארגומנטים שהועברו$ARGUMENTS[N] · $N — ארגומנט ספציפי לפי אינדקס$name — ארגומנט מסומן (לפי arguments ב-frontmatter)${CLAUDE_SESSION_ID} — מזהה הסשן${CLAUDE_EFFORT} — רמת המאמץ הנוכחית${CLAUDE_SKILL_DIR} — תיקיית ה-SKILL.md (לקריאה לסקריפטים בה)---
name: migrate-component
description: Migrate a component from one framework to another
---
Migrate the $0 component from $1 to $2.
Preserve all existing behavior and tests.
הפעלה: /migrate-component SearchBar React Vue
הסינטקס !`command` מריץ פקודות shell לפני ש-Claude רואה את ה-skill. הפלט מחליף את ה-placeholder. זה לא משהו ש-Claude מריץ — זו preprocessing. Claude רק רואה את התוצאה הסופית עם נתונים אמיתיים.
---
name: pr-summary
description: Summarize changes in a pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`
## Your task
Summarize this pull request...
למספר שורות, השתמש בבלוק קוד שפותח ב-```!:
## Environment ```! node --version npm --version git status --short ```
Skill לא חייב להיות רק SKILL.md. אפשר להוסיף templates, examples, ו-scripts:
my-skill/
├── SKILL.md # ראשי (חובה)
├── reference.md # API docs מפורטים — נטען לפי דרישה
├── examples.md # דוגמאות שימוש — נטענות לפי דרישה
└── scripts/
└── helper.py # סקריפט שClaude מריץ
הפנה לקבצים מ-SKILL.md כדי ש-Claude יידע מה יש בכל אחד. שמור את SKILL.md מתחת ל-500 שורות; חומר ייחוס מפורט — לקבצים נפרדים.
context: fork מריץ את ה-skill בקונטקסט נפרד עם sub-agent. תוכן ה-skill הופך ל-prompt שמניע את ה-subagent. שימושי לחקירות שלא רוצים שיזהמו את הקונטקסט הראשי:
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file references
Claude Code מגיע עם כמה skills מובנים שזמינים בכל סשן:
/simplify — פישוט קוד/batch — הרצת פעולות במקביל/debug — דיבוג מסיסטמטי/loop — polling במחזורים/claude-api — עזרה עם API של Claude| Frontmatter | אתה | Claude | נטען לקונטקסט |
|---|---|---|---|
| (ברירת מחדל) | כן | כן | תיאור תמיד, גוף בעת הפעלה |
disable-model-invocation: true | כן | לא | גוף נטען רק כשאתה מפעיל |
user-invocable: false | לא | כן | תיאור תמיד, גוף בעת הפעלה |
כש-skill מופעל, התוכן נכנס לשיחה כהודעה אחת ונשאר שם לכל הסשן. Claude לא קורא מחדש את הקובץ בטרנים מאוחרים יותר. אז: כתוב הוראות שתופסות לכל המשימה כ-"הוראות עומדות", לא כ-"צעדים חד-פעמיים".
בעת compaction, ה-skill הכי מאוחר שהופעל מקבל עד 5,000 tokens; כל ה-skills שהופעלו מחלקים תקציב משולב של 25,000 tokens. אם השפעת ה-skill נחלשת — או שהמודל בחר גישה אחרת, או שהוא נדחף החוצה ע"י skills מאוחרים יותר. הפעל מחדש כדי לשחזר.
לפי הפרויקטים הטיפוסיים שלך, כמה skills שיכולים להיות שימושיים:
/commit — skill עם disable-model-invocation: true שמריץ git status ו-git diff דרך הזרקה דינמית, מסכם, ומציע commit message/db-migration — skill ספציפי לפרויקט שיוצר migration ב-Drizzle/Prisma לפי השבלונה שלך/rtl-component — skill שמייצר רכיב React חדש עם תמיכת RTL מובנית, dir="rtl", logical properties, ופורמט תאריכים ב-he-IL/security-audit — skill עם context: fork שמריץ סקירת אבטחה ב-subagent מבודד/hebrew-spell-check — skill שבודק טקסט עברי בקבצים לפני commit (כתיב נכון, ניקוד, RTL)disable-model-invocation: true.SLASH_COMMAND_TOOL_CHAR_BUDGET.אחרי שאתה יעיל עם Claude אחד — תוכל להכפיל את התפוקה עם sessions מקבילים, headless mode, ו-fan-out patterns.
# שאילתת חד-פעמית claude -p "Explain what this project does" # פלט מובנה לסקריפטים claude -p "List all API endpoints" --output-format json # Streaming לעיבוד בזמן אמת claude -p "Analyze this log file" --output-format stream-json
שילוב ב-pipelines:
tail -200 app.log | claude -p "Slack me if you see any anomalies" git diff main --name-only | claude -p "review these changed files for security issues" claude -p "translate new strings into French and raise a PR for review"
הרץ feature אחד בטרמינל אחד, ובאותו זמן Claude מתקן באג בשני — בלי שה-edits יתנגשו. כל worktree הוא checkout נפרד עם branch משלו:
claude --worktree feature-auth
Claude שכתב את הקוד "מאוהב" בו. סשן נפרד לסקירה מקבל קונטקסט נקי וצריך להעריך מאפס:
| Session A — Writer | Session B — Reviewer |
|---|---|
| "Implement a rate limiter for our API endpoints" | |
| "Review the rate limiter implementation in @src/middleware/rateLimiter.ts. Look for edge cases, race conditions, and consistency with our existing middleware patterns." | |
| "Here's the review feedback: [Session B output]. Address these issues." |
למיגרציות גדולות, פזר עבודה על-פני הרצות מקבילות:
claude -p "list all 2,000 Python files that need migrating" > files.txt
for file in $(cat files.txt); do
claude -p "Migrate $file from React to Vue. Return OK or FAIL." \
--allowedTools "Edit,Bash(git commit *)"
done
שיפר את ה-prompt על בסיס מה שלא עבד ב-2-3 הראשונים, ואז הרץ על כל הסט.
claude --permission-mode auto -p "fix all lint errors"
למשימות שאתה סומך על הכיוון הכללי. ה-classifier בודק ברקע ויפעיל יציאה אם הוא נחסם שוב ושוב.
כשClaude רץ ללא השגחה (CI, scheduled task, headless), חיוני לקבוע גבולות. בלעדיהם — Claude יכול להיתקע ב-loop, לשרוף budget, או לעשות נזק לפני שהבחנת:
# הגבל מספר turns (Claude מסיים אם הגיע למגבלה) claude -p "refactor the auth module" --max-turns 20 # הגבל budget בדולרים claude -p "fix all type errors" --max-budget-usd 5.00 # שילוב — הכי בטוח להרצה אוטונומית claude --permission-mode auto -p "fix all lint errors" \ --max-turns 30 --max-budget-usd 2.00 # fallback למודל זול אם המודל הראשי עמוס claude -p "translate strings" --fallback-model sonnet # הגבל כלים ספציפיים בלבד claude -p "review files" --allowedTools "Read,Grep,Glob" # bare mode — מהיר יותר, ללא MCP/skills/hooks claude --bare -p "summarize this log file"
כלל אצבע: ל-headless production תמיד שלב --max-turns + --max-budget-usd. אלה הגנה אחרונה אם משהו השתבש.
workflow שמריץ Claude לסקירת PR אוטומטית בכל פעם שנפתח PR חדש:
name: Claude PR Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Claude Code
run: curl -fsSL https://claude.ai/install.sh | bash
- name: Run Claude review
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
git diff origin/main...HEAD > /tmp/diff.txt
claude -p "Review this PR diff. Focus on:
- Bugs and logic errors
- Security issues
- Missing error handling
- Tests for new code
Return findings in markdown. Be concise.
Diff: $(cat /tmp/diff.txt)" \
--max-turns 10 \
--max-budget-usd 1.00 \
--output-format json > /tmp/review.json
- name: Post review as comment
uses: actions/github-script@v7
with:
script: |
const review = require('/tmp/review.json');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## 🤖 Claude Review\n\n${review.result}`
});
טיפים ל-CI:
claude setup-token ליצירת long-lived OAuth token (חלופה ל-API key)--max-budget-usd כדי שלא תקבל הפתעה בחשבון--fallback-model sonnet אם אתה רוצה שיעבוד גם בעומסRoutines רצים על תשתית של Anthropic — ממשיכים גם כשהמחשב כבוי. שימושי למשימות שחוזרות:
needs-review, post inline comments, summarize in #eng-reviews"routine רץ אוטונומית — לא יכול לשאול שאלות הבהרה. כתוב את ה-prompt באופן מלא:
# רע — עמום מדי "check for failing tests" # טוב — מפורט, קריטריוני סיום ברורים Run pnpm test. If anything fails: 1. Open a GitHub issue with title "Test failures: [date]" 2. Include the test output (truncated to 100 lines) 3. Tag with `failing-tests` and `auto-generated` 4. If an issue with that title was opened in last 24h, comment instead 5. Post a summary to #eng-alerts on Slack If all tests pass: silent. No notification needed. Budget: 5 minutes max. If you can't complete in 5 min, abort and notify me.
צור routine מהדפדפן ב-claude.ai/code/routines, מאפליקציית הדסקטופ, או עם /schedule ב-CLI.
Routines רצים בענן של Anthropic — אין להם גישה לקבצים מקומיים, ל-uncommitted changes, או לסביבה הספציפית שלך. אם צריך זה — Desktop scheduled tasks (ב-Desktop app) רצים על המחשב שלך.
טבלת השוואה:
| נושא | Routines | Desktop Tasks |
|---|---|---|
| איפה רץ | ענן Anthropic | המחשב שלך |
| רץ כשהמחשב כבוי | כן | לא |
| גישה לקבצים מקומיים | רק דרך git remote | מלאה |
| טריגרים | schedule, GitHub events, API | schedule בלבד |
| שימוש טיפוסי | PR reviews, audits שמתבססים על repo | scripts מקומיים, integrations שדורשות login של המחשב |
הפרק הזה מראה את הכשלים מתוך שיחות אמיתיות. הסימן הראשון של כשל זה שאתה מתחיל לתסכל. תפוס את עצמך מוקדם.
איך זה נראה:
[15:00] You: fix the auth bug in login.ts [15:30] You: actually, can you also add a dark mode toggle? [16:00] You: btw, what's a good library for date formatting? [16:15] You: ok back to the auth bug — why isn't your fix working? Claude: Looking at the code... [reads 8 files about dark mode and dates]
הסימן: Claude קורא קבצים שלא קשורים למשימה הנוכחית, או "שוכח" הוראות שנתת בהתחלה. הקונטקסט מלא בדאטה לא רלוונטי.
תיקון: /clear בין משימות לא קשורות. אם אתה רוצה לחזור לבאג הראשון — /clear, ואז התחל מחדש: "fix the auth bug in @src/auth/login.ts. error: [paste]".
איך זה נראה:
You: add validation to the email field Claude: [adds basic regex] You: that's wrong, it doesn't catch user@.com Claude: [adds another check] You: still wrong, now valid emails get rejected Claude: [tries again] You: NO. you're not fixing the actual problem.
הסימן: תיקנת אותו 2-3 פעמים על אותו דבר ועדיין לא עובד.
תיקון:
/clearאיך זה נראה: ה-CLAUDE.md שלך עבר 200 שורות. אתה כותב כללים אבל Claude ממשיך להתעלם מחציים. אתה מוסיף "IMPORTANT" ו-"YOU MUST" — לא עוזר.
הסימן: כללים חשובים נאבדים בתוך הרעש. Claude עוקב אחרי 3-4 הכללים הראשונים ושוכח את השאר.
תיקון:
.claude/rules/ עם paths: frontmatter.claude/skills/)איך זה נראה:
You: add pagination to the products list Claude: Done! Added pagination with page/limit params. You: [merges] [user reports broken] Investigation: pagination works for English chars only. Hebrew characters in product names break the cursor.
הסימן: הקוד "נראה סביר" אבל לא ראית אותו רץ במקרים אמיתיים.
תיקון: תמיד בקש verification:
איך זה נראה:
You: investigate why our build is slow
Claude: [reads webpack.config.js] [reads next.config.js] [reads package.json]
[reads 30 component files] [reads tsconfig.json]
[reads .eslintrc] [reads README] ...
Status bar: Context: 78% used
הסימן: Claude קורא עשרות קבצים, הקונטקסט מתמלא, וטרם הגעתם לתשובה.
תיקון: תמיד תן scope לחקירות, או האצל ל-subagent:
# במקום investigate why our build is slow # העדף use a subagent to investigate why our build is slow. focus on bundle size and number of dependencies. return a summary of findings, not file contents.
איך זה נראה:
You: integrate Stripe checkout
Claude: Done! Added Stripe integration.
[imports a function that doesn't exist]
[uses an API endpoint that doesn't exist in Stripe SDK]
[returns config that the deploy environment doesn't have]
You: [tries to run it] ReferenceError: stripe.checkout.create is not a function
הסימן: Claude כותב קוד שמרגיש סביר אבל מתבסס על API שלא קיים, package version ישן, או הנחות לא נכונות.
תיקון:
איך זה נראה:
You: build a CSV export feature
Claude: Should it include all columns or selected? What separator?
What encoding? Should it stream or buffer? What filename pattern?
How should errors be handled? Should there be a progress bar?
...
הסימן: Claude שואל יותר מדי שאלות במקום לחקור ולהציע. אתה מבזבז זמן עונה במקום לתת לו לעבוד.
תיקון: תן לו לחקור ולהציע, ולא לראיין:
# במקום לחכות לשאלות build a CSV export feature # העדף — תן הקשר ובקש הצעה build a CSV export for the orders table. look at how we handle other exports in @src/exports/. follow the same pattern. propose your approach in 3 bullet points before implementing — I'll approve or adjust.
הערה הפוכה: אם המשימה באמת מורכבת — בקש "interview me using AskUserQuestion" כדי לקבל ראיון מובנה (פרק 11).
| פקודה | מה היא עושה |
|---|---|
claude | פתיחת מצב אינטראקטיבי |
claude "task" | הרצת משימה חד-פעמית |
claude -p "query" | שאילתה headless ללא session |
claude -c · claude --continue | המשך השיחה האחרונה בתיקייה |
claude -r · claude --resume | בחירה מרשימת שיחות |
claude --from-pr 1234 | חזרה לסשן שמקושר ל-PR |
claude --worktree NAME | פתיחת sessions מקבילים |
claude --permission-mode plan | פתיחה במצב plan |
claude --output-format json | פלט מובנה לסקריפטים |
claude --version | בדיקת גרסה |
| פקודה | מה היא עושה |
|---|---|
/help | הצגת פקודות זמינות |
/init | יצירת CLAUDE.md אוטומטית |
/clear | איפוס היסטוריית השיחה |
/compact [instructions] | סיכום של הקונטקסט עם הוראות |
/rewind | תפריט שחזור לנקודות קודמות |
/memory | צפייה ועריכה של זיכרון אוטומטי ו-CLAUDE.md |
/permissions | ניהול הרשאות ו-allowlist |
/hooks | צפייה ב-hooks מוגדרים |
/plugin | פתיחת marketplace של plugins |
/sandbox | הפעלת בידוד ברמת ה-OS |
/btw | שאלת צד מהירה ללא כניסה להיסטוריה |
/rename NAME | קביעת שם לסשן |
/login | החלפת חשבון |
/bug | דיווח באג ל-Anthropic |
/feedback | שליחת משוב |
הפרק הזה מתרגם את כל מה שלמדת ל-checklist מסודר. אם אתה מתחיל עכשיו — עבור לפי הסדר. אם אתה כבר משתמש בClaude Code — סקור את החלק שאתה כנראה דילגת עליו (רוב המשתמשים מדלגים על Skills ו-MCP).
claude /login והתחברcd /path/to/your/project והרץ claude או פתח את הפאנל ב-VS Code/init — Claude יצור CLAUDE.md ראשוני (פרק 6)@/clear כשאתה עובר למשימה הבאהCLAUDE.md בכל פעם שאתה רואה את עצמך מתקן את Claude על אותה טעות פעם שנייה/clear בין משימות לא קשורות — תרגיש את ההבדל--chrome פעם ראשונה (פרק 9)/usage אחרי משימה גדולה — תפתח אינטואיציה לעלויותdefaultMode בהגדרות אם אתה תמיד עובד באותו מצבcontext: fork שמריץ ב-Explore agentהשליטה לא באה מהיכרות עם כל פיצ'ר — היא באה מתרגול חוזר של חמישה הרגלים פשוטים.
הסעיף הזה לא חלק מהתיעוד הרשמי — אלו עצות מעשיות לסביבה ישראלית טיפוסית.
Claude Code עובד טוב ב-PowerShell, אבל אם הותקן Git for Windows הוא יעדיף את Bash דרך Git Bash. זה רצוי, כי הרבה מהדוגמאות בתיעוד הן Bash. אם אתה ב-PowerShell, שים לב שפקודות עם && לא יעבדו — ב-PowerShell משתמשים ב-; או ב--and.
אפשר לבקש מ-Claude לתקשר בעברית — הוא יעשה זאת מצוין, כולל הסברים, הערות ותיעוד. עם זאת:
אם אתה בונה אפליקציה בעברית, הוסף ל-CLAUDE.md משהו כמו:
# Localization
- App is Hebrew-first, RTL primary direction
- All UI components must support RTL via dir="rtl" or CSS logical properties
- Use logical properties: padding-inline-start instead of padding-left
- Don't hardcode 'right'/'left' — use 'inline-start'/'inline-end'
- Date/number formatting via Intl API with 'he-IL' locale
Claude Code רץ מקומית ויכול לקרוא קבצים. הוא לא שולח את הקוד שלך לאף אחד אחר חוץ מ-Anthropic לצורך השלמת ה-prompt. עדיין:
.env ולא בקוד.env.local ו-CLAUDE.local.md ב-.gitignoregit log -p שלא חשפת בטעות secrets בעבר; אם כן — סבב את הסודות וטפל ב-history עם git filter-repoאם אתה מנהל כמה SaaS במקביל (כמו פוסטים, קליניקה, וכו'), הגדר user-level CLAUDE.md ב-~/.claude/CLAUDE.md עם העדפות גלובליות שלך, ו-CLAUDE.md ספציפי לכל פרויקט. ה-rules תחת ~/.claude/rules/ יחולו על כל הפרויקטים.
שילוב מומלץ:
~/.claude/CLAUDE.md — סגנון אישי, העדפות communication, "אני לא חובב bullet points ארוכים"./CLAUDE.md — stack של הפרויקט, conventions, build commands./.claude/rules/*.md — חוקים path-scoped (frontend rules, API rules, וכו')./.claude/skills/ — workflows חוזרים שאתה רוצה להפעיל ידניתהדפוסים שבמדריך הם נקודות התחלה, לא חוקים מקודשים. לפעמים כן כדאי לתת לקונטקסט להצטבר כי אתה עמוק בבעיה אחת מורכבת. לפעמים תדלג על תכנון ותתן ל-Claude לזרום כי המשימה חקרנית. שים לב למה שעובד.
כש-Claude מפיק תוצאה מצוינת — שים לב למה עשית: מבנה ה-prompt, הקונטקסט שסיפקת, המצב שהיית בו. כשהוא נאבק — שאל למה. הקונטקסט היה רועש מדי? ה-prompt עמום מדי? המשימה גדולה מדי לפעם אחת? עם הזמן תפתח אינטואיציה שאף מדריך לא יכול לתפוס.
תדע מתי להיות ספציפי ומתי להישאר פתוח, מתי לתכנן ומתי לחקור, מתי לנקות קונטקסט ומתי להניח לו להצטבר.
Anthropic Academy מציעה סדרת קורסים חינמיים עם וידאו, תרגילים ובחנים שעוסקים בעבודה ובפיתוח עם Claude Code, Claude API, Skills, Subagents ו-MCP. הקורסים מתאימים מאוד אחרי שעברת על המדריך הזה — הם מעמיקים בכל נושא עם דמו חי ותרגול ממשי.
ריכזתי את הקטלוג בעברית — כולל מטרות לימוד, תוכנית מלאה, דרישות קדם, מסלולי למידה לפי רמה (מתחיל / מפתח עצמאי / בונה אפליקציות AI / מסלול מלא) וקישור להרשמה ישירה לכל קורס:
8 קורסים: Claude Code 101, Claude Code in Action, Agent Skills, Subagents, Claude API, MCP (יסוד ומתקדם), ו-Claude Cowork.
הקורסים חינמיים ודורשים רק חשבון ב-Skilljar (לא חייב חשבון Anthropic). בסיום כל קורס מקבלים תעודה. תרגום זה הוא בלתי רשמי — המקור באנגלית הוא הגרסה המחייבת, וזמין ב-anthropic.skilljar.com.