~/.craft-agent/. This includes workspaces, sessions, sources, credentials, and preferences.
Configuration Directory Structure
The main configuration directory is organized as follows:Main Configuration Files
config.json
The root configuration file manages global settings and workspace metadata:The
config.json file is loaded from packages/shared/src/config/storage.ts and supports multiple workspaces with separate configurations.credentials.enc
All sensitive credentials (API keys, OAuth tokens) are stored in an AES-256-GCM encrypted file:- Encryption: AES-256-GCM with a key derived from system-specific entropy
- Location:
~/.craft-agent/credentials.enc - Access: Managed through the
CredentialManagerclass inpackages/shared/src/credentials/ - Scope: Per-workspace and per-source credential isolation
preferences.json
User preferences control application behavior:Default Preferences
Default Preferences
apps/electron/resources/config-defaults.json.Workspace Configuration
Each workspace has its own isolated configuration directory at~/.craft-agent/workspaces/{workspace-id}/.
Workspace config.json
Permission Modes
Workspaces support three permission modes:Explore mode - Read-only, blocks all write operations
Ask to Edit mode - Prompts for approval on write operations
Auto mode - Auto-approves all commands (use with caution)
Press SHIFT+TAB in the chat interface to cycle through permission modes.
Theme Configuration
Themes cascade from app-level to workspace-level:packages/shared/src/config/theme.ts.
Sources Configuration
Sources (MCP servers, APIs, local filesystems) are stored per-workspace:Example Source Config
Example Source Config
credential: are resolved from the encrypted store.Session Storage
Sessions are persisted as JSONL files:- Location:
~/.craft-agent/workspaces/{id}/sessions/{session-id}.jsonl - Format: One JSON object per line (append-only)
- Persistence: Debounced writes with 500ms queue (see
packages/shared/src/sessions/persistence-queue.ts)
Configuration File Watching
Craft Agents watches configuration files for live updates:config.json- Global and workspace settingstheme.json- App and workspace themespermissions.json- Permission rulessources/*/config.json- Source configurations
packages/shared/src/config/watcher.ts and apps/electron/src/main/lib/config-watcher.ts.
Related Files
Storage Implementation
View the configuration storage code
Credentials Manager
See how credentials are encrypted and managed