Type: docs Syncs the tutorial, its translations and root docs to **Claude Code 2.1.322** (previous sync: v2.1.316, #230). The audit covered every changelog entry for 2.1.317, 2.1.318, 2.1.319, 2.1.321 and 2.1.322, plus the official docs pages for each affected feature. npm `latest` is 2.1.322. 49 files changed (46 in the sync commit, plus `fa/` and `ko/03-skills` in review round 1 and `ko/claude_concepts_guide.md` in round 3). P0 0 · P1 15 · P2 6 (deferred) · P3 30 + 1 blocked · P4 3. ## P1: outdated claims (mirrored to translations) - **Fable 5.2 (v2.1.321).** The `10-cli` model table gains a Fable 5.2 row (1M context, default effort `medium`), and Fable 5.1 becomes the previous model. - The Fable alias note now says `fable` resolves to Fable 5.2 (Fable 5 in Claude apps gateway sessions). - `best` now resolves to the same model as `opus`. - A saved `claude-fable-5-1` pick moves to `fable` on Pro/Max/Ultra, and on Team/Enterprise when the organization's settings allow. - Pricing: $8/$40 per Mtok, with $0.20 per Mtok cache reads. - The FAQ and QUICK_REFERENCE model lists name Fable 5.2. - **Fast mode on Fable 5.2 (v2.1.321, $16/$80):** added to `/fast` in `01-slash-commands`, CATALOG, the `10-cli` fast-mode note and the `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE` row. - **`ultrathink`** now lists Fable 5.2 in `09`, `10-cli` and `claude_concepts_guide`. - **Scheduled tasks (`09`)**: - Recurring tasks expire after 7 days, not 3. - Tasks are restored on `--resume`/`--continue`, except expired tasks, past-due one-shots and a self-paced `/loop`. - Recurring jitter is "up to half the gap, at most 30 min" (`*/5` isn't delayed). - One-shots scheduled for `:00`/`:30` run up to 90 s early. - **Subagent and teammate effort (v2.1.317):** on a different model they use that model's saved effort or its default, not the session's (`04-subagents`, `10-cli`). - **`switchModelsOnFlag` (v2.1.318):** subagents never pause. With "Ask each time", a flagged subagent request fails instead of switching models. - **Background commands:** the default limit is 10 minutes in a `-p` run whose prompt is passed as text (the fix is in v2.1.321). - **Mods Claude writes (v2.1.321):** in `auto`/`bypassPermissions` they turn on without asking. They don't load in `dontAsk` or in `-p` outside those modes. ## P3: additions (English only) - **`01-slash-commands`:** - `/model` "More models" row (v2.1.319/321). - `/context` sends Claude only the table. - `/ide` no longer installs the extension from an IDE terminal (v2.1.318). - `/tasks` "Earlier in this session". - `/claude-api latency-optimize`, also added in `03-skills`, CATALOG and the concepts guide. - **`03-skills`:** two new limits on nested-skill loading: under the Bash sandbox (v2.1.319), and `.claude/skills` inside `~/.claude/plugins` (v2.1.321). The skills docs page doesn't list these exceptions yet; the source is the changelog. - **`04-subagents`:** background subagents move a shell command to the background after 3 min, and `SendMessage` reaches a busy background agent sooner. - **`06-hooks`:** - Agent SDK `onFailure: "block"` / `on_failure="block"`. - An `mcp_tool` hook refuses the call when it can't read the answer (>16 MiB). - `defer` works only with a single tool call; `tool_deferred_unavailable` and `CLAUDE_CODE_DROP_UNAVAILABLE_DEFERRED_TOOL`. - PostToolUse runs after a `Ctrl+Enter` interrupt (10 s). - **`07-plugins`:** - `$.model.fork` `effort` and `prompt.submit` in the user turn. - `${CLAUDE_PLUGIN_ROOT}` in `subagentStatusLine`. - Plugin updates install new dependencies. - Managed `extraKnownMarketplaces` take-over rules. - **`08-checkpoints`:** `/rewind` after `/branch` (fixed in v2.1.319). - **`09-advanced-features`:** - `/tasks` row. - Background command notifications show only the start and end of a command over 1,000 characters. - `claude remote-control --settings <file>`, and sessions keep their folder. - OTel `anthropic.plan`, `anthropic.seat_type`, `anthropic.provider`, `anthropic.custom_base_url`. - Three v2.1.319 trust-hardening items. - Auto-mode `-p` exits 1 when no safety check was available. - Monitor WebSocket watches follow Bash rules. - **`10-cli`:** - Fast mode on Google Cloud's Agent Platform: Fable 5.2 only, regions `global`/`us`/`eu`, v2.1.322. - `claude auth status` `loginExpiresAt`. - `claude -p` `credential_expires_at` and the 10-day stderr warning. - Bash permission hardening: `which` with flags, `timeout` wrappers, exact ask vs. broader deny, `cp`/`mv` by path. - Agent view `--agent` dispatch default. - `MCP_PROTOCOL_NEGOTIATION` 7-day skip. - New rows for `CLAUDE_CODE_DISABLE_FEATURE_FLAGS`, `CLAUDE_CODE_DISABLE_NESTED_SESSION_ID` and `permissions.denyInsteadOfPrompting`. ## P4: cosmetic - Root `README.md`: the version badge, "latest" line and "Current version" line now say v2.1.322 / November 2026. - `10-cli`: the resume hint repeats launch flags (v2.1.317). - `08-checkpoints`: directory symlinks are no longer followed by rewind (v2.1.319). Every file the sync commit changed has a refreshed footer: November 12, 2026 and 2.1.322, with localized labels and dates in translations. `fa/03-skills` and `ko/03-skills` got only the S1 `effort` row fix in round 1, and their footers were left as they were (2.1.316 and 2.1.310), because the rest of those files was not synced to 2.1.322. For the same reason, `ko/claude_concepts_guide.md` got only the round-3 Fable rows and keeps its 2.1.310 footer. ## Translation coverage - **vi, ko, fa:** carry every P1 change whose text exists in that locale. - **ja, uk:** carry the P1 changes to the sections they have: `ultrathink`, scheduled tasks, the `effort` row and QUICK_REFERENCE; the README FAQ in ja and uk. - **zh:** condensed. Only the stale model lists were fixed (README FAQ, QUICK_REFERENCE). zh has no model table, fast-mode note, scheduled-tasks section or `effort` row. - **`vi/README.md`:** has no FAQ, so Task 2.9 had nothing to change there. - **ko is partly stale from before this run.** Its module footers were still at 2.1.310, and some 2.1.316 content is missing, such as the `CLAUDE_CODE_SUBAGENT_EFFORT` sentence and `env` row. This PR adds the 2.1.322 P1 changes but does not backfill 2.1.316. - **Locale README stamps:** the ko and fa READMEs still show v2.1.310 in their badge and "latest" lines. Each locale tracks its own sync state, so they were left as they are. - **P3 additions are English only.** ## Review round 1 fixes (`docs: address review of v2.1.322 sync`) Each change was checked again against model-config, env-vars, skills or the raw changelog before it was written. - **S1:** the `03-skills` `effort` row and the `01` `/effort` row now list Fable 5.2, and give it a `medium` default. The `/effort` row also gives `high` for Fable 5.1 and Fable 5 (model-config: "Fable 5.2, Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`… Other models in the effort levels table default to `high`"). Also changed in fa and ko. - **S2:** `09` `remote-control --settings`: "If the file changes, no new session starts until you restart `claude remote-control`" (CL 2.1.321). English only. - **S3:** the `10-cli` `claude agents` note now names the five flags from CL 2.1.321. English only. - **S4:** the `03-skills` nested-skill exceptions are now attributed to the changelog in the text: "The changelog adds two exceptions that the skills docs don't list yet". English only. - **S5:** the `CLAUDE_CODE_DISABLE_FEATURE_FLAGS` row now says that with the variable set, Remote Control and the other features that need feature-flag fetching are unavailable (env-vars). English only. - **S7:** wrong effort claims removed from sentences this PR rewrote: - `ja/09` and `uk/09` now translate the English effort-level, `xhigh` and default lists. - In `ja/10-cli` and `uk/10-cli`, the false "`max` is exclusive to Opus 4.x" clause is dropped. The English sentence has no such clause. - **N1:** "from v2.1.257 until v2.1.321" in `10-cli`, fa, ko and vi. - **N2:** the `/context` row now says the 10-row limit applies to the table Claude reads. No locale has this row text. - **N4:** the Fable models were added to the `09` effort-level, `xhigh` and default lists in en, fa, ko and vi (ja and uk via S7). In `claude_concepts_guide`, Fable 5.2, 5.1 and 5 rows were added to the model/effort table, and the Fable models to its `xhigh`/`max` note, in en and fa. - **N5:** the `CLAUDE_CODE_SUBAGENT_EFFORT` row now says only what CL 2.1.317 says: a subagent on a different model from the main conversation uses that model's saved effort level or its default, instead of the session's. The old wording said such a subagent "never inherits". How the variable ranks against that rule isn't stated by any source. Also changed in fa and vi; ko has no row. - **N8:** "where Fable is available" was restored to the pre-v2.1.321 `best` behaviour, in en, fa, ko and vi. ## Review round 2 fixes (`docs: add Fable models to the effort-level bullet in 09`) - Added the Fable models to the `09` "Opus 5 / Opus 4.8" effort bullet (en, fa, ko, vi): Fable 5.2 defaults to `medium`, Fable 5.1 and Fable 5 to `high`, and all of them support `xhigh` and `max`. - Added the Fable models to the en `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row. ## Review round 3 fixes (`docs: align model and effort lists with model-config (v2.1.322 sync)`) The model and effort lists changed in this round now match model-config.md (effort table, default-effort rule and 1M list, re-fetched before editing). The lists still behind are under Follow-ups. - **en (R2-S1):** the Fable models were added to the remaining `09` effort lists (the "Effort level" heading line and three `CLAUDE_CODE_EFFORT_LEVEL` code comments) and to the `10-cli` "Effort Levels" paragraph and its code comment. The paragraph now gives Fable 5.2 a `medium` default, matching the model table above it. - **fa, ko, vi (R2-S1, R2-S2):** mirrored the same lines, and brought the `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row in line with en. `ko/claude_concepts_guide.md` gains the Fable 5.2, 5.1 and 5 rows, and its `xhigh`/`max` note names the Fable models, as in en and fa. - **ja, uk (R2-S2, R2-S3):** removed the false "`xhigh` is Opus 4.7-only" and "`max` is Opus 4.7/4.6-only" claims from `09` and `10-cli`. The support and `xhigh` lists now match model-config, and the model lists in the `CLAUDE_CODE_EFFORT_LEVEL` row are translated from en. - **ja, uk `04-subagents` (R2-S4):** the `effort` row and the frontmatter comment now list `xhigh`. - **Haiku 4.5 context (R2-N2, factual part only):** `uk/10-cli` listed Haiku 4.5 at 1M tokens. It's now 200K, matching en `10-cli` and model-config's 1M list, which doesn't include Haiku 4.5. The same cell in `ja/10-cli` was fixed too. - Merged `main` (#246, scripts only). ## Learner skills No changes landed. Three edits are pending because writes to `.claude/skills/**` were refused by the permission system in this run: - `lesson-quiz` `question-bank.md` Lesson 09 Q5 explanation: add Fable 5.2 to the `ultrathink` model list (P1). - `self-assessment` `topic-recommendations.md` and its `SKILL.md` mirror, Advanced Features focus line: same change (P1). - Lesson 04 Q10 explanation: optional `/tasks` "Earlier in this session" note (P3). No correct answer letter changes, and all 100 `Review` pointers still resolve. Exact text for the follow-up (from the round-1 review, §6): 1. `.claude/skills/lesson-quiz/references/question-bank.md:718` (Lesson 09 Q5, Explanation): - old: ``Since v2.1.311, typed in the interactive terminal on Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.1 through Anthropic's API, it also runs that turn at `xhigh` effort,`` - new: ``Since v2.1.311, typed in the interactive terminal on Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2 (v2.1.321+), or Fable 5.1 through Anthropic's API, it also runs that turn at `xhigh` effort,`` 2. `.claude/skills/self-assessment/SKILL.md:351` **and** `.claude/skills/self-assessment/references/topic-recommendations.md:73` (identical lines): - old: ``and the `ultrathink` keyword, which runs that turn at `xhigh` effort on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 (v2.1.311+)`` - new: ``and the `ultrathink` keyword, which runs that turn at `xhigh` effort on Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, and Fable 5.1 (v2.1.311+; Fable 5.2 needs v2.1.321+)`` 3. Version bumps: `lesson-quiz/SKILL.md` `version: 1.6.4` → `1.6.5`; `self-assessment/SKILL.md` `version: 2.5.7` → `2.5.8`. 4. Footer stamps: `question-bank.md` and `topic-recommendations.md`, 2.1.316 → 2.1.322. Optionally add `https://code.claude.com/docs/en/model-config#use-ultrathink-for-one-off-deep-reasoning` to Sources; it is already listed in both. 5. Optional (P3): Lesson 04 Q10 explanation, a note on the `/tasks` "Earlier in this session" row. It changes no letter. ## Needs maintainer decision (P2, not applied) 1. **Self-paced `/loop` ending.** - Repo: says nothing about how a no-interval `/loop` ends. - Docs: "If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later". - Changelog 2.1.319: self-paced `/loop` now ends "instead of scheduling a fallback wakeup; set `CLAUDE_CODE_LOOP_KEEPALIVE=1` to keep the old behavior". - https://code.claude.com/docs/en/scheduled-tasks#stop-a-loop 2. **Auto mode with telemetry or feature flags off.** - Repo (`10-cli` `CLAUDE_CODE_AUTO_MODE_SERVER` row, `09`): "Set to `0` to use Claude Code's own auto-mode classifier requests instead of server-side review". - Docs: when the review is dropped, "Claude Code falls back to its own classifier requests". - Changelog 2.1.319: calls the server can't check "are asked about or denied, with no fallback to the built-in classifier". - https://code.claude.com/docs/en/permission-modes#server-side-classifier-review 3. **MCP tasks.** - Repo (`05-mcp`): public beta since v2.1.304, needs feature-flag fetching (not Bedrock, Vertex, Foundry or telemetry off). - Docs: same. - Changelog 2.1.319: terminal support moves tasks to the background, works without feature-flag fetching, and adds `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` and `CLAUDE_CODE_DISABLE_MCP_TASKS`. The second variable is only in the changelog. - https://code.claude.com/docs/en/mcp#mcp-tasks-that-run-on-the-server 4. **`deniedMcpServers` URL entries.** - Repo (`05-mcp`): "`serverUrl` | A remote server URL, exact or with `*` wildcards". - Changelog 2.1.318: URL entries also block Anthropic-provided servers and cloud-session connectors. - Docs: "a `serverUrl` pattern written for the connector's own URL doesn't match it". - https://code.claude.com/docs/en/mcp#how-connectors-reach-claude-code 5. **`CLAUDE_CODE_PLUGIN_DIR_WATCH`.** - Repo (`07-plugins`): has only a generic hot-reload note. - Changelog 2.1.321: headless sessions now reload `.claude/skills` mods, and `=0` turns this off. - Docs: reloading covers `--plugin-dir` mods, is on in interactive sessions, and "Set to `1` to turn it on in non-interactive sessions". - https://code.claude.com/docs/en/env-vars#variables 6. **Mods' own tool calls.** - Repo (`07-plugins`): says nothing about prompting. - Changelog 2.1.321: `$.tool.call` and `$.mcp.call` "raise no permission prompt, even under your own ask rules". - Docs: "`$.mcp.call` | Calls a tool on a connected MCP server, under the session's permission rules". - https://code.claude.com/docs/en/plugins/mods/admin#review-what-a-mod-can-do ## Follow-ups (separate PRs) - **Stamps only (review N3 + N6):** add Fable 5.2 to the "Compatible Models" footers (88 lines; root files still list Fable 5.1 as newest, and module files lack Opus 5.5, Sonnet 5.5 and Haiku 5.5). Align the locale README badges and "latest" lines: ja 2.1.119, zh and uk 2.1.112, ko and fa 2.1.310. - **ko catch-up sync (review N7):** backfill 2.1.316 in ko: the Opus 4.8 fast-mode deprecation, the `CLAUDE_CODE_SUBAGENT_EFFORT` sentence and row, and the v2.1.311 `ultrathink` model list. - **Learner skills (review S6):** apply the exact text under "Learner skills" above once `.claude/skills/**` is writable. - **"Effort Levels (…)" headings (review R2-N1):** `10-cli` and its locale copies name only some models in the heading. They were left unchanged because renaming them changes the anchors. - **Opus 4.6 row (R2-N4):** `claude_concepts_guide.md` (and fa, ko) has no Opus 4.6 row, but the note below the table mentions it. The Sonnet 4.6 row's "1M tokens" also needs the `[1m]`-variant qualifier. - **`high`-default lists (R2-N5):** the `01` `/effort` row and the `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row (and their locale copies) leave Opus 4.6 and Sonnet 4.6 out of the `high` default. - **ja/uk/zh/vi effort catch-up (R2-N6):** the `/effort` rows in `ja/01`, `uk/01`, `zh/01` and `vi/01` still say `max` needs Opus 4.7 or Opus 4.6. `ja/claude_concepts_guide.md:3061` has an Opus 4.7-era table. - **uk/ja `10-cli` model tables (rest of R2-N2):** `uk/10-cli` `--effort` lacks `xhigh`, its model table is Opus 4.6-era (and Opus 4.6 / Sonnet 4.6 reach 1M only through `[1m]`), and it says "Opus 4.6 підтримує…". The `ja/10-cli` model table is Opus 4.7-era. - **`06-hooks` context-limit comment:** the `CONTEXT_LIMIT` comment's 1M list leaves out the Fable models and Opus 4.7, and lists Sonnet 4.6, which reaches 1M only through `[1m]` (also in fa, ko and vi). This predates the PR. - **ja/uk stale model lists:** `ja/09:228` and `uk/09:220` ("all models (Opus 4.7/4.6, Sonnet 4.6, Haiku 4.5)"), and `ja/10-cli:717-719` (the "Opus 4.7" heading and paragraph, the counterpart of en `10-cli:853`). In ja and uk, the 2.1.322 stamp covers the sections those files have; these older lists are tracked here. ## Validation `pre-commit run --all-files` passes: markdown-lint, cross-references, link-check (247 URLs) and markdown-rendering in all five hooked languages, plus the Python checks. The Mermaid hooks were skipped with `SKIP=mermaid,vietnamese-mermaid,japanese-mermaid,korean-mermaid,persian-mermaid` because their `language: node` environment fails to install under pre-commit 4.7.0. `python scripts/check_mermaid.py --strict` was run directly instead: Pele rendered all 416 blocks. The pre-edit baseline was also all green. For the round-1 fixes, `pre-commit run --files` on the 20 changed files passes, with the same Mermaid SKIP; the `language: node` install error was reproduced. `check_mermaid.py --strict` (416 blocks) and `check_cross_references.py` (675 files) also pass. For round 3, pre-commit on the 15 changed files passes, with the same Mermaid SKIP. `check_cross_references.py` (676 files after the merge), `check_mermaid.py --strict` (416 blocks) and `pytest scripts/tests/` (234 passed, after merging #246) also pass. ## Sources - https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md (2.1.317–2.1.322) and https://code.claude.com/docs/en/changelog - https://www.npmjs.com/package/@anthropic-ai/claude-code - https://code.claude.com/docs/en/model-config - https://code.claude.com/docs/en/fast-mode - https://code.claude.com/docs/en/scheduled-tasks - https://code.claude.com/docs/en/remote-control - https://code.claude.com/docs/en/errors - https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting - https://code.claude.com/docs/en/env-vars - https://code.claude.com/docs/en/hooks - https://code.claude.com/docs/en/agent-sdk/hooks - https://code.claude.com/docs/en/tools-reference - https://code.claude.com/docs/en/plugins/mods/create - https://code.claude.com/docs/en/plugins/org - https://code.claude.com/docs/en/skills - https://code.claude.com/docs/en/commands - https://code.claude.com/docs/en/vs-code - https://code.claude.com/docs/en/agent-view - https://code.claude.com/docs/en/mcp - https://code.claude.com/docs/en/permissions - https://code.claude.com/docs/en/permission-modes - https://code.claude.com/docs/en/cli-reference
Довідник 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"
Порівняння прапорців системного промпта
| Прапорець | Поведінка | Інтерактивний | |
|---|---|---|---|
--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"
Пріоритет агентів
При наявності кількох визначень агентів вони завантажуються в такому порядку пріоритету:
- CLI-визначені (прапорець
--agents) — для конкретної сесії - Рівень користувача (
~/.claude/agents/) — для всіх проєктів - Рівень проєкту (
.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для автоматизації (з обережністю)
Додаткові ресурси
- Офіційний довідник CLI — повний довідник команд
- Документація Headless Mode — автоматизоване виконання
- Слеш-команди — кастомні ярлики в Claude
- Посібник з памʼяті — постійний контекст через CLAUDE.md
- Протокол MCP — інтеграція зовнішніх інструментів
- Розширені функції — режим планування, розширене мислення
- Посібник субагентів — делеговане виконання завдань
Частина серії посібників Claude How To
Останнє оновлення: 12 листопада 2026 Версія Claude Code: 2.1.322 Джерела:
- https://code.claude.com/docs/en/agent-sdk/agent-loop#turns-and-messages
- https://code.claude.com/docs/en/model-config#use-ultrathink-for-one-off-deep-reasoning
- https://code.claude.com/docs/en/changelog#2-1-316
- https://code.claude.com/docs/en/cli-reference
- https://code.claude.com/docs/en/headless
- https://code.claude.com/docs/en/env-vars
- https://platform.claude.com/docs/en/about-claude/models/overview
- https://code.claude.com/docs/en/model-config
- https://code.claude.com/docs/en/remote-control
- https://code.claude.com/docs/en/setup
- https://code.claude.com/docs/en/troubleshoot-install#command-not-found-claude-after-installation
- https://code.claude.com/docs/en/cli-reference#cli-flags
- https://code.claude.com/docs/en/env-vars#variables
- https://code.claude.com/docs/en/scheduled-tasks
- https://code.claude.com/docs/en/model-config#adjust-effort-level Сумісні моделі: Claude Fable 5, Claude Opus 5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5