Skip to main content

CLI reference

Complete reference for the CSC command-line interface, including commands and flags.

CLI commands

You can start sessions, pipe content, resume conversations, and manage updates with these commands:

CommandDescriptionExample
cscStart interactive sessioncsc
csc "query"Start interactive session with initial promptcsc "explain this project"
csc -p "query"Query via SDK, then exitcsc -p "explain this function"
cat file | csc -p "query"Process piped contentcat logs.txt | csc -p "explain"
csc -cContinue most recent conversation in current directorycsc -c
csc -c -p "query"Continue via SDKcsc -c -p "Check for type errors"
csc -r "<session>" "query"Resume session by ID or namecsc -r "auth-refactor" "Finish this PR"
csc updateUpdate to latest versioncsc update
csc auth loginSign in to your Anthropic account. Use --email to pre-fill your email address, --sso to force SSO authentication, and --console to sign in with Anthropic Console for API usage billing instead of a Claude subscriptioncsc auth login --console
csc auth logoutLog out from your Anthropic accountcsc auth logout
csc auth statusShow authentication status as JSON. Use --text for human-readable output. Exits with code 0 if logged in, 1 if notcsc auth status
csc agentsList all configured subagents, grouped by sourcecsc agents
csc auto-mode defaultsPrint the built-in auto mode classifier rules as JSON. Use csc auto-mode config to see your effective config with settings appliedcsc auto-mode defaults > rules.json
csc mcpConfigure Model Context Protocol (MCP) serversSee the CSC MCP documentation.
csc pluginManage CSC plugins. Alias: csc plugins. See plugin reference for subcommandscsc plugin install code-review@claude-plugins-official
csc remote-controlStart a Remote Control server to control CSC from claude.ai or the Claude app. Runs in server mode (no local interactive session). See Server mode flagscsc remote-control --name "My Project"
csc setup-tokenGenerate a long-lived OAuth token for CI and scripts. Prints the token to the terminal without saving it. Requires a Claude subscription. See Generate a long-lived tokencsc setup-token

CLI flags

Customize CSC's behavior with these command-line flags. csc --help does not list every flag, so a flag's absence from --help does not mean it is unavailable.

