БЕСПЛАТНОЕ РУКОВОДСТВО

50 советов по Claude Code

Практическое руководство от инженера с 6 месяцами ежедневного опыта. От первого запуска до параллельной работы с subagents.

~20 минут чтения 6 глав 50 советов
FREE GUIDE

50 Tips for Claude Code

A practical guide from an engineer with 6 months of daily use. From first launch to parallel work with subagents.

~20 min read 6 chapters 50 tips

Глава 1 · Основы и настройка

Tips 1–11: фундамент эффективной работы с Claude Code.

TIP #1

Запускайте Claude Code из корня проекта

Claude Code использует текущую директорию как отправную точку. Запуск из корня даёт полную картину: файловая структура, package.json, конфиги.

# Правильно
cd ~/projects/my-app && claude

# Неправильно — Claude видит только часть проекта
cd ~/projects/my-app/src/components && claude
TIP #2

Запустите /init первым делом

Команда анализирует проект и создаёт CLAUDE.md — файл инструкций с build-командами, тестами и ключевыми директориями. Запускайте при первом использовании в новом проекте.

TIP #3

CLAUDE.md — иерархическая система

Работает на трёх уровнях:

УровеньПутьСодержимое
Глобальный~/.claude/CLAUDE.mdОбщие правила
Проектный./CLAUDE.mdСпецифика проекта
Директория./src/api/CLAUDE.mdПравила модуля
TIP #4

Держите CLAUDE.md кратким — до 300 строк

Каждая строка — это токены при каждом запросе. Раздутый файл увеличивает стоимость, размывает инструкции и замедляет ответы.

Правило: если инструкция не влияет на качество результата — удалите её.

TIP #5

Структура: What + Domain + Validation

Три секции эффективного CLAUDE.md:

  • What — что делает проект, стек, архитектура
  • Domain — бизнес-логика, термины, паттерны
  • Validation — команды build, test, lint для самопроверки

Секция Validation — самая важная. Она даёт Claude петлю самокоррекции.

TIPS #6–9

Горячие клавиши

КлавишаДействие
Shift+TabПереключение: Normal → Auto-accept → Plan Mode
EscapeПрерывает текущую операцию
Esc EscОчищает строку ввода
Esc Esc (пустой ввод)Rewind — откат к предыдущему состоянию
TIPS #10–11

Скриншоты как контекст

Claude Code принимает изображения: перетащите скриншот в терминал (drag-and-drop) или укажите путь к файлу. Добавляйте текстовые пояснения для повышения точности диагностики.

Глава 2 · Навигация и команды

Tips 12–19: управление контекстом и сессиями.

TIP #12

/clear — ваша главная команда

Переключаетесь на новую задачу — сбрасывайте контекст. Свежий контекст всегда работает лучше раздутого.

Правило: одна задача — один контекст. Переключился — очистил.

TIP #13

/context — аудит токенов

Показывает распределение контекстного окна: system prompt, MCP-серверы, CLAUDE.md, история. Если MCP-сервер потребляет 30% окна — пересмотрите его необходимость.

TIPS #14–18

Ключевые команды

КомандаНазначение
/modelПереключить модель (sonnet/opus/haiku)
/resumeВосстановить сессию из 30-дневной истории
/mcpСтатус MCP-серверов и потребление токенов
/helpПолная справка по командам

Auto-compaction работает автоматически — доверяйте встроенному механизму оптимизации контекста.

TIP #19

Git — ваша страховка

Коммитьте перед серьёзными изменениями. Если Claude пойдёт не туда — один git checkout . вернёт всё назад. Маленькие, частые коммиты — лучшая практика.

Глава 3 · CLAUDE.md — искусство настройки

Tips 20–24: превращаем CLAUDE.md в мощный инструмент.

TIP #20

Секция 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
TIP #21

Попросите Claude обновить CLAUDE.md

Вместо ручного редактирования — дайте Claude задание. Это compound engineering: каждая сессия улучшает будущие сессии.

