Configuration
Config file location
Cortask stores its data in ~/.cortask/ (or the path set by the CORTASK_DATA_DIR environment variable). The main config file is:
~/.cortask/config.yaml
YAML is the default format. JSON is also supported -- just name the file config.json instead.
Environment variable substitution
You can reference environment variables anywhere in the config file using ${VAR_NAME} syntax:
server:
port: ${CORTASK_PORT}
If the variable is not set, it resolves to an empty string.
Config sections
providers
Choose the default LLM provider and optionally set a model override per provider.
providers:
default: anthropic
anthropic:
model: claude-sonnet-4-5-20250929
openai:
model: gpt-4o
google:
model: gemini-2.0-flash-exp
Supported providers: anthropic, openai, google, moonshot, grok, openrouter, minimax, ollama.
agent
Controls the agent runner behaviour.
agent:
maxTurns: 25 # 1--200, default 25
temperature: 0.7 # 0--2, default 0.7
maxTokens: 4096 # optional, positive integer
server
server:
port: 3777 # 1--65535, default 3777
host: 127.0.0.1 # default 127.0.0.1
spending
Optional guardrails for token and cost usage.
spending:
enabled: true
maxTokens: 1000000
maxCostUsd: 20.00
period: monthly # daily | weekly | monthly
memory
Configure the embedding backend for memory features.
memory:
embeddingProvider: local # local | openai | google | ollama
embeddingModel: "" # optional, provider-specific model name
skills
Add custom skill directories in addition to the built-in skills/ folder.
skills:
dirs:
- /home/me/my-skills
workspace
workspace:
defaultDir: /home/me/projects
Credential store
API keys and other secrets are kept in an encrypted credential store at ~/.cortask/credentials.json, not in the config file.
Master key
On first run, Cortask generates a random master key at ~/.cortask/master.key (file permissions 0600). All credentials are encrypted with AES-256-GCM using a key derived from this master key via scrypt.
You can supply your own master key through the CORTASK_SECRET environment variable instead of using the generated file.
Setting provider API keys
The easiest way to add an API key is through the onboarding wizard in the UI. You can also use the CLI:
cortask config set-key anthropic sk-ant-...
Keys are stored under namespaced entries like provider.anthropic inside the encrypted store.