Files
Luong NGUYEN ac9ee17169 docs: make version stamps and Compatible Models footers true (#259)
Type: docs

Makes the version stamps, Compatible Models footers and locale README badges say only what has been checked. Every claim below was checked against `https://code.claude.com/docs/en/<page>.md` or the raw changelog (2.1.303–2.1.322), not written from memory.

## Part A: English footers at 2.1.310 / 2.1.302

Each file's behavioural claims were checked against every changelog entry after its stamp, up to 2.1.322, and against the current docs. A stamp moves only when every claim checks out.

| File | Claims checked | Fixes | Sources | New stamp |
|---|---|---|---|---|
| `INDEX.md` | ~75: AGENTS.md rule (v2.1.277); skill/agent/MCP install paths; `/mcp__github__list_prs`; 5 hook types, 33 events, task-tool model note; `--plugin-dir`; checkpoint menu (6 options); `/workflows`, ultracode (v2.1.284), size guideline; 6 permission modes; `/loop` and the cron tools; Chrome; Remote Control; `SendMessage`/`ListAgents`/`notify_when_idle`; CLI flags | 1. Workflow size: medium aims for fewer than 10 agents only since v2.1.271 (15 before), and the default is small on a Pro plan. 2. dontAsk: file reads inside the working directories also run, as do *most* calls a `permissions.allow` rule or a `PreToolUse` hook approves (neither can approve critical-path `rm`/`rmdir` or network-path reads), and an installed mod can approve some calls. No version is given: the changelog doesn't say when a mod's `tool.check` allow arrived (it is already referenced in 2.1.290, 2.1.292 and 2.1.299). 3. `SendMessage` also reaches sessions on other machines and in the cloud, from a session connected to Remote Control with a claude.ai sign-in; a cloud session can't answer with `SendMessage`. The L383 use-case column now says the same. 4. The `--model` list adds the Fable models. 5. Plan mode: "Read-only analysis" → researches and proposes, runs shell commands to explore, edits blocked until the plan is approved. | [workflows#set-a-size-guideline](https://code.claude.com/docs/en/workflows#set-a-size-guideline) ("The default is `medium`, or `small` when you're signed in on a Pro plan with Claude Code v2.1.271 or later"); CL 2.1.219 ("aim for fewer than 15 agents"), CL 2.1.271 ("lowered the medium size guideline from 15 to 10 agents"); [permission-modes](https://code.claude.com/docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode) ("a mod you installed can still approve some of those calls"; "Claude still runs … file reads inside your working directories and read-only Bash commands"; "It also denies the built-in `AskUserQuestion` tool even if your allow rules match it"; "An allow rule or `PreToolUse` hook can't approve these: Recognized `rm` and `rmdir` critical-path removals … Reads from a network path"); CL 2.1.292 ("Fixed a plugin's `tool.check` hook answering allow running a tool…"), CL 2.1.299 ("…that a `PreToolUse` hook or a mod's `tool.check` hook allowed"); [permission-modes#analyze-before-you-edit-with-plan-mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode) ("Claude reads files, runs shell commands to explore, and writes a plan, but does not edit your source. Except in interactive terminal sessions with bypass permissions available, edits stay blocked until you approve the plan."); [cross-session-messaging](https://code.claude.com/docs/en/cross-session-messaging) ("reach your sessions on other machines or in the cloud"; "from a session that is connected to Remote Control, which needs a claude.ai sign-in"; "A cloud session … can't use `SendMessage` to answer a message from another machine"); model-config. The "device card" line checked out against [whats-new/2026-w34](https://code.claude.com/docs/en/whats-new/2026-w34). | **2.1.322** |
| `LEARNING-ROADMAP.md` | 33 hook events / 5 types; 6 built-in subagents (Explore, Plan, General-purpose, claude, statusline-setup, claude-code-guide); 60+ commands (commands page has 121 rows); `/design` (v2.1.265); `/plan`, `/rewind`, `/loop 5m`, `/schedule`; 6 permission modes (Manual since v2.1.200); Alt+T; skill `effort`/`shell`; plugin `workflows`/`channels`/`dependencies`; agent-teams env var; `claude mcp add --transport http`; `-r`, `--max-turns`, `--output-format json`; all 17 source links resolve | 1. Remote Control: "generally available" → "out of research preview", the docs' own wording. 2. Extended thinking (L368, Exercise 3, checklist): Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models always use extended thinking, so the exercise uses `/effort` and scopes Alt+T / Option+T to models that allow turning thinking off. 3. Exercise 4: checkpoints are automatic and unnamed, so step 1 no longer creates a named "Clean state" checkpoint and step 5 says which one to `/rewind` to. | [whats-new/2026-w34](https://code.claude.com/docs/en/whats-new/2026-w34): "Any machine running `claude remote-control` now shows up as a device card at the top of the Code tab in the Claude app. Remote Control is also out of research preview."; [interactive-mode](https://code.claude.com/docs/en/interactive-mode): Alt+T "Has no effect on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking."; [model-config](https://code.claude.com/docs/en/model-config): "the effort level is the primary control for how much thinking happens"; [checkpointing](https://code.claude.com/docs/en/checkpointing): "Every prompt you send that starts a turn creates a new checkpoint" | **2.1.322** |
| `resources.md` | Adaptive reasoning on Opus 4.7+, Sonnet 5+, Haiku 5.5 and the Fable models; permission modes; 33 hook events; `/loop` and cron; 7 memory tiers; Chrome; keybinding chords; Code Review; Monitor (2.1.98); `/goal` and `claude agents` (2.1.139); `--json` (2.1.145); all links | none needed | model-config, hooks, memory, agent-view, changelog | **stays 2.1.310**: L253 gives `/run`, `/verify`, `/run-skill-generator` as "(v2.1.145+)". Neither the changelog, the v2.1.145 release notes, the skills/commands docs nor the what's-new pages for weeks 19–22 give a version. |
| `03-skills/claude-md/SKILL.md` | `name`/`description` frontmatter, `$ARGUMENTS`; CLAUDE.md locations and loading; "under 200 lines"; AGENTS.md gates (v2.1.277, v2.1.281), blocking files, `/config` Project instructions values and default; `@AGENTS.md`/symlink fallback; `.claude/agents/` | L196: the list of cases where AGENTS.md isn't read now includes a disabled built-in plugin, and limits the upgrade case to "in some cases" after upgrading from v2.1.276 or earlier | [memory#when-agents-md-support-is-unavailable](https://code.claude.com/docs/en/memory#when-agents-md-support-is-unavailable): "You used `/plugin` to disable the built-in plugin that reads `AGENTS.md`"; "In some cases, it's your first session after you upgrade from v2.1.276 or earlier" | **stays 2.1.302**: no primary source states L24 ("~150-200 instructions", "system prompt already uses ~50") or L214 (the system reminder says CLAUDE.md "may or may not be relevant") |
| `07-plugins/devops-automation/README.md` | `--plugin-dir` install; commands; agents; hooks; MCP; workflow; source URLs (all 200) | none: the stale claims need a design decision (below) | [plugins/components](https://code.claude.com/docs/en/plugins/components): "Save a command at `commands/<file>.md` and it becomes `/<plugin>:<file>`"; [plugins-reference](https://code.claude.com/docs/en/plugins-reference) standard layout: "Hooks \| `hooks/hooks.json`", "MCP servers \| `.mcp.json`" | **stays 2.1.302**: bare `/deploy`, `/rollback`, `/status` (`/status` is also a built-in), `/incident`; `hooks/*.js` are never registered (no `hooks/hooks.json`); `mcp/kubernetes-config.json` never loads (no `.mcp.json` or `mcpServers`) |
| `07-plugins/documentation/README.md` | same | none | same | **stays 2.1.302**: bare command names; `mcp/github-docs-config.json` never loads, so the `GITHUB_TOKEN` setup has no effect |
| `07-plugins/pr-review/README.md` | same | none | same | **stays 2.1.302**: bare command names; `hooks/pre-review.js` is not registered; `mcp/github-config.json` never loads |

No changelog entry from 2.1.303 to 2.1.322 touched the plugin READMEs or SKILL.md. Their problems predate the stamps, and #209 already listed the hook/MCP files that never load.

**Locale copies:** the same factual fixes went into every locale with the same sentence. That's dontAsk and plan mode in all six INDEX files; workflow size in fa and ko; `SendMessage` and the use-case column in fa and ko; the `--model` list in fa and ko; "generally available" in fa and ko LEARNING-ROADMAP; the extended-thinking exercise/checklist and the checkpoint exercise in all six LEARNING-ROADMAP copies; the AGENTS.md cases in all six SKILL.md copies. Locale stamps were not bumped. INDEX and LEARNING-ROADMAP stay at 2.1.310 in every locale, and the SKILL.md copies keep their footers.

## Part B: Compatible Models footers

The new list is **Claude Fable 5.2, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 5.5, Claude Haiku 4.5**. It is used on root docs and module pages alike, and it's the README FAQ's list, so the footers and the FAQ no longer disagree.

Why one list for both file types: STYLE_GUIDE's footer rule ("List all compatible models") applies to both. A shorter "current models only" list on module pages would break that rule. Justification from [model-config](https://code.claude.com/docs/en/model-config):

- **Current models:** "| Anthropic API | Opus 5.5 | Sonnet 5.5 | Haiku 5.5 |"; "the `fable` alias resolves to Fable 5 in Claude apps gateway sessions and to Fable 5.2 everywhere else"; "Fable 5.2 requires Claude Code v2.1.321 or later".
- **Older models still in use:**
  - "**Fable 5.1 or Fable 5**: select it by model ID."
  - "| Claude Platform on AWS | Opus 5.5 | Sonnet 4.6 | Haiku 4.5 |".
  - "biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8".
  - "**Sonnet 5.5**: cybersecurity-flagged requests re-run on Sonnet 5."
- **None are retired.** The [models overview](https://platform.claude.com/docs/en/about-claude/models/overview) that model-config links marks only Opus 4.1, Opus 4 and Sonnet 4 as "retired". All eleven listed models appear there without that mark.

Scope: 336 lines in 331 files. The changed lines are the `**Compatible Models**` lines (92, some of them in locale files) and every localized label (`호환 모델`, `مدل‌های سازگار`, `Các Mô Hình Tương Thích`, `Сумісні моделі`, `対応モデル`, `互換モデル`, `兼容模型`), plus the italic `*対応:…*` / `*Для …*` / `*适用于 …*` lines in the ja/uk/zh concepts guides. Labels, separators (`, ` `、` `، `) and locale stamps are unchanged. The README FAQ lines and the 05-mcp `tool_reference` note are not footers and were left alone. The footer lines of `CHANGELOG.md`, `fa/CHANGELOG.md` and `ko/CHANGELOG.md` also carry the new list; only the footer line changed, not the entries.

## Part C: locale README badges

Real state: the newest version that most (more than half) of the locale's ten module READMEs carry or exceed, backed by the sync commit that brought them there.

A badge is marked **(partial)** when one or more of the locale's module READMEs has no version footer (never synced since its first translation), or when the locale is a condensed translation. A module synced to an older version than the badge doesn't make it partial on its own; the majority rule above already covers that. Only zh meets the rule (02-memory and 05-mcp have no footer, and #247 calls zh condensed).

| Locale | Old badge / "latest" | Evidence | New |
|---|---|---|---|
| ja | 2.1.119 (badge, "latest", FAQ) | module footers: 3×2.1.322, 5×2.1.316, 1×2.1.310, 1×2.1.302; 8/10 ≥ 2.1.316 (#230); #247 carried only the sections ja has | **2.1.316** (Oct 2026) |
| uk | 2.1.112 (FAQ line; no badge) | 3×2.1.322, 4×2.1.316, 1×2.1.310, 2×2.1.302; 7/10 ≥ 2.1.316 (#230) | **2.1.316** (Oct 2026) |
| zh | 2.1.112 (badge, "latest", FAQ) | 2.1.316, 2.1.310 ×2, 2.1.302 ×2, 2.1.300 ×2, 2.1.278; 02 and 05 have no footer (untouched since the first translation); 7/10 ≥ 2.1.300 (#193); #247 was "condensed", model lists only | **2.1.300 (partial)** (Oct 2026): the badge, "latest" and FAQ lines say zh is condensed and that 02-memory and 05-mcp haven't been synced since the April 2026 translation |
| ko | 2.1.310 | 5×2.1.322, 5×2.1.310; #228 synced ko to 2.1.310, and #247 says 2.1.316 "was not backfilled" | **2.1.310** (unchanged) |
| fa | 2.1.310 | 5×2.1.322, 5×2.1.316; #241 "syncs the translation from v2.1.310 to v2.1.316"; #247 carried only the 2.1.322 P1 changes | **2.1.316** (Oct 2026) |
| vi | none (README has no badge or version line) | 4×2.1.322, 6×2.1.316 | no change |

Months come from the docs changelog: 2.1.300 was released October 14, 2026 and 2.1.316 October 31, 2026. The README *footers* in fa/ja/ko/uk/zh stay at 2.1.322: #247 checked those files themselves, while the badge describes the whole locale.

## Deliberately left

- **Stamps not bumped:** `resources.md` (2.1.310), `03-skills/claude-md/SKILL.md` and the three plugin READMEs (2.1.302), for the reasons in the Part A table.
- **Example plugins:** the fix is a design choice between wiring up `hooks/hooks.json` / `.mcp.json` and rewording the READMEs, and renaming commands to `/<plugin>:<name>` touches seven languages plus `07-plugins/README.md` (bare `/review-pr`). It needs a follow-up issue.
- **Same unverifiable version elsewhere:** `03-skills/README.md` also said `/run-skill-generator` is v2.1.145+. Handled by #262, now merged into this branch from `main`.
- **Older `--model` lists:** ja/uk/vi/zh INDEX have pre-5.x lists (e.g. "Sonnet 4.6, Opus 4.7, Haiku 4.5"). That isn't the English sentence, so it belongs to a locale sync.

## Follow-ups
- **LEARNING-ROADMAP `/effort` line (review r3 N13):** line 368 can read as if `/effort` applies only to the models that always use extended thinking; per model-config's effort table it also works on Opus 5, Sonnet 5 and Opus 4.8. Not wrong; clarify in the next pass.

- **Compatible Models scope (review S3):** Opus 4.6 is Microsoft Foundry's current `opus`, and Sonnet 4.5 is the current `sonnet` on Bedrock, Google Cloud's Agent Platform and Foundry (deprecated, retiring Nov 30, 2026), per model-config's alias table. Both are still in use, so either add them to the FAQ and every footer (Sonnet 4.5 marked deprecated), or define the list's scope in STYLE_GUIDE (e.g. the models the aliases resolve to on the Anthropic API plus older models in active use) and cite the deprecations table.
- **Model order (review N8):** the list puts Opus 4.8 after Sonnet 4.6. Grouping by family (Fable, Opus 5.5/5/4.8, Sonnet, Haiku) would read better; the order is shared by STYLE_GUIDE, the FAQ and every footer, so change it everywhere at once.
- **Example plugins:** the follow-up issue proposed above.

## Validation

- `SKIP=mermaid,vietnamese-mermaid,japanese-mermaid,korean-mermaid,persian-mermaid pre-commit run --files <338 changed files>`: every hook passes, including link-check (246 URLs per language). The Mermaid hooks can't install here (`language: node must have package.json or additional_dependencies`, the same failure #247 reported). `python scripts/check_mermaid.py --strict` was run directly instead: Pele 1.6.0 rendered all 416 blocks.
- `python scripts/check_cross_references.py`: all valid (674 files).
- Review fix round 1 (18 files): the same `pre-commit run --files` passes every hook (Mermaid hooks skipped as above; no Mermaid block was touched), and the cross-reference check is still valid after merging `main`.
- Review fix round 2 (14 files: the extended-thinking wording in all 7 LEARNING-ROADMAP files, the dontAsk line in all 7 INDEX files): `pre-commit run --files` passes every hook (Mermaid hooks skipped; no Mermaid block touched), and the cross-reference check is valid (674 files) after merging `main` again (#257).
- Pre-push secret scan: it flagged `06-hooks/README.md:1683` (en, fa, vi), a false positive. The `sk-…{20,}` pattern matches the docs anchor `hooks#pretooluse-ask-decisions-in-auto-mode`, which has been on `main` since 11b2ae3 (en), c2f92c8 (fa) and 8de1820 (vi), and is not on a line this PR changes. The PR's added lines have no secret-pattern matches.

Closes #256
2026-11-12 14:29:18 +01:00
..

Claude How To

Довідник CLI

Огляд

Claude Code CLI (інтерфейс командного рядка — основний інструмент для роботи з терміналом) — це головний спосіб взаємодії з Claude Code. Він надає потужні опції для виконання запитів, управління сесіями, конфігурації моделей та інтеграції Claude у ваші робочі процеси розробки.

Архітектура

graph TD
    A["User Terminal"] -->|"claude [options] [query]"| B["Claude Code CLI"]
    B -->|Interactive| C["REPL Mode"]
    B -->|"--print"| D["Print Mode (SDK)"]
    B -->|"--resume"| E["Session Resume"]
    C -->|Conversation| F["Claude API"]
    D -->|Single Query| F
    E -->|Load Context| F
    F -->|Response| G["Output"]
    G -->|text/json/stream-json| H["Terminal/Pipe"]

CLI-команди

Команда Опис Приклад
claude Запуск інтерактивного REPL (циклу читання-виконання-виводу) claude
claude "query" Запуск REPL з початковим промптом claude "explain this project"
claude -p "query" Print-режим — запит і вихід claude -p "explain this function"
cat file | claude -p "query" Обробка вмісту через pipe (конвеєр) cat logs.txt | claude -p "explain"
claude -c Продовжити останню розмову claude -c
claude -c -p "query" Продовжити в print-режимі claude -c -p "check for type errors"
claude -r "<session>" "query" Відновити сесію за ID або назвою claude -r "auth-refactor" "finish this PR"
claude update Оновити до останньої версії claude update
claude mcp Налаштування MCP-серверів Див. документацію MCP
claude mcp serve Запуск Claude Code як MCP-сервера claude mcp serve
claude agents Список усіх налаштованих субагентів claude agents
claude auto-mode defaults Вивести стандартні правила auto mode як JSON claude auto-mode defaults
claude remote-control Запуск сервера Remote Control (серверний режим, без локальної інтерактивної сесії; обслуговує кілька сесій, --capacity за замовчуванням 32) claude remote-control --name "My Project"
claude --remote-control [name] Запуск інтерактивної сесії з увімкненим Remote Control (аліас --rc) claude --rc
claude plugin Управління плагінами (встановлення, увімкнення, вимкнення) claude plugin install my-plugin
claude auth login Вхід (підтримує --email, --sso) claude auth login --email user@example.com
claude auth logout Вихід з поточного облікового запису claude auth logout
claude auth status Перевірка статусу авторизації (код виходу 0 = увійшов, 1 = ні) claude auth status

Основні прапорці

Прапорець Опис Приклад
-p, --print Вивести відповідь без інтерактивного режиму claude -p "query"
-c, --continue Завантажити останню розмову claude --continue
-r, --resume Відновити конкретну сесію за ID або назвою claude --resume auth-refactor
-v, --version Показати номер версії claude -v
-w, --worktree Запуск в ізольованому git worktree (робочому дереві) claude -w
-n, --name Відображувана назва сесії claude -n "auth-refactor"
--from-pr <number> Відновити сесії, привʼязані до GitHub PR claude --from-pr 42
--cloud [description|session_id|url] Створити хмарну сесію на claude.ai із заданим описом або приєднатися до наявної за session ID чи URL claude.ai/code claude --cloud "implement API"
--remote "task" Застарілий аліас для --cloud, включно з формою приєднання до наявної сесії. Використовуйте --cloud claude --remote "implement API"
--remote-control, --rc Інтерактивна сесія з Remote Control claude --rc
--teleport Відновити веб-сесію локально claude --teleport
--teammate-mode Режим відображення Agent Teams claude --teammate-mode tmux
--bare Мінімальний режим (без хуків, навичок, плагінів, MCP, auto memory, CLAUDE.md) claude --bare
--enable-auto-mode Розблокувати auto permission mode claude --enable-auto-mode
--channels Підписка на MCP channel plugins. Кожен запис має бути позначений як plugin:<name>@<marketplace>; голі імена відхиляються claude --channels plugin:discord@my-marketplace
--chrome / --no-chrome Увімкнути/вимкнути інтеграцію з браузером Chrome claude --chrome
--effort Встановити рівень зусиль мислення claude --effort high
--init / --init-only --init запускає хуки ініціалізації (Setup) перед сесією, лише в режимі print; --init-only запускає хуки Setup і SessionStart, а потім завершує роботу claude -p --init "query"
--maintenance Запуск хуків обслуговування (Setup) перед сесією (лише в режимі print) claude -p --maintenance "query"
--disable-slash-commands Вимкнути всі навички та слеш-команди claude --disable-slash-commands
--no-session-persistence Вимкнути збереження сесії (print mode) claude -p --no-session-persistence "query"

Інтерактивний vs Print-режим

graph LR
    A["claude"] -->|Default| B["Interactive REPL"]
    A -->|"-p flag"| C["Print Mode"]
    B -->|Features| D["Multi-turn conversation<br>Tab completion<br>History<br>Slash commands"]
    C -->|Features| E["Single query<br>Scriptable<br>Pipeable<br>JSON output"]

Інтерактивний режим (за замовчуванням):

# Запуск інтерактивної сесії
claude

# Запуск з початковим промптом
claude "explain the authentication flow"

Print-режим (неінтерактивний):

# Один запит, потім вихід
claude -p "what does this function do?"

# Обробка вмісту файлу
cat error.log | claude -p "explain this error"

# Ланцюжок з іншими інструментами
claude -p "list todos" | grep "URGENT"

Модель та конфігурація

Прапорець Опис Приклад
--model Встановити модель (sonnet, opus, haiku або повна назва) claude --model opus
--fallback-model Автоматичний фолбек (запасна модель) при перевантаженні claude -p --fallback-model sonnet "query"
--agent Вказати агента для сесії claude --agent my-custom-agent
--agents Визначити кастомних субагентів через JSON Див. Конфігурація агентів
--effort Встановити рівень зусиль (low, medium, high, max) claude --effort high

Приклади вибору моделі

# Opus 5.5 для складних завдань
claude --model opus "design a caching strategy"

# Haiku для швидких завдань (Haiku 5.5 в Anthropic API з v2.1.293; Haiku 4.5 у Bedrock, Vertex і Foundry)
claude --model haiku -p "format this JSON"

# Повна назва моделі
claude --model claude-sonnet-4-6 "review this code"

# З фолбеком для надійності
claude -p --model opus --fallback-model sonnet "analyze architecture"

# opusplan (Opus планує, Sonnet виконує)
claude --model opusplan "design and implement the caching layer"

Кастомізація системного промпта

Прапорець Опис Приклад
--system-prompt Замінити весь стандартний промпт claude --system-prompt "You are a Python expert"
--system-prompt-file Завантажити промпт з файлу, замінивши промпт за замовчуванням claude -p --system-prompt-file ./prompt.txt "query"
--append-system-prompt Додати до стандартного промпта claude --append-system-prompt "Always use TypeScript"

Приклади системного промпта

# Повністю кастомна персона
claude --system-prompt "You are a senior security engineer. Focus on vulnerabilities."

# Додавання конкретних інструкцій
claude --append-system-prompt "Always include unit tests with code examples"

# Завантаження складного промпта з файлу
claude -p --system-prompt-file ./prompts/code-reviewer.txt "review main.py"

Порівняння прапорців системного промпта

Прапорець Поведінка Інтерактивний Print
--system-prompt Замінює весь стандартний системний промпт ✅ ✅
--system-prompt-file Замінює промптом з файлу ✅ ✅
--append-system-prompt Додає до стандартного системного промпта ✅ ✅

Усі прапорці системного промпту працюють як в інтерактивному, так і в print-режимі (файлові форми — з v2.1.69). --system-prompt і --system-prompt-file замінюють промпт за замовчуванням; прапорці append додають до нього.

Управління інструментами та дозволами

Прапорець Опис Приклад
--tools Обмежити доступні вбудовані інструменти claude -p --tools "Bash,Edit,Read" "query"
--allowedTools Інструменти, що виконуються без запиту дозволу "Bash(git log:*)" "Read"
--disallowedTools Інструменти, видалені з контексту "Bash(rm:*)" "Edit"
--dangerously-skip-permissions Пропустити всі запити дозволів claude --dangerously-skip-permissions
--permission-mode Починати у вказаному режимі дозволів claude --permission-mode auto
--permission-prompt-tool MCP-інструмент для обробки дозволів claude -p --mcp-config ./mcp.json --permission-prompt-tool mcp__permissions__approve "query"
--enable-auto-mode Розблокувати auto permission mode claude --enable-auto-mode

Приклади дозволів

# Режим тільки для читання — код-рев'ю
claude --permission-mode plan "review this codebase"

# Обмеження до безпечних інструментів
claude --tools "Read,Grep,Glob" -p "find all TODO comments"

# Дозволити конкретні git-команди без запитів
claude --allowedTools "Bash(git status:*)" "Bash(git log:*)"

# Заблокувати небезпечні операції
claude --disallowedTools "Bash(rm -rf:*)" "Bash(git push --force:*)"

Вивід та формат

Прапорець Опис Опції Приклад
--output-format Формат виводу (print mode) text, json, stream-json claude -p --output-format json "query"
--input-format Формат вводу (print mode) text, stream-json claude -p --input-format stream-json
--verbose Увімкнути детальне логування claude --verbose
--include-partial-messages Включити потокові (streaming) події Потребує stream-json claude -p --output-format stream-json --include-partial-messages "query"
--json-schema Отримати валідований JSON за схемою claude -p --json-schema '{"type":"object"}' "query"
--max-budget-usd Максимальні витрати для print mode. Починаючи з v2.1.217, після досягнення ліміту також зупиняються фонові subagent-и, що виконуються, і забороняється запуск нових (раніше фонові агенти продовжували працювати після перевищення ліміту) claude -p --max-budget-usd 5.00 "query"

Приклади формату виводу

# Звичайний текст (за замовчуванням)
claude -p "explain this code"

# JSON для програмного використання
claude -p --output-format json "list all functions in main.py"

# Потоковий JSON для обробки в реальному часі
claude -p --output-format stream-json "generate a long report"

# Структурований вивід із валідацією за схемою
claude -p --json-schema '{"type":"object","properties":{"bugs":{"type":"array"}}}' \
  "find bugs in this code and return as JSON"

Робочий простір та каталог

Прапорець Опис Приклад
--add-dir Додати додаткові робочі каталоги claude --add-dir ../apps ../lib
--setting-sources Джерела налаштувань через кому claude --setting-sources user,project
--settings Завантажити налаштування з файлу або JSON claude --settings ./settings.json
--plugin-dir Завантажити плагіни з каталогу (повторюваний) claude --plugin-dir ./my-plugin

Приклад роботи з кількома каталогами

# Робота в кількох каталогах проєкту одночасно
claude --add-dir ../frontend ../backend ../shared "find all API endpoints"

# Завантаження кастомних налаштувань
claude --settings '{"model":"opus","verbose":true}' "complex task"

Конфігурація MCP

Прапорець Опис Приклад
--mcp-config Завантажити MCP-сервери з JSON claude --mcp-config ./mcp.json
--strict-mcp-config Використовувати тільки вказану MCP-конфігурацію claude --strict-mcp-config --mcp-config ./mcp.json
--channels Підписка на MCP channel plugins. Кожен запис має бути позначений як plugin:<name>@<marketplace>; голі імена відхиляються claude --channels plugin:discord@my-marketplace

Приклади MCP

# Завантаження GitHub MCP-сервера
claude --mcp-config ./github-mcp.json "list open PRs"

# Суворий режим — тільки вказані сервери
claude --strict-mcp-config --mcp-config ./production-mcp.json "deploy to staging"

Управління сесіями

Прапорець Опис Приклад
--session-id Використовувати конкретний ID сесії (UUID) claude --session-id "550e8400-..."
--fork-session Створити нову сесію при відновленні claude --resume abc123 --fork-session

Приклади сесій

# Продовжити останню розмову
claude -c

# Відновити іменовану сесію
claude -r "feature-auth" "continue implementing login"

# Форк сесії для експериментів
claude --resume feature-auth --fork-session "try alternative approach"

# Використання конкретного ID сесії
claude --session-id "550e8400-e29b-41d4-a716-446655440000" "continue"

Форк сесії

Створення відгалуження від існуючої сесії для експериментів:

# Форк сесії для альтернативного підходу
claude --resume abc123 --fork-session "try alternative implementation"

# Форк з кастомним повідомленням
claude -r "feature-auth" --fork-session "test with different architecture"

Випадки використання:

  • Спроба альтернативних реалізацій без втрати оригінальної сесії
  • Паралельне експериментування з різними підходами
  • Створення відгалужень від успішної роботи для варіацій
  • Тестування зламуючих змін (breaking changes) без впливу на основну сесію

Оригінальна сесія залишається без змін, а форк стає новою незалежною сесією.

Розширені функції

Прапорець Опис Приклад
--chrome Увімкнути інтеграцію з браузером Chrome claude --chrome
--no-chrome Вимкнути інтеграцію з Chrome claude --no-chrome
--ide Автопідключення до IDE, якщо доступна claude --ide
--max-turns Обмежити кількість агентних кроків (неінтерактивний режим) claude -p --max-turns 3 "query"
--debug Увімкнути режим налагодження з фільтрацією (фільтр діє лише у формі з =) claude --debug=api,mcp
--enable-lsp-logging Увімкнути детальне логування LSP claude --enable-lsp-logging
--betas Beta-заголовки для API-запитів claude --betas interleaved-thinking
--plugin-dir Завантажити плагіни з каталогу (повторюваний) claude --plugin-dir ./my-plugin
--enable-auto-mode Розблокувати auto permission mode claude --enable-auto-mode
--effort Встановити рівень зусиль мислення claude --effort high
--bare Мінімальний режим (без хуків, навичок, плагінів, MCP, auto memory, CLAUDE.md) claude --bare
--channels Підписка на MCP channel plugins (позначені як plugin:<name>@<marketplace>) claude --channels plugin:discord@my-marketplace
--tmux Створити tmux-сесію для worktree (потребує --worktree) claude --worktree feature-x --tmux
--fork-session Створити новий ID сесії при відновленні claude --resume abc --fork-session
--max-budget-usd Максимальні витрати (print mode); також зупиняє фонові subagent-и при досягненні ліміту (v2.1.217) claude -p --max-budget-usd 5.00 "query"
--json-schema Валідований JSON-вивід claude -p --json-schema '{"type":"object"}' "q"

Приклади розширених функцій

# Обмежити автономні дії
claude -p --max-turns 5 "refactor this module"

# Налагодження API-викликів
claude --debug=api "test query"

# Увімкнути інтеграцію з IDE
claude --ide "help me with this file"

Конфігурація агентів

Прапорець --agents приймає JSON-обʼєкт, що визначає кастомних субагентів для сесії.

Формат JSON для агентів

{
  "agent-name": {
    "description": "Обовʼязково: коли викликати цього агента",
    "prompt": "Обовʼязково: системний промпт для агента",
    "tools": ["Необовʼязково", "масив", "інструментів"],
    "model": "необовʼязково: sonnet|opus|haiku"
  }
}

Обовʼязкові поля:

  • description — опис природною мовою, коли використовувати цього агента
  • prompt — системний промпт, що визначає роль та поведінку агента

Необовʼязкові поля:

  • tools — масив доступних інструментів (якщо не вказано, успадковує всі)
    • Формат: ["Read", "Grep", "Glob", "Bash"]
  • model — модель: sonnet, opus або haiku

Повний приклад агентів

{
  "code-reviewer": {
    "description": "Expert code reviewer. Use proactively after code changes.",
    "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",
    "tools": ["Read", "Grep", "Glob", "Bash"],
    "model": "sonnet"
  },
  "debugger": {
    "description": "Debugging specialist for errors and test failures.",
    "prompt": "You are an expert debugger. Analyze errors, identify root causes, and provide fixes.",
    "tools": ["Read", "Edit", "Bash", "Grep"],
    "model": "opus"
  },
  "documenter": {
    "description": "Documentation specialist for generating guides.",
    "prompt": "You are a technical writer. Create clear, comprehensive documentation.",
    "tools": ["Read", "Write"],
    "model": "haiku"
  }
}

Приклади команд з агентами

# Визначення кастомних агентів інлайн
claude --agents '{
  "security-auditor": {
    "description": "Security specialist for vulnerability analysis",
    "prompt": "You are a security expert. Find vulnerabilities and suggest fixes.",
    "tools": ["Read", "Grep", "Glob"],
    "model": "opus"
  }
}' "audit this codebase for security issues"

# Завантаження агентів з файлу
claude --agents "$(cat ~/.claude/agents.json)" "review the auth module"

# Комбінація з іншими прапорцями
claude -p --agents "$(cat agents.json)" --model sonnet "analyze performance"

Пріоритет агентів

При наявності кількох визначень агентів вони завантажуються в такому порядку пріоритету:

  1. CLI-визначені (прапорець --agents) — для конкретної сесії
  2. Рівень користувача (~/.claude/agents/) — для всіх проєктів
  3. Рівень проєкту (.claude/agents/) — для поточного проєкту

CLI-визначені агенти перевизначають агентів рівня користувача та проєкту на час сесії.


Високоцінні сценарії використання

1. Інтеграція CI/CD

Використання Claude Code у CI/CD-пайплайнах (конвеєрах безперервної інтеграції/доставки) для автоматизованого код-рев'ю, тестування та документації.

Приклад GitHub Actions:

name: AI Code Review

on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Claude Code
        run: npm install -g @anthropic-ai/claude-code

      - name: Run Code Review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          claude -p --output-format json \
            --max-turns 5 \
            "Review the changes in this PR for:
            - Security vulnerabilities
            - Performance issues
            - Code quality
            Output as JSON with 'issues' array" > review.json

      - name: Post Review Comment
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = JSON.parse(fs.readFileSync('review.json', 'utf8'));
            // Обробка та публікація коментарів рев'ю

Пайплайн Jenkins:

pipeline {
    agent any
    stages {
        stage('AI Review') {
            steps {
                sh '''
                    claude -p --output-format json \
                      --max-turns 3 \
                      "Analyze test coverage and suggest missing tests" \
                      > coverage-analysis.json
                '''
            }
        }
    }
}

2. Pipe-обробка скриптів

Обробка файлів, журналів та даних через Claude для аналізу.

Аналіз журналів:

# Аналіз журналів помилок
tail -1000 /var/log/app/error.log | claude -p "summarize these errors and suggest fixes"

# Пошук патернів у журналах доступу
cat access.log | claude -p "identify suspicious access patterns"

# Аналіз git-історії
git log --oneline -50 | claude -p "summarize recent development activity"

Обробка коду:

# Рев'ю конкретного файлу
cat src/auth.ts | claude -p "review this authentication code for security issues"

# Генерація документації
cat src/api/*.ts | claude -p "generate API documentation in markdown"

# Пошук TODO та пріоритезація
grep -r "TODO" src/ | claude -p "prioritize these TODOs by importance"

3. Мультисесійні робочі процеси

Управління складними проєктами з кількома потоками розмов.

# Запуск сесії для гілки функції
claude -r "feature-auth" "let's implement user authentication"

# Пізніше — продовження сесії
claude -r "feature-auth" "add password reset functionality"

# Форк для альтернативного підходу
claude --resume feature-auth --fork-session "try OAuth instead"

# Переключення між різними сесіями функцій
claude -r "feature-payments" "continue with Stripe integration"

4. Кастомна конфігурація агентів

Визначення спеціалізованих агентів для робочих процесів вашої команди.

# Збереження конфігурації агентів у файл
cat > ~/.claude/agents.json << 'EOF'
{
  "reviewer": {
    "description": "Code reviewer for PR reviews",
    "prompt": "Review code for quality, security, and maintainability.",
    "model": "opus"
  },
  "documenter": {
    "description": "Documentation specialist",
    "prompt": "Generate clear, comprehensive documentation.",
    "model": "sonnet"
  },
  "refactorer": {
    "description": "Code refactoring expert",
    "prompt": "Suggest and implement clean code refactoring.",
    "tools": ["Read", "Edit", "Glob"]
  }
}
EOF

# Використання агентів у сесії
claude --agents "$(cat ~/.claude/agents.json)" "review the auth module"

5. Пакетна обробка

Обробка кількох запитів з однаковими налаштуваннями.

# Обробка кількох файлів
for file in src/*.ts; do
  echo "Processing $file..."
  claude -p --model haiku "summarize this file: $(cat $file)" >> summaries.md
done

# Пакетне код-рев'ю
find src -name "*.py" -exec sh -c '
  echo "## $1" >> review.md
  cat "$1" | claude -p "brief code review" >> review.md
' _ {} \;

# Генерація тестів для всіх модулів
for module in $(ls src/modules/); do
  claude -p "generate unit tests for src/modules/$module" > "tests/$module.test.ts"
done

6. Безпечна розробка

Використання контролю дозволів для безпечної роботи.

# Аудит безпеки тільки для читання
claude --permission-mode plan \
  --tools "Read,Grep,Glob" \
  "audit this codebase for security vulnerabilities"

# Блокування небезпечних команд
claude --disallowedTools "Bash(rm:*)" "Bash(curl:*)" "Bash(wget:*)" \
  "help me clean up this project"

# Обмежена автоматизація
claude -p --max-turns 2 \
  --allowedTools "Read" "Glob" \
  "find all hardcoded credentials"

7. JSON API інтеграція

Використання Claude як програмного API для ваших інструментів з парсингом через jq.

# Структурований аналіз
claude -p --output-format json \
  --json-schema '{"type":"object","properties":{"functions":{"type":"array"},"complexity":{"type":"string"}}}' \
  "analyze main.py and return function list with complexity rating"

# Інтеграція з jq для обробки (вивід за схемою потрапляє в .structured_output)
claude -p --output-format json \
  --json-schema '{"type":"object","properties":{"endpoints":{"type":"array"}}}' \
  "list all API endpoints" | jq '.structured_output.endpoints[]'

# Використання в скриптах
RESULT=$(claude -p --output-format json \
  --json-schema '{"type":"object","properties":{"secure":{"type":"boolean"},"issues":{"type":"array"}},"required":["secure","issues"]}' \
  "is this code secure?" < code.py)
if echo "$RESULT" | jq -e '.structured_output.secure == false' > /dev/null; then
  echo "Security issues found!"
  echo "$RESULT" | jq '.structured_output.issues[]'
fi

Приклади парсингу jq

Парсинг та обробка JSON-виводу Claude за допомогою jq. Текст відповіді міститься в .result; з --json-schema перевірений обʼєкт міститься в .structured_output ($SCHEMA нижче позначає схему, що визначає поля, які читає кожен фільтр):

# Витяг тексту відповіді
claude -p --output-format json "analyze this code" | jq -r '.result'

# Фільтрація елементів масиву
claude -p --output-format json --json-schema "$SCHEMA" "list issues" | jq -r '.structured_output.issues[] | select(.severity=="high")'

# Витяг кількох полів
claude -p --output-format json --json-schema "$SCHEMA" "describe the project" | jq -r '.structured_output | {name, version, description}'

# Конвертація в CSV
claude -p --output-format json --json-schema "$SCHEMA" "list functions" | jq -r '.structured_output.functions[] | [.name, .lineCount] | @csv'

# Умовна обробка
claude -p --output-format json --json-schema "$SCHEMA" "check security" | jq 'if (.structured_output.vulnerabilities | length) > 0 then "UNSAFE" else "SAFE" end'

# Витяг вкладених значень
claude -p --output-format json --json-schema "$SCHEMA" "analyze performance" | jq '.structured_output.metrics.cpu.usage'

# Обробка всього масиву
claude -p --output-format json --json-schema "$SCHEMA" "find todos" | jq '.structured_output.todos | length'

# Трансформація виводу
claude -p --output-format json --json-schema "$SCHEMA" "list improvements" | jq '.structured_output.improvements | map({title: .title, priority: .priority})'

Моделі

Claude Code підтримує кілька моделей з різними можливостями:

Модель ID Контекстне вікно Примітки
Opus 4.6 claude-opus-4-6 1M токенів Найпотужніша, адаптивні рівні зусиль
Sonnet 4.6 claude-sonnet-4-6 1M токенів Баланс швидкості та можливостей
Haiku 4.5 claude-haiku-4-5 200K токенів Найшвидша, оптимальна для швидких завдань

Вибір моделі

# Використання коротких назв
claude --model opus "complex architectural review"
claude --model sonnet "implement this feature"
claude --model haiku -p "format this JSON"

# Використання alias opusplan (Opus планує, Sonnet виконує)
claude --model opusplan "design and implement the API"

# Перемикання на швидкий режим під час сесії
/fast

Рівні зусиль (Opus 4.6)

Opus 4.6 підтримує адаптивне міркування з рівнями зусиль:

# Через прапорець CLI
claude --effort high "complex review"

# Через слеш-команду
/effort high

# Через змінну оточення
export CLAUDE_CODE_EFFORT_LEVEL=high   # low, medium, high, xhigh або max (залежно від моделі)

Ключове слово "ultrathink" у промптах активує глибоке міркування. Починаючи з v2.1.311, якщо ввести його в інтерактивному терміналі, воно також запускає цей хід із рівнем xhigh на Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2 (v2.1.321+) та Fable 5.1 через API Anthropic (слово підсвічується веселкою, коли це можливо; у VS Code — з v2.1.316), а CLAUDE_CODE_DISABLE_ULTRATHINK=1 (v2.1.316) вимикає його.


Ключові змінні оточення

Змінна Опис
ANTHROPIC_API_KEY API-ключ для автентифікації
ANTHROPIC_MODEL Перевизначення стандартної моделі
ANTHROPIC_CUSTOM_MODEL_OPTION Кастомна опція моделі для API
ANTHROPIC_DEFAULT_OPUS_MODEL Перевизначення стандартного ID моделі Opus
ANTHROPIC_DEFAULT_SONNET_MODEL Перевизначення стандартного ID моделі Sonnet
ANTHROPIC_DEFAULT_HAIKU_MODEL Перевизначення стандартного ID моделі Haiku
MAX_THINKING_TOKENS Бюджет токенів розширеного мислення
CLAUDE_CODE_EFFORT_LEVEL Рівень зусиль (low/medium/high/xhigh/max) — за замовчуванням medium на Fable 5.2, Opus 5.5, Sonnet 5.5 та Haiku 5.5, high на Fable 5.1, Fable 5, Opus 5, Sonnet 5 та Opus 4.8 (xhigh на Opus 4.7); xhigh потребує моделі Fable, Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5 або Opus 4.8/4.7; max працює на моделях Fable, Opus 5.5, Sonnet 5.5, Haiku 5.5, Opus 5, Sonnet 5, Opus 4.8/4.7/4.6 та Sonnet 4.6
CLAUDE_CODE_SIMPLE Мінімальний режим, встановлюється прапорцем --bare
CLAUDE_CODE_DISABLE_AUTO_MEMORY Встановіть 1, щоб вимкнути auto memory (файли auto memory не створюються і не завантажуються)
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS Вимкнути виконання фонових завдань
CLAUDE_CODE_DISABLE_CRON Вимкнути заплановані завдання в межах сесії (/loop, інструменти cron); хмарних запланованих завдань це не стосується
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS Вимкнути git-інструкції
CLAUDE_CODE_DISABLE_TERMINAL_TITLE Вимкнути оновлення заголовка терміналу
CLAUDE_CODE_DISABLE_1M_CONTEXT Вимкнути контекстне вікно 1M токенів
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK Вимкнути фолбек без стрімінгу
CLAUDE_CODE_ENABLE_TASKS Інструменти Task використовуються за замовчуванням; встановіть 0, щоб повернути застарілий інструмент TodoWrite
CLAUDE_CODE_TASK_LIST_ID Іменований каталог завдань, спільний між сесіями
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION Увімкнути/вимкнути пропозиції промптів (true/false)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS Увімкнути експериментальні Agent Teams
CLAUDE_CODE_NEW_INIT Використовувати новий потік ініціалізації
CLAUDE_CODE_SUBAGENT_MODEL Модель для виконання субагентів
CLAUDE_CODE_PLUGIN_SEED_DIR Каталог для seed-файлів плагінів
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB Змінні оточення для видалення з підпроцесів
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE Перевизначити відсоток автокомпакції
CLAUDE_STREAM_IDLE_TIMEOUT_MS Таймаут простою потоку в мілісекундах
SLASH_COMMAND_TOOL_CHAR_BUDGET Бюджет символів для інструментів слеш-команд
ENABLE_TOOL_SEARCH Увімкнути пошук інструментів
MAX_MCP_OUTPUT_TOKENS Максимум токенів для виводу MCP-інструмента

Швидкий довідник

Найпоширеніші команди

# Інтерактивна сесія
claude

# Швидке питання
claude -p "how do I..."

# Продовжити розмову
claude -c

# Обробити файл
cat file.py | claude -p "review this"

# JSON-вивід для скриптів
claude -p --output-format json "query"

Комбінації прапорців

Сценарій Команда
Швидке код-рев'ю cat file | claude -p "review"
Структурований вивід claude -p --output-format json "query"
Безпечне дослідження claude --permission-mode plan
Автономність з безпекою claude --enable-auto-mode --permission-mode auto
CI/CD інтеграція claude -p --max-turns 3 --output-format json
Відновлення роботи claude -r "session-name"
Кастомна модель claude --model opus "complex task"
Мінімальний режим claude --bare "quick query"
Ліміт бюджету claude -p --max-budget-usd 2.00 "analyze code"

Усунення несправностей

Команда не знайдена

Проблема: claude: command not found

Рішення:

  • Встановіть Claude Code: curl -fsSL https://claude.ai/install.sh | bash (нативний, рекомендовано) або npm install -g @anthropic-ai/claude-code
  • Перевірте, що PATH включає ~/.local/bin (нативне встановлення) або глобальний bin-каталог npm
  • Запустіть claude doctor

Проблеми з API-ключем

Проблема: Помилка автентифікації

Рішення:

  • Встановіть API-ключ: export ANTHROPIC_API_KEY=your-key
  • Перевірте валідність ключа та наявність достатнього балансу
  • Перевірте дозволи ключа для запитуваної моделі

Сесія не знайдена

Проблема: Неможливо відновити сесію

Рішення:

  • Перегляньте доступні сесії, щоб знайти правильну назву/ID
  • Сесії можуть закінчуватися після періоду неактивності
  • Використовуйте -c для продовження останньої сесії

Проблеми з форматом виводу

Проблема: JSON-вивід пошкоджений

Рішення:

  • Використовуйте --json-schema для примусового дотримання структури
  • Додайте явні інструкції щодо JSON у промпті
  • Використовуйте --output-format json (а не просто просіть JSON у промпті)

Відмова в дозволі

Проблема: Виконання інструменту заблоковане

Рішення:

  • Перевірте налаштування --permission-mode
  • Перегляньте прапорці --allowedTools та --disallowedTools
  • Використовуйте --dangerously-skip-permissions для автоматизації (з обережністю)

Додаткові ресурси


Частина серії посібників Claude How To


Останнє оновлення: 12 листопада 2026 Версія Claude Code: 2.1.322 Джерела: