Configuration Approach
NanoClaw Pro uses environment variables for runtime settings and in-code constants for behavior. Most configuration lives insrc/config.ts.
Modify
src/config.ts directly for default values, or use .env to override at runtime without changing code.Environment Variables
Authentication
OAuth token for Claude subscription (Pro/Max plans)Extract from Use either this OR
~/.claude/.credentials.json after logging in to Claude Code:ANTHROPIC_API_KEY, not both.Anthropic API key for pay-per-use billingGet from: https://console.anthropic.com/Use either this OR
.env
CLAUDE_CODE_OAUTH_TOKEN, not both.Custom API endpoint for third-party or self-hosted modelsUseful for:
.env
- Open-source Claude-compatible models
- Internal API proxies
- Regional endpoints
Assistant Identity
The name of your assistantChanges:After changing, rebuild and restart:
- Trigger pattern (messages must start with
@YourName) - Response prefix (
YourName:added to responses)
.env
Whether the assistant uses a dedicated phone numberSet to
true if using a separate SIM/device for WhatsApp. Affects how the main channel is registered:false: Self-chat mode (personal WhatsApp number)true: Direct message mode (dedicated bot number)
.env
Container Runtime
Docker/Apple Container image name for agent executionRebuild the image after code changes:
.env
Maximum agent execution time in milliseconds (default: 30 minutes)Agents that exceed this timeout are terminated. Increase for long-running tasks.
.env
Maximum container output size in bytes (default: 10MB)Prevents memory issues from verbose agent logs.
.env
How long to keep containers alive after last result (default: 30 minutes)Keeping containers alive improves response time for follow-up messages (session continuity).
.env
Maximum number of agent containers running simultaneouslyPrevents resource exhaustion when processing many groups. Messages queue if limit is reached.
.env
Polling Intervals
These are defined insrc/config.ts and cannot be overridden via .env (edit source if needed):
How often to check for new messages (milliseconds)
src/config.ts
How often to check for due scheduled tasks (milliseconds)
src/config.ts
How often to check for IPC messages from containers (milliseconds)
src/config.ts
Timezone
Timezone for scheduled tasks (cron expressions)Uses system timezone if not specified. See tz database for valid values.
.env
Configuration File (src/config.ts)
All configuration constants are centralized insrc/config.ts:
src/config.ts
Trigger Pattern Customization
The trigger pattern determines which messages activate Claude. Default:^@Andy\b (case-insensitive)
Change Trigger Word
SetASSISTANT_NAME:
.env
@Bot:
@Bot hello✅@bot what's up✅ (case-insensitive)Hey @Bot❌ (must be at start)
Advanced Trigger Patterns
For complex patterns, modifysrc/config.ts directly:
src/config.ts
Main Channel: No Trigger Required
The “main” channel (self-chat or admin DM) can be configured to not require a trigger. Set during registration:@Andy.
Directory Paths
Paths are absolute (required for container mounts). Defined insrc/config.ts:
Applying Configuration Changes
After modifying configuration:Example .env File
.env
Next Steps
Container Configuration
Mount additional directories and configure isolation
Skills System
Add capabilities with pre-built skills