Skip to main content

Claude Code CLI

Claude Code CLI
Complete reference for the Claude Code CLI — installation, key commands, slash commands, dangerously-skip-permissions, yolo mode, and advanced usage patterns.

> AI content disclosure: AI assisted with the reference layout; installation methods, command flags, and permission terminology were checked against current official docs.

Further reading: Review Claude Code Plan Mode

The Claude Code CLI is Anthropic's terminal interface for interactive coding, scripted prompts, session management, worktrees, custom agents, and permission controls. Treat it as an agent with access to your local development environment, not as a chat box: the directory, credentials, tools, and approval mode determine its real authority.

Claude Code CLI Installation & Setup

Use the current installation path from Anthropic's setup documentation for your operating system. Older tutorials may still recommend a global npm package, while Anthropic has moved toward native installers and managed update flows. Verify the command on the official install page instead of copying a third-party curl pipe or package name.

After installation, open the repository, run claude, authenticate through the supported flow, and review the workspace trust prompt. Confirm the active directory and git status before authorizing changes. Put durable repository instructions in CLAUDE.md and keep secrets outside the file.

Key Commands Reference

GoalCommandNote
Start interactive sessionclaudeuses current working directory
Ask one non-interactive promptclaude -p "prompt"suitable for scripts with controlled output
Continue most recent sessionclaude --continueresumes in the current project context
Choose a saved sessionclaude --resumeopens the resume picker
Start in plan modeclaude --permission-mode planexplores without editing
Create isolated worktreeclaude --worktree task-namecreates separate files and branch
Add another directoryclaude --add-dir ../sharedgrants additional file access

Run claude --help and consult the official CLI reference together; the docs note that the help output may not list every supported flag.

Slash Commands Explained

Slash commands operate inside an interactive session. Common commands cover help, model selection, permissions, configuration, session history, context status, and plan requests. Availability can change by version and account, so use /help in the running client as the local source of truth.

Do not confuse slash commands with shell commands. A line beginning with / is interpreted by Claude Code; tool calls to Bash are separately permissioned. Custom commands and skills can extend the interface, but their instructions should be reviewed like code because they can direct tools and consume context.

Yolo Mode & dangerously-skip-permissions

“Yolo mode” is an informal community phrase. Claude Code's official permission mode is bypassPermissions, enabled at startup with --permission-mode bypassPermissions or the equivalent --dangerously-skip-permissions flag. The related --allow-dangerously-skip-permissions flag makes the mode available in the Shift+Tab cycle without activating it immediately.

Bypass mode removes normal approval protection and does not defend against prompt injection or unintended commands. Use it only in an isolated, disposable environment with least-privilege credentials, restricted network access, version-controlled files, and an explicit spending limit. Prefer plan, acceptEdits, or auto mode for normal local development.

Using the CLI in CI/CD Pipelines

Use non-interactive print mode with a narrowly scoped prompt and machine-readable output where supported. Pin the execution environment, provide only required repository and secret access, cap time and spend, and fail closed when validation is missing. Never let untrusted pull-request text grant unrestricted shell authority.

A safe pipeline separates generation from approval: run Claude in a sandbox, capture the proposed patch or report, execute deterministic tests, and require review before deployment. Automation should use API or supported authentication rules for the environment rather than copying a personal interactive session token.

CLI vs Desktop: When to Use Each

Choose the CLI for terminal-native work, scripting, remote environments, and precise flags. Choose Claude Desktop when graphical session management and desktop integrations matter. Both can work with the same code, but never point concurrent agents at the same writable checkout without isolation. Worktrees are the cleanest boundary for parallel editing.

In Verdent

Verdent is not a wrapper around the Claude Code CLI. It is a separate desktop and VS Code coding product with its own agents, permissions, models, and workspaces. Developers who prefer command-line scripting may favor Claude Code; teams that want a visual surface for multiple parallel worktrees can evaluate Verdent. Keep product accounts, billing, and configuration separate.

Sources: Claude Code CLI reference, Claude Code permission modes, Claude Code worktrees, Verdent quick start.

Frequently Asked Questions

What command starts Claude Code?

Run claude in the repository after installing and authenticating through Anthropic's supported setup flow.

Is yolo mode an official Claude Code mode?

No. It is an informal name. The official mode is bypassPermissions, which removes normal approval safeguards.

Can Claude Code CLI run in CI?

Yes, using non-interactive print mode and supported authentication, but it should run in a sandbox with narrow permissions, spend limits, and deterministic checks.

Does claude --help list every flag?

Not necessarily. The official CLI reference states that some available flags may not appear in the local help output.

Next Step

Compare Claude Code CLI with Verdent

If you prefer terminal-first scripting, Claude Code CLI may fit your workflow. If you want a visual coding workspace with parallel agents and worktrees, try Verdent next.