Configuration
Clew is configured through CLI flags (Commander.js), environment variables, a JSON settings file (validated with Zod), and in-session slash commands.
CLI Flags
Defined in src/main.tsx with Commander.js .option() and .addOption():
| Flag | Description |
|---|---|
-p, --print | Print response and exit (useful for pipes). Skips workspace trust dialog. |
--bare | Minimal mode: skip hooks, LSP, plugins, attribution, auto-memory, keychain reads, CLEW.md discovery. Sets CLEW_CODE_SIMPLE=1. |
-d, --debug [filter] | Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file") |
--debug-file <path> | Write debug logs to a file |
--verbose | Override verbose mode setting from config |
--model <model> | Model for the current session (alias or full ID) |
--effort <level> | Effort level: low, medium, high, max |
--agent <agent> | Agent for the current session |
--permission-mode <mode> | Permission mode (default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk) |
--dangerously-skip-permissions | Bypass all permission checks (sandbox only) |
--allow-dangerously-skip-permissions | Enable bypass as an option without enabling by default |
--allowedTools, --allowed-tools | Comma/space-separated tool names to allow (e.g., "Bash(git:*) Edit") |
--disallowedTools, --disallowed-tools | Comma/space-separated tool names to deny |
--tools <tools...> | Specify available tools from built-in set |
--mcp-config <configs...> | Load MCP servers from JSON files or strings |
--strict-mcp-config | Only use MCP servers from --mcp-config |
--plugin-dir <path> | Load plugins from a directory (repeatable) |
--settings <file-or-json> | Path to a settings JSON file or JSON string |
--add-dir <directories...> | Additional directories to allow tool access |
--system-prompt <prompt> | Custom system prompt |
--system-prompt-file <file> | Read system prompt from a file |
--append-system-prompt <prompt> | Append to default system prompt |
--continue, -c | Continue the most recent conversation |
--resume, -r [value] | Resume a conversation by session ID or picker |
--fork-session | When resuming, create a new session ID |
--session-id <uuid> | Use a specific session ID |
--name, -n <name> | Display name for this session |
--agents <json> | JSON defining custom agents |
--output-format <format> | text, json, or stream-json (with --print) |
--input-format <format> | text or stream-json (with --print) |
--json-schema <schema> | JSON Schema for structured output validation |
--thinking <mode> | Thinking mode: enabled, adaptive, disabled |
--max-turns <turns> | Max agentic turns in non-interactive mode |
--max-budget-usd <amount> | Max API spend (print mode only) |
--fallback-model <model> | Fallback when primary model is overloaded |
--betas <betas...> | Beta headers for API requests |
--ide | Auto-connect to IDE on startup |
--chrome / --no-chrome | Enable/disable Claude in Chrome integration |
--computer | Enable Computer Use tool (Windows only) |
--no-session-persistence | Disable session save to disk (print mode only) |
--disable-slash-commands | Disable all skills |
--prefill <text> | Pre-fill prompt input without submitting |
--file <specs...> | Download file resources at startup |
Environment Variables
Provider API Keys
27 providers — set one or more. See Providers page for the full list.
Runtime & Feature Flags
| Variable | Purpose |
|---|---|
DEBUG | Debug logging with optional category filter |
NO_COLOR / FORCE_COLOR | Terminal color control |
BRIDGE_MODE=1 | Enable WebSocket bridge for remote control |
VOICE_MODE=1 | Enable voice mode |
KAIROS=1 | Enable proactive/brief/assistant features |
ENABLE_LSP_TOOL=1 | Enable LSP tool integration |
ENABLE_COMPUTER_USE=1 | Enable Computer Use tool (Windows) |
CLAUDECODE_NO_RESPAWN | Disable process respawn |
CODE_INDEX=1 | Enable fuzzy code search tool |
AGENT_TRIGGERS=1 | Enable autonomous scheduled task triggers |
SENTRY_DSN | Enable Sentry error reporting (opt-in) |
TAVILY_API_KEY | Tavily web search (highest priority) |
BRAVE_API_KEY | Brave web search |
SERPER_API_KEY | Serper web search |
SEARXNG_INSTANCE_URL | Self-hosted SearXNG URL |
Settings File
Config file at ~/.clew/settings.json (TypeBox-validated). Stores:
- Default provider and model
- Permission mode and rules
- Workspace directories
- Plugin and MCP server configs
- Theme and UI preferences
- Session persistence settings
Config Paths
| Path | Content |
|---|---|
~/.clew/settings.json | Main configuration (TypeBox schema) |
~/.clew/credentials/ | Stored credentials |
~/.clew/sessions/ | Session persistence |
~/.clew/logs/ | Debug and error logs |
~/.clew/skills/ | User-installed skills |
.clew/skills/ | Project-level skills |
In-Session Configuration
/config # Open config panel (aliases: settings)
/theme # Change the theme
/color # Set prompt bar color
/keybindings # Edit keybindings
/permissions # Manage permission rules
Build Configuration
Build via bun run build with compile-time feature defines:
# In src/main.tsx:
--define.TRANSCRIPT_CLASSIFIER=true # Enables auto permission mode
--define.CHICAGO_MCP=true # Enables Chicago MCP features
--define.VOICE_MODE=true # Enables voice input support