Глава 1 · Основы и настройка
Tips 1–11: фундамент эффективной работы с Claude Code.
Запускайте Claude Code из корня проекта
Claude Code использует текущую директорию как отправную точку. Запуск из корня даёт полную картину: файловая структура, package.json, конфиги.
# Правильно
cd ~/projects/my-app && claude
# Неправильно — Claude видит только часть проекта
cd ~/projects/my-app/src/components && claude
Запустите /init первым делом
Команда анализирует проект и создаёт CLAUDE.md — файл инструкций с build-командами, тестами и ключевыми директориями. Запускайте при первом использовании в новом проекте.
CLAUDE.md — иерархическая система
Работает на трёх уровнях:
| Уровень | Путь | Содержимое |
|---|---|---|
| Глобальный | ~/.claude/CLAUDE.md | Общие правила |
| Проектный | ./CLAUDE.md | Специфика проекта |
| Директория | ./src/api/CLAUDE.md | Правила модуля |
Держите CLAUDE.md кратким — до 300 строк
Каждая строка — это токены при каждом запросе. Раздутый файл увеличивает стоимость, размывает инструкции и замедляет ответы.
Правило: если инструкция не влияет на качество результата — удалите её.
Структура: What + Domain + Validation
Три секции эффективного CLAUDE.md:
- What — что делает проект, стек, архитектура
- Domain — бизнес-логика, термины, паттерны
- Validation — команды build, test, lint для самопроверки
Секция Validation — самая важная. Она даёт Claude петлю самокоррекции.
Горячие клавиши
| Клавиша | Действие |
|---|---|
Shift+Tab | Переключение: Normal → Auto-accept → Plan Mode |
Escape | Прерывает текущую операцию |
Esc Esc | Очищает строку ввода |
Esc Esc (пустой ввод) | Rewind — откат к предыдущему состоянию |
Скриншоты как контекст
Claude Code принимает изображения: перетащите скриншот в терминал (drag-and-drop) или укажите путь к файлу. Добавляйте текстовые пояснения для повышения точности диагностики.
Глава 2 · Навигация и команды
Tips 12–19: управление контекстом и сессиями.
/clear — ваша главная команда
Переключаетесь на новую задачу — сбрасывайте контекст. Свежий контекст всегда работает лучше раздутого.
Правило: одна задача — один контекст. Переключился — очистил.
/context — аудит токенов
Показывает распределение контекстного окна: system prompt, MCP-серверы, CLAUDE.md, история. Если MCP-сервер потребляет 30% окна — пересмотрите его необходимость.
Ключевые команды
| Команда | Назначение |
|---|---|
/model | Переключить модель (sonnet/opus/haiku) |
/resume | Восстановить сессию из 30-дневной истории |
/mcp | Статус MCP-серверов и потребление токенов |
/help | Полная справка по командам |
Auto-compaction работает автоматически — доверяйте встроенному механизму оптимизации контекста.
Git — ваша страховка
Коммитьте перед серьёзными изменениями. Если Claude пойдёт не туда — один git checkout . вернёт всё назад. Маленькие, частые коммиты — лучшая практика.
Глава 3 · CLAUDE.md — искусство настройки
Tips 20–24: превращаем CLAUDE.md в мощный инструмент.
Секция Critical Rules
В начале CLAUDE.md — абсолютные правила со словами NEVER и ALWAYS:
## Critical Rules
- NEVER modify files in /config/production/
- ALWAYS run tests before committing
- NEVER use `any` type in TypeScript
- ALWAYS include error handling in API routes
Попросите Claude обновить CLAUDE.md
Вместо ручного редактирования — дайте Claude задание. Это compound engineering: каждая сессия улучшает будущие сессии.
Workflow-триггеры
Маппинг команд на скрипты в CLAUDE.md:
## Workflows
- "собери проект" → npm run build
- "запусти тесты" → npm test -- --coverage
- "деплой" → ./scripts/deploy.sh --staging
Git + безопасность
Коммитьте CLAUDE.md — это часть проекта, не личная настройка. Версионирование, командная работа, накопление знаний.
--dangerously-skip-permissions — только для одноразовых контейнеров и CI/CD. Никогда на рабочей машине.
Глава 4 · Ежедневный Workflow
Tips 25–31: как работать с Claude Code каждый день.
Plan Mode First — всегда
Самый важный workflow-совет:
- Переключитесь в Plan Mode (
Shift+Tabдважды) - Опишите задачу и обсудите подход
- Итерируйте план до чёткости
- Переключитесь в Normal Mode и реализуйте
Когда контекст чёткий — реализация часто получается с первого раза.
Свежий контекст > раздутый контекст
| Свежий | Раздутый |
|---|---|
| Быстрые ответы | Медленная генерация |
| Точные решения | Путаница между задачами |
| Дешевле по токенам | Дорого за каждый запрос |
Второй мозг и lazy loading
Перед завершением сессии — попросите Claude записать все важные решения в CLAUDE.md. Так знания не теряются.
Lazy loading: не загружайте все файлы заранее. Укажите точку входа, и Claude сам определит, что нужно прочитать.
Команды верификации — петля самокоррекции
Самый важный совет по мнению автора. Добавьте в CLAUDE.md:
## Verification
- Build: npm run build
- Test: npm test
- Lint: npm run lint
- Type check: npx tsc --noEmit
After ANY code change, run build + test to verify.
Claude будет автоматически проверять и исправлять свой код.
Opus для сложных задач + thinking blocks
Используйте /model opus для сложных рефакторингов и архитектурных решений. Читайте thinking blocks — фразы вроде "I'm not sure..." указывают на неуверенность Claude.
Глава 5 · Power User
Tips 32–44: четыре примитива и параллельная работа.
Четыре composable примитива
Вся расширяемость Claude Code строится на четырёх блоках:
| Примитив | Назначение | Пример |
|---|---|---|
| Skills | Повторяющиеся workflow | Процедура деплоя |
| Commands | Быстрые шорткаты | /review |
| MCPs | Внешние сервисы | GitHub, Notion, DB |
| Subagents | Изолированный контекст | Параллельные задачи |
Skills, Commands и MCPs
Skills — Markdown-файлы в .claude/skills/ с инструкциями для частых операций.
Commands теперь объединены со Skills. Не создавайте вручную — попросите Claude.
MCPs подключают Claude к GitHub, базам данных, мониторингу. Попросите Claude установить нужный MCP.
Subagents и качество инструкций
Subagents — независимые агенты с отдельным контекстным окном для параллельных задач.
Не перегружайте инструкциями: 5 ключевых правил лучше 50 мелких. Claude и так знает best practices.
Параллельная работа
Несколько инстансов Claude Code одновременно — мощнейшая техника:
- iTerm:
Cmd+D— split,Cmd+[/]— навигация - Git worktrees: отдельные рабочие деревья для каждого инстанса
- Уведомления: звуковые алерты о завершении задач
# Создать отдельные рабочие деревья
git worktree add ../app-feature-a feature-a
git worktree add ../app-feature-b feature-b
/chrome — работа с браузером
Claude Code может управлять браузером: навигация, клики, заполнение форм, инспекция DOM, скриншоты. Применение: тестирование UI, парсинг, автоматизация.
Глава 6 · Продвинутые техники
Tips 45–50: hooks, автоматизация и философия.
Hooks — перехват действий
Скрипты, которые выполняются до (PreToolUse) или после (PostToolUse) действий Claude:
- Auto-format: Prettier после каждого файла
- Блокировка: запрет
rm -rf,DROP TABLE, force-push - Логирование: запись действий для аудита
Экосистема плагинов
Растущая экосистема: тысячи MCP-серверов на GitHub, курированные списки, community skills. Используйте composable primitives через расширения.
Context is King
Главный принцип. Пять слоёв контекста:
- CLAUDE.md — статичный (правила, инструкции)
- Промпт — динамический (текущая задача)
- Файлы — кодовый (состояние проекта)
- MCP — внешний (API, данные)
- History — исторический (предыдущие решения)
Claude нужно именно то, что нужно. И ничего лишнего.
Хотите AI-ассистента, который использует все эти техники?
MILA GPT — персональный AI-ассистент для бизнеса и продуктивности. Работает 24/7, используя лучшие практики Claude Code.
Chapter 1 · Basics and Setup
Tips 1–11: the foundation for effective work with Claude Code.
Launch Claude Code from the project root
Claude Code uses the current directory as its starting point. Launching from the root gives it the full picture: file structure, package.json, configs.
# Correct
cd ~/projects/my-app && claude
# Wrong — Claude only sees part of the project
cd ~/projects/my-app/src/components && claude
Run /init first
This command analyzes the project and creates CLAUDE.md — an instruction file with build commands, tests, and key directories. Run it when first using Claude Code in a new project.
CLAUDE.md — a hierarchical system
Works on three levels:
| Level | Path | Content |
|---|---|---|
| Global | ~/.claude/CLAUDE.md | General rules |
| Project | ./CLAUDE.md | Project specifics |
| Directory | ./src/api/CLAUDE.md | Module rules |
Keep CLAUDE.md concise — under 300 lines
Every line means tokens on every request. A bloated file increases cost, dilutes instructions, and slows down responses.
Rule: if an instruction does not improve output quality — remove it.
Structure: What + Domain + Validation
Three sections of an effective CLAUDE.md:
- What — what the project does, stack, architecture
- Domain — business logic, terminology, patterns
- Validation — build, test, lint commands for self-verification
The Validation section is the most important. It gives Claude a self-correction loop.
Hotkeys
| Key | Action |
|---|---|
Shift+Tab | Toggle: Normal → Auto-accept → Plan Mode |
Escape | Interrupts the current operation |
Esc Esc | Clears the input line |
Esc Esc (empty input) | Rewind — roll back to previous state |
Screenshots as context
Claude Code accepts images: drag and drop a screenshot into the terminal or specify the file path. Add text explanations to improve diagnostic accuracy.
Chapter 2 · Navigation and Commands
Tips 12–19: managing context and sessions.
/clear — your main command
Switching to a new task — reset the context. Fresh context always works better than a bloated one.
Rule: one task — one context. Switched task — clear context.
/context — token audit
Shows context window distribution: system prompt, MCP servers, CLAUDE.md, history. If an MCP server consumes 30% of the window — reconsider whether you need it.
Key commands
| Command | Purpose |
|---|---|
/model | Switch model (sonnet/opus/haiku) |
/resume | Restore a session from 30-day history |
/mcp | MCP server status and token consumption |
/help | Full command reference |
Auto-compaction works automatically — trust the built-in context optimization mechanism.
Git — your safety net
Commit before major changes. If Claude goes off track — a single git checkout . brings everything back. Small, frequent commits are best practice.
Chapter 3 · CLAUDE.md — The Art of Configuration
Tips 20–24: turning CLAUDE.md into a powerful tool.
Critical Rules section
At the top of CLAUDE.md — absolute rules using NEVER and ALWAYS:
## Critical Rules
- NEVER modify files in /config/production/
- ALWAYS run tests before committing
- NEVER use `any` type in TypeScript
- ALWAYS include error handling in API routes
Ask Claude to update CLAUDE.md
Instead of manual editing — give Claude the task. This is compound engineering: every session improves future sessions.
Workflow triggers
Map commands to scripts in CLAUDE.md:
## Workflows
- "build the project" → npm run build
- "run tests" → npm test -- --coverage
- "deploy" → ./scripts/deploy.sh --staging
Git + security
Commit CLAUDE.md — it is part of the project, not a personal setting. Version control, team collaboration, knowledge accumulation.
--dangerously-skip-permissions — only for disposable containers and CI/CD. Never on a working machine.
Chapter 4 · Daily Workflow
Tips 25–31: how to work with Claude Code every day.
Plan Mode First — always
The most important workflow tip:
- Switch to Plan Mode (
Shift+Tabtwice) - Describe the task and discuss the approach
- Iterate the plan until it is clear
- Switch to Normal Mode and implement
When context is clear — implementation often succeeds on the first try.
Fresh context > bloated context
| Fresh | Bloated |
|---|---|
| Fast responses | Slow generation |
| Precise solutions | Confusion between tasks |
| Cheaper in tokens | Expensive per request |
Second brain and lazy loading
Before ending a session — ask Claude to write down all important decisions in CLAUDE.md. This way knowledge is not lost.
Lazy loading: do not load all files in advance. Specify the entry point, and Claude will determine what it needs to read on its own.
Verification commands — self-correction loop
The most important tip according to the author. Add to CLAUDE.md:
## Verification
- Build: npm run build
- Test: npm test
- Lint: npm run lint
- Type check: npx tsc --noEmit
After ANY code change, run build + test to verify.
Claude will automatically verify and fix its own code.
Opus for complex tasks + thinking blocks
Use /model opus for complex refactors and architectural decisions. Read thinking blocks — phrases like "I'm not sure..." indicate Claude's uncertainty.
Chapter 5 · Power User
Tips 32–44: four primitives and parallel work.
Four composable primitives
All Claude Code extensibility is built on four blocks:
| Primitive | Purpose | Example |
|---|---|---|
| Skills | Repeatable workflows | Deploy procedure |
| Commands | Quick shortcuts | /review |
| MCPs | External services | GitHub, Notion, DB |
| Subagents | Isolated context | Parallel tasks |
Skills, Commands, and MCPs
Skills — Markdown files in .claude/skills/ with instructions for frequent operations.
Commands are now merged with Skills. Do not create them manually — ask Claude.
MCPs connect Claude to GitHub, databases, monitoring. Ask Claude to install the MCP you need.
Subagents and instruction quality
Subagents — independent agents with a separate context window for parallel tasks.
Do not overload with instructions: 5 key rules are better than 50 minor ones. Claude already knows best practices.
Parallel work
Multiple Claude Code instances simultaneously — the most powerful technique:
- iTerm:
Cmd+D— split,Cmd+[/]— navigation - Git worktrees: separate working trees for each instance
- Notifications: sound alerts when tasks complete
# Create separate working trees
git worktree add ../app-feature-a feature-a
git worktree add ../app-feature-b feature-b
/chrome — browser automation
Claude Code can control the browser: navigation, clicks, form filling, DOM inspection, screenshots. Use cases: UI testing, scraping, automation.
Chapter 6 · Advanced Techniques
Tips 45–50: hooks, automation, and philosophy.
Hooks — action interception
Scripts that run before (PreToolUse) or after (PostToolUse) Claude's actions:
- Auto-format: Prettier after every file
- Blocking: prohibit
rm -rf,DROP TABLE, force-push - Logging: record actions for audit
Plugin ecosystem
A growing ecosystem: thousands of MCP servers on GitHub, curated lists, community skills. Use composable primitives through extensions.
Context is King
The main principle. Five layers of context:
- CLAUDE.md — static (rules, instructions)
- Prompt — dynamic (current task)
- Files — code (project state)
- MCP — external (APIs, data)
- History — historical (previous decisions)
Claude needs exactly what it needs. And nothing more.
Want an AI assistant that uses all these techniques?
MILA GPT — a personal AI assistant for business and productivity. Works 24/7, using Claude Code best practices.