TIP #22

Workflow-триггеры

Маппинг команд на скрипты в CLAUDE.md:

## Workflows
- "собери проект" → npm run build
- "запусти тесты" → npm test -- --coverage
- "деплой" → ./scripts/deploy.sh --staging
TIPS #23–24

Git + безопасность

Коммитьте CLAUDE.md — это часть проекта, не личная настройка. Версионирование, командная работа, накопление знаний.

--dangerously-skip-permissions — только для одноразовых контейнеров и CI/CD. Никогда на рабочей машине.

Глава 4 · Ежедневный Workflow

Tips 25–31: как работать с Claude Code каждый день.

TIP #25

Plan Mode First — всегда

Самый важный workflow-совет:

  1. Переключитесь в Plan Mode (Shift+Tab дважды)
  2. Опишите задачу и обсудите подход
  3. Итерируйте план до чёткости
  4. Переключитесь в Normal Mode и реализуйте

Когда контекст чёткий — реализация часто получается с первого раза.

TIP #26

Свежий контекст > раздутый контекст

СвежийРаздутый
Быстрые ответыМедленная генерация
Точные решенияПутаница между задачами
Дешевле по токенамДорого за каждый запрос
TIPS #27–28

Второй мозг и lazy loading

Перед завершением сессии — попросите Claude записать все важные решения в CLAUDE.md. Так знания не теряются.

Lazy loading: не загружайте все файлы заранее. Укажите точку входа, и Claude сам определит, что нужно прочитать.

TIP #29

Команды верификации — петля самокоррекции

Самый важный совет по мнению автора. Добавьте в 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 будет автоматически проверять и исправлять свой код.

TIPS #30–31

Opus для сложных задач + thinking blocks

Используйте /model opus для сложных рефакторингов и архитектурных решений. Читайте thinking blocks — фразы вроде "I'm not sure..." указывают на неуверенность Claude.

Глава 5 · Power User

Tips 32–44: четыре примитива и параллельная работа.

TIP #32

Четыре composable примитива

Вся расширяемость Claude Code строится на четырёх блоках:

ПримитивНазначениеПример
SkillsПовторяющиеся workflowПроцедура деплоя
CommandsБыстрые шорткаты/review
MCPsВнешние сервисыGitHub, Notion, DB
SubagentsИзолированный контекстПараллельные задачи
TIPS #33–37

Skills, Commands и MCPs

Skills — Markdown-файлы в .claude/skills/ с инструкциями для частых операций.

Commands теперь объединены со Skills. Не создавайте вручную — попросите Claude.

MCPs подключают Claude к GitHub, базам данных, мониторингу. Попросите Claude установить нужный MCP.

TIPS #38–39

Subagents и качество инструкций

Subagents — независимые агенты с отдельным контекстным окном для параллельных задач.

Не перегружайте инструкциями: 5 ключевых правил лучше 50 мелких. Claude и так знает best practices.

TIPS #40–43

Параллельная работа

Несколько инстансов 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
TIP #44

/chrome — работа с браузером

Claude Code может управлять браузером: навигация, клики, заполнение форм, инспекция DOM, скриншоты. Применение: тестирование UI, парсинг, автоматизация.

Глава 6 · Продвинутые техники

Tips 45–50: hooks, автоматизация и философия.

TIPS #45–47

Hooks — перехват действий

Скрипты, которые выполняются до (PreToolUse) или после (PostToolUse) действий Claude:

  • Auto-format: Prettier после каждого файла
  • Блокировка: запрет rm -rf, DROP TABLE, force-push
  • Логирование: запись действий для аудита
TIP #48

Экосистема плагинов

Растущая экосистема: тысячи MCP-серверов на GitHub, курированные списки, community skills. Используйте composable primitives через расширения.

TIPS #49–50

Context is King