FlagDescriptionExample
--add-dirAdd additional working directories for CSC to read and edit files. Grants file access; most .costrict/ configuration is not discovered from these directories. Validates each path exists as a directorycsc --add-dir ../apps ../lib
--agentSpecify an agent for the current session (overrides the agent setting)csc --agent my-custom-agent
--agentsDefine custom subagents dynamically via JSON. Uses the same field names as subagent frontmatter, plus a prompt field for the agent's instructionscsc --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'
--allow-dangerously-skip-permissionsAdd bypassPermissions to the Shift+Tab mode cycle without starting in it. Lets you begin in a different mode like plan and switch to bypassPermissions later. See permission modescsc --permission-mode plan --allow-dangerously-skip-permissions
--allowedToolsTools that execute without prompting for permission. See permission rule syntax for pattern matching. To restrict which tools are available, use --tools instead"Bash(git log *)" "Bash(git diff *)" "Read"
--append-system-promptAppend custom text to the end of the default system promptcsc --append-system-prompt "Always use TypeScript"
--append-system-prompt-fileLoad additional system prompt text from a file and append to the default promptcsc --append-system-prompt-file ./extra-rules.txt
--bareMinimal mode: skip auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and AGENTS.md so scripted calls start faster. CSC has access to Bash, file read, and file edit tools. Sets CLAUDE_CODE_SIMPLE. See bare modecsc --bare -p "query"
--betasBeta headers to include in API requests (API key users only)csc --betas interleaved-thinking
--channels(Research preview) MCP servers whose channel notifications CSC should listen for in this session. Space-separated list of plugin:<name>@<marketplace> entries. Requires claude.ai authenticationcsc --channels plugin:my-notifier@my-marketplace
--chromeEnable Chrome browser integration for web automation and testingcsc --chrome
--continue, -cLoad the most recent conversation in the current directorycsc --continue
--dangerously-load-development-channelsEnable channels that are not on the approved allowlist, for local development. Accepts plugin:<name>@<marketplace> and server:<name> entries. Prompts for confirmationcsc --dangerously-load-development-channels server:webhook
--dangerously-skip-permissionsSkip permission prompts. Equivalent to --permission-mode bypassPermissions. See permission modes for what this does and does not skipcsc --dangerously-skip-permissions
--debugEnable debug mode with optional category filtering (for example, "api,hooks" or "!statsig,!file")csc --debug "api,mcp"
--debug-file <path>Write debug logs to a specific file path. Implicitly enables debug mode. Takes precedence over CLAUDE_CODE_DEBUG_LOGS_DIRcsc --debug-file /tmp/claude-debug.log
--disable-slash-commandsDisable all skills and commands for this sessioncsc --disable-slash-commands
--disallowedToolsTools that are removed from the model's context and cannot be used"Bash(git log *)" "Bash(git diff *)" "Edit"
--effortSet the effort level for the current session. Options: low, medium, high, max (Opus 4.6 only). Session-scoped and does not persist to settingscsc --effort high
--exclude-dynamic-system-prompt-sectionsMove per-machine sections from the system prompt (working directory, environment info, memory paths, git status) into the first user message. Improves prompt-cache reuse across different users and machines running the same task. Only applies with the default system prompt; ignored when --system-prompt or --system-prompt-file is set. Use with -p for scripted, multi-user workloadscsc -p --exclude-dynamic-system-prompt-sections "query"
--fallback-modelEnable automatic fallback to specified model when default model is overloaded (print mode only)csc -p --fallback-model sonnet "query"
--fork-sessionWhen resuming, create a new session ID instead of reusing the original (use with --resume or --continue)csc --resume abc123 --fork-session
--from-prResume sessions linked to a specific GitHub PR. Accepts a PR number or URL. Sessions are automatically linked when created via gh pr createcsc --from-pr 123
--ideAutomatically connect to IDE on startup if exactly one valid IDE is availablecsc --ide
--initRun initialization hooks and start interactive modecsc --init
--init-onlyRun initialization hooks and exit (no interactive session)csc --init-only
--include-hook-eventsInclude all hook lifecycle events in the output stream. Requires --output-format stream-jsoncsc -p --output-format stream-json --include-hook-events "query"
--include-partial-messagesInclude partial streaming events in output. Requires --print and --output-format stream-jsoncsc -p --output-format stream-json --include-partial-messages "query"
--input-formatSpecify input format for print mode (options: text, stream-json)csc -p --output-format json --input-format stream-json
--json-schemaGet validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see structured outputs)csc -p --json-schema '{"type":"object","properties":{...}}' "query"
--maintenanceRun maintenance hooks and start interactive modecsc --maintenance
--max-budget-usdMaximum dollar amount to spend on API calls before stopping (print mode only)csc -p --max-budget-usd 5.00 "query"
--max-turnsLimit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by defaultcsc -p --max-turns 3 "query"
--mcp-configLoad MCP servers from JSON files or strings (space-separated)csc --mcp-config ./mcp.json
--modelSets the model for the current session with an alias for the latest model (sonnet or opus) or a model's full namecsc --model claude-sonnet-4-6
--name, -nSet a display name for the session, shown in /resume and the terminal title. You can resume a named session with csc --resume <name>. /rename changes the name mid-session and also shows it on the prompt barcsc -n "my-feature-work"
--no-chromeDisable Chrome browser integration for this sessioncsc --no-chrome
--no-session-persistenceDisable session persistence so sessions are not saved to disk and cannot be resumed (print mode only)csc -p --no-session-persistence "query"
--output-formatSpecify output format for print mode (options: text, json, stream-json)csc -p "query" --output-format json
--enable-auto-modeUnlock auto mode in the Shift+Tab cycle. Requires a Team, Enterprise, or API plan and Claude Sonnet 4.6 or Opus 4.6csc --enable-auto-mode
--permission-modeBegin in a specified permission mode. Accepts default, acceptEdits, plan, auto, dontAsk, or bypassPermissions. Overrides defaultMode from settings filescsc --permission-mode plan
--permission-prompt-toolSpecify an MCP tool to handle permission prompts in non-interactive modecsc -p --permission-prompt-tool mcp_auth_tool "query"
--plugin-dirLoad plugins from a directory for this session only. Each flag takes one path. Repeat the flag for multiple directories: --plugin-dir A --plugin-dir Bcsc --plugin-dir ./my-plugins
--print, -pPrint response without interactive mode (see Agent SDK documentation for programmatic usage details)csc -p "query"
--remoteCreate a new web session on claude.ai with the provided task descriptioncsc --remote "Fix the login bug"
--remote-control, --rcStart an interactive session with Remote Control enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the sessioncsc --remote-control "My Project"
--remote-control-session-name-prefix <prefix>Prefix for auto-generated Remote Control session names when no explicit name is set. Defaults to your machine's hostname, producing names like myhost-graceful-unicorn. Set CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX for the same effectcsc remote-control --remote-control-session-name-prefix dev-box
--replay-user-messagesRe-emit user messages from stdin back on stdout for acknowledgment. Requires --input-format stream-json and --output-format stream-jsoncsc -p --input-format stream-json --output-format stream-json --replay-user-messages
--resume, -rResume a specific session by ID or name, or show an interactive picker to choose a sessioncsc --resume auth-refactor
--session-idUse a specific session ID for the conversation (must be a valid UUID)csc --session-id "550e8400-e29b-41d4-a716-446655440000"
--setting-sourcesComma-separated list of setting sources to load (user, project, local)csc --setting-sources user,project
--settingsPath to a settings JSON file or a JSON string to load additional settings fromcsc --settings ./settings.json
--strict-mcp-configOnly use MCP servers from --mcp-config, ignoring all other MCP configurationscsc --strict-mcp-config --mcp-config ./mcp.json
--system-promptReplace the entire system prompt with custom textcsc --system-prompt "You are a Python expert"
--system-prompt-fileLoad system prompt from a file, replacing the default promptcsc --system-prompt-file ./custom-prompt.txt
--teleportResume a web session in your local terminalcsc --teleport
--teammate-modeSet how agent team teammates display: auto (default), in-process, or tmux. See Choose a display modecsc --teammate-mode in-process
--tmuxCreate a tmux session for the worktree. Requires --worktree. Uses iTerm2 native panes when available; pass --tmux=classic for traditional tmuxcsc -w feature-auth --tmux
--toolsRestrict which built-in tools CSC can use. Use "" to disable all, "default" for all, or tool names like "Bash,Edit,Read"csc --tools "Bash,Edit,Read"
--verboseEnable verbose logging, shows full turn-by-turn outputcsc --verbose
--version, -vOutput the version numbercsc -v
--worktree, -wStart CSC in an isolated git worktree at <repo>/.costrict/worktrees/<name>. If no name is given, one is auto-generatedcsc -w feature-auth

System prompt flags

CSC provides four flags for customizing the system prompt. All four work in both interactive and non-interactive modes.

FlagBehaviorExample
--system-promptReplaces the entire default promptcsc --system-prompt "You are a Python expert"
--system-prompt-fileReplaces with file contentscsc --system-prompt-file ./prompts/review.txt
--append-system-promptAppends to the default promptcsc --append-system-prompt "Always use TypeScript"
--append-system-prompt-fileAppends file contents to the default promptcsc --append-system-prompt-file ./style-rules.txt

--system-prompt and --system-prompt-file are mutually exclusive. The append flags can be combined with either replacement flag.

For most use cases, use an append flag. Appending preserves CSC's built-in capabilities while adding your requirements. Use a replacement flag only when you need complete control over the system prompt.