Claude Code — פיתוח עם AI
שיעור 4 מתוך 8 50%
שיעור הבא →
שיעור 04 20 דקות

עבודה עם קבצים ופרויקטים — Context ו-CLAUDE.md

CLAUDE.md הוא אחד הדברים הכי חזקים ב-Claude Code — ורוב האנשים לא יודעים שהוא קיים. קובץ אחד שמגדיר למי Claude Code הפרויקט שלך, מה מותר ומה אסור, ואיך לעבוד.

מה זה CLAUDE.md?

CLAUDE.md הוא קובץ Markdown שיושב בשורש הפרויקט שלך. Claude Code קורא אותו אוטומטית בכל session. זה הזיכרון הקבוע של Claude Code לגבי הפרויקט שלך.

ללא CLAUDE.md, Claude Code לומד מחדש על הפרויקט שלך בכל פעם. עם CLAUDE.md — הוא כבר יודע הכל מהרגע הראשון.

מה כדאי לשים ב-CLAUDE.md

1. סקירת הפרויקט

# Project Overview
WordPress theme for Jonny Studio (jonnystudio.co.il).
Built with PHP 8.2, Vite for CSS/JS bundling, Tailwind CSS utilities.
Theme location: /wp-content/themes/jonny-theme/

## Architecture
- src/css/main.css → dist/css/ (Vite build)
- src/js/main.js + animations.js → dist/js/
- inc/ — all PHP includes (schema, CPTs, helpers)
- template-parts/ — reusable template partials

2. פקודות נפוצות

## Common Commands
- Build CSS/JS: `npm run build` (from theme root)
- Dev server: `npm run dev`
- WordPress is served at: https://jonnystudio.co.il
- Theme activated: jonny-theme

3. כללים וסגנון קוד

## Code Style
- PHP: functions prefixed with `jonny_`, no classes
- CSS: utility-first with Tailwind, custom vars in :root
- JS: vanilla JS only, no jQuery
- Always add Hebrew RTL support for new UI components
- Never modify dist/ files directly — always edit src/

4. אזורים רגישים — מה לא לגעת

## Do Not Modify
- dist/ files (auto-generated)
- functions.php header comment block
- Any file with "DO NOT EDIT" comment

דוגמת CLAUDE.md מלאה לפרויקט WordPress

# Jonny Studio WordPress Theme

## Stack
- WordPress 6.5+, PHP 8.2
- Vite 5 build system
- Tailwind CSS (via PostCSS)
- Vanilla JS (no jQuery)

## File Structure
- `src/css/main.css` — source CSS (edit here)
- `src/js/main.js` — source JS (edit here)
- `dist/` — compiled output (never edit directly)
- `inc/` — PHP modules
- `template-parts/` — reusable PHP partials

## Build
Run `npm run build` after CSS/JS changes.
Dev: `npm run dev` (hot reload).

## Conventions
- PHP functions: `jonny_` prefix
- CSS variables: `--accent`, `--bg`, `--text-muted`
- All user-facing text in Hebrew (RTL)
- Use `esc_html()`, `esc_attr()`, `esc_url()` everywhere

## Database
Local: `local` (MySQL), user: root, host: localhost
Do NOT run database migrations without asking first.

## Testing
No automated tests. Visual testing via https://jonnystudio.co.il

איך Claude Code קורא את הפרויקט

בנוסף ל-CLAUDE.md, Claude Code סורק את מבנה הפרויקט כדי להבין:

  • package.json — dependencies ו-scripts
  • composer.json — PHP dependencies
  • .gitignore — מה מוחרג
  • מבנה תיקיות ברמה ראשונה

Claude Code לא קורא כל קובץ מראש — הוא קורא קבצים ספציפיים לפי הצורך. זה חוסך tokens ומהיר יותר.

.claudeignore — מה לא לקרוא

אפשר ליצור קובץ .claudeignore (כמו .gitignore) כדי להחריג תיקיות:

node_modules/
dist/
.git/
*.log
wp-content/uploads/

מונע מ-Claude Code לבזבז context על קבצים שלא מעניינים.

CLAUDE.md בתיקיות משנה

אפשר לשים CLAUDE.md גם בתיקיות ספציפיות — Claude Code יקרא את שניהם. שימושי למיקרו-הוראות לחלק מסוים של הפרויקט:

project/
  CLAUDE.md          ← הוראות כלליות
  src/
    CLAUDE.md        ← הוראות ספציפיות ל-src/

✅ סיכום השיעור

  • CLAUDE.md נקרא אוטומטית בכל session — זיכרון קבוע
  • כלול: סקירת פרויקט, פקודות, כללי קוד, אזורים רגישים
  • .claudeignore להחרגת תיקיות כמו node_modules
  • ניתן לשים CLAUDE.md גם בתיקיות משנה

בשיעור הבא — Agentic Workflows: כיצד לגרום ל-Claude Code לבצע tasks שלמים ומורכבים, לא רק שינויים קטנים.

שיעור קודם
הפקודות הבסיסיות ואיך לדבר עם Claude…
שיעור הבא
Agentic Workflows — אוטומציה של משימות…
התקשרו עכשיו
דלגו לתוכן הראשי