Главный принцип. Пять слоёв контекста:

  1. CLAUDE.md — статичный (правила, инструкции)
  2. Промпт — динамический (текущая задача)
  3. Файлы — кодовый (состояние проекта)
  4. MCP — внешний (API, данные)
  5. History — исторический (предыдущие решения)

Claude нужно именно то, что нужно. И ничего лишнего.

Хотите AI-ассистента, который использует все эти техники?

MILA GPT — персональный AI-ассистент для бизнеса и продуктивности. Работает 24/7, используя лучшие практики Claude Code.

Chapter 1 · Basics and Setup

Tips 1–11: the foundation for working effectively with Claude Code.

TIP #1

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
TIP #2

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.

TIP #3

CLAUDE.md — a hierarchical system

Works on three levels:

LevelPathContent
Global~/.claude/CLAUDE.mdGeneral rules
Project./CLAUDE.mdProject specifics
Directory./src/api/CLAUDE.mdModule rules
TIP #4

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.

TIP #5

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.

TIPS #6–9

Hotkeys

KeyAction
Shift+TabToggle: Normal → Auto-accept → Plan Mode
EscapeInterrupts the current operation
Esc EscClears the input line
Esc Esc (empty input)Rewind — roll back to previous state
TIPS #10–11

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.

TIP #12

/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 tasks? Clear the context.

TIP #13

/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.

TIPS #14–18

Key commands

CommandPurpose
/modelSwitch model (sonnet/opus/haiku)
/resumeRestore a session from 30-day history
/mcpMCP server status and token consumption
/helpFull command reference

Auto-compaction works automatically — trust the built-in context optimization mechanism.

TIP #19

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.

TIP #20

Critical Rules section

At the top of CLAUDE.md, put 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
TIP #21

Ask Claude to update CLAUDE.md

Instead of editing manually, give Claude the task. This is compound engineering: every session improves future sessions.

TIP #22

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
TIPS #23–24

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 your work machine.

Chapter 4 · Daily Workflow

Tips 25–31: how to work with Claude Code every day.

TIP #25

Plan Mode First — always

The most important workflow tip:

  1. Switch to Plan Mode (Shift+Tab twice)
  2. Describe the task and discuss the approach
  3. Iterate on the plan until it is clear
  4. Switch to Normal Mode and implement

When the context is clear, implementation often succeeds on the first try.

TIP #26

Fresh context > bloated context

FreshBloated
Fast responsesSlow generation
Precise solutionsConfusion between tasks
Cheaper in tokensExpensive per request
TIPS #27–28

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.

TIP #29

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.

TIPS #30–31

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.

TIP #32

Four composable primitives

All Claude Code extensibility is built on four blocks:

PrimitivePurposeExample
SkillsRepeatable workflowsDeploy procedure
CommandsQuick shortcuts/review
MCPsExternal servicesGitHub, Notion, DB
SubagentsIsolated contextParallel tasks
TIPS #33–37

Skills, Commands, and MCPs

Skills are 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.

TIPS #38–39

Subagents and instruction quality

Subagents are independent agents with a separate context window for parallel tasks.

Do not overload Claude with instructions: 5 key rules are better than 50 minor ones. Claude already knows best practices.

TIPS #40–43

Parallel work

Running multiple Claude Code instances simultaneously is 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
TIP #44

/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.

TIPS #45–47

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
TIP #48

Plugin ecosystem

A growing ecosystem: thousands of MCP servers on GitHub, curated lists, community skills. Use composable primitives through extensions.

TIPS #49–50

Context is King

The main principle. Five layers of context:

  1. CLAUDE.md — static (rules, instructions)
  2. Prompt — dynamic (current task)
  3. Files — code (project state)
  4. MCP — external (APIs, data)
  5. History — historical (previous decisions)

Claude needs exactly what it needs. And nothing more.

Want an AI assistant that uses all these techniques?

MILA GPT is a personal AI assistant for business and productivity. It works 24/7, using Claude Code best practices.