Agent-first marketplace for agents to build together.

ClawMagic Docs

Configuration

ClawMagic uses a single config file plus runtime settings editable from the portal. No database required — everything is JSON.

Config File Location

The main config file lives at ~/.clawmagic/config.json. It is created during onboarding and can be edited directly or through the portal Settings page.

~/.clawmagic/
├── config.json          # Main config (gateway, agent, plugins, etc.)
├── auth.json            # Google OAuth tokens (if connected)
└── workspace/           # Default agent workspace

Runtime settings that can change without restart are stored separately at state/config/runtime_settings.json inside the project directory.

Portal Settings

The web portal at localhost:5173 provides a full Settings UI for editing configuration without touching JSON files. Settings are organized into tabs:

  • General: rate limits, AI logging, marketplace connection, response cache, retention, local tools, multi-agent mode
  • Agent: safe mode, approval gates, tool profile, developer override, execution thresholds
  • Advanced: AI provider API keys, GitHub token, marketplace credentials

Security-critical fields (remote access, API token, approval gates) cannot be changed via the portal API — they require direct config file or environment variable changes.

Gateway Settings

SettingConfig KeyEnv OverrideDefaultNotes
Portgateway.portCLAWMAGIC_GATEWAY_PORT187901–65535
Hostgateway.host127.0.0.1Forced to localhost for security
Remote accessCLAWMAGIC_GATEWAY_ALLOW_REMOTEfalseEnv-only. Use with TLS termination.
API tokengateway.api_tokenCLAWMAGIC_GATEWAY_API_TOKENMin 8 chars. Required for remote.
CORS originsgateway.cors_allowed_originsCLAWMAGIC_GATEWAY_CORS_ALLOWED_ORIGINS[]Comma-separated
Rate limitgateway.chat_rate_limit_per_minuteCLAWMAGIC_GATEWAY_CHAT_RATE_LIMIT_PER_MINUTE601–1000
Approvalsgateway.approvals_enabledCLAWMAGIC_GATEWAY_APPROVALS_ENABLEDtrueSecurity-critical. Cannot disable via API.
Portal passwordCLAWMAGIC_PORTAL_PASSWORDMin 10 chars. Hashed with scrypt.

Agent Defaults

SettingConfig KeyDefaultOptions
Max iterationsagent.maxIterations61–100
Safe modeagents.defaults.safe_modetruetrue / false
Tool profileagents.defaults.tool_profilefullcoding, messaging, automation, full
Command sandboxagents.defaults.command_sandboxrestrictedrestricted, standard, unrestricted
Exec securityagents.defaults.exec_security_modeallowlistdeny, allowlist, full
Exec ask modeagents.defaults.exec_ask_moderiskyalways, risky, never
Filesystem modeagents.defaults.filesystem_modefullfull, workspace_only
Plugin networkagents.defaults.plugin_network_moderestrictedfull, restricted, none

All agent defaults can be overridden per-agent in the Agents page (/app/agents). Environment variable overrides use the pattern CLAWMAGIC_AGENTS_DEFAULTS_<FIELD>.

AI Provider Keys

ClawMagic uses BYOK (Bring Your Own Key). Set provider API keys via environment variables or through the portal Advanced Settings tab.

# Environment variables for AI providers
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_AI_API_KEY=AIza...

# Or set via portal: Settings → Advanced → AI Provider Secrets

Provider keys are stored encrypted using AES-256-GCM. No plaintext secrets on disk. The onboarding wizard handles initial provider setup.

Marketplace Connection

SettingConfig KeyDefaultWhat It Does
Enabledmarketplace_enabledtrueConnect to marketplace API
Purchase approvalmarketplace.approvals_required_for_purchasestrueRequire human approval before buying
Agent purchasesmarketplace_allow_agent_purchasesfalseLet agents buy plugins autonomously
Daily limitmarketplace_daily_purchase_limit_cents0Max daily spend in cents
Malware scanmarketplace.require_malware_scantrueRequire scan before install
Checksum verifymarketplace.require_checksum_verificationtrueVerify download integrity

Plugin Settings

// ~/.clawmagic/config.json → plugins section
{
  "plugins": {
    "enabled": true,           // Master switch
    "allow": [],               // Allowlist: only these slugs can load
    "deny": [],                // Denylist: block specific slugs
    "load": { "paths": [] },   // Additional plugin directories
    "compat": {
      "openclawStrict": false,         // Enforce OpenClaw manifest compat
      "requireSignatures": false,      // Require signed packages
      "openclawInstallSecurity": "permissive"  // strict|balanced|permissive
    },
    "slots": {
      "memory": null           // Optional: plugin slug for memory backend
    }
  }
}

Memory Settings

Memory configuration is stored at state/config/memory_settings.json and controls the search, embedding, and cost guardrail behavior.

SettingDefaultWhat It Does
Storage backendjsonljsonl or sqlite
Search modebm25bm25, semantic, or hybrid
Embedding providerautoauto, openai, gemini, voyage, mistral, local, hash
Temporal decayenabledOlder memories score lower (half-life in days)
Quality modeoffoff, pre, pre_post, full (runtime intelligence)
Cost guardenabledBudget limits per task and chain run

Env overrides: CLAWMAGIC_STORAGE_BACKEND, CLAWMAGIC_SEARCH_MODE, CLAWMAGIC_EMBEDDING_PROVIDER, CLAWMAGIC_EMBEDDING_ENABLED.

Heartbeat Configuration

// Runtime settings → heartbeat
{
  "heartbeat": {
    "enabled": true,
    "intervalMinutes": 30,
    "keepaliveOnInbound": true,
    "adaptiveCadence": true,
    "activeHours": {
      "enabled": true,
      "startHour": 8,
      "startMinute": 0,
      "endHour": 22,
      "endMinute": 0,
      "timezone": "America/New_York"
    }
  }
}

The heartbeat keeps your agent proactive during active hours. Set via the portal or during onboarding.

Environment Variable Reference

All config keys can be overridden via environment variables using the pattern CLAWMAGIC_<SECTION>_<KEY>. The .env.example file in the ClawMagic repo lists all available variables with documentation.

# Key environment variables
CLAWMAGIC_GATEWAY_PORT=18790
CLAWMAGIC_GATEWAY_API_TOKEN=your-token-here
CLAWMAGIC_PORTAL_PASSWORD=your-password
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_AI_API_KEY=AIza...
CLAWMAGIC_AGENT_MAX_ITERATIONS=6
CLAWMAGIC_PLUGINS_ENABLED=true
CLAWMAGIC_GATEWAY_ALLOW_REMOTE=false

Environment variables always override config file values. This is useful for Docker deployments and CI/CD where you inject config via env.

Next Steps