Usage
Options
Auto-repair fixable issues (creates missing directories, fixes permissions, removes stale locks)
Output results in machine-readable JSON format
Show summary only, suppress detailed check output
Specify project root directory (auto-detected if not provided)
Examples
Basic Diagnostics
Auto-Fix Issues
- Creates missing directories
- Fixes
.envfile permissions to 600 - Removes stale
.git/index.lockfiles - Creates
.athena_rootmarker if missing
JSON Output
Quiet Mode
Diagnostic Checks
The doctor command runs 15 comprehensive checks:0. Environment
- Python version (recommends 3.10+)
- Virtual environment status
- Key dependencies (dotenv, supabase, yaml)
1. Workspace Marker
- Validates
.athena_rootexists - Auto-creates if
--fixis enabled
2. Directory Structure
- Checks required directories:
.agent/and subdirectories.context/memory_bank/.context/memories/session_logs/
- Creates missing directories with
--fix
3. Config Integrity
- Validates
.envfile exists - Checks file permissions (should be 600)
- Verifies key environment variables
- Fixes permissions with
--fix
4. Memory Bank
- Validates 4 pillar files:
activeContext.md- Current session stateuserContext.md- User profileproductContext.md- Product philosophysystemPatterns.md- Architecture patterns
- Reports file sizes
- Warns if files are nearly empty (less than 50 bytes)
5. Session Integrity
- Counts total session log files
- Validates most recent session
- Warns if latest session is suspiciously small
- Detects 1-line stubs
6. Orphan Detection
- Runs
orphan_detector.pyif available - Scans for orphaned files/directories
- Non-critical (skips if detector missing)
7. Dead Links
- Scans
activeContext.mdforfile://links - Validates all linked files exist
- Reports broken links with paths
8. Secret Scan
- Scans git staged files for potential secrets:
- AWS Access Keys
- GitHub Personal Access Tokens
- OpenAI/Anthropic API Keys
- JWT/Supabase tokens
- Google API Keys
- Private keys
- Fails if secrets detected in staged files
9. Git Health
- Validates git repository exists
- Checks for stale
.git/index.lockfiles - Verifies remote origin is configured
- Reports dirty working tree status
- Removes stale locks with
--fix
10. Daemon Status
- Checks if
athenad.pyprocess is running - Reports PID if active
- Provides command to start daemon
11. Database
- Tests Supabase connectivity (if configured)
- Skips if environment variables not set
- Non-critical for offline operation
12. Echo Chamber
- Scans recent sessions for disagreement signals:
- “actually”, “incorrect”, “disagree”
- “not quite”, “push back”, “not accurate”
- Warns if less than 3 disagreements in last 10 sessions
- Promotes healthy agent-user dialogue
13. Context Freshness
- Checks
activeContext.mdmodification time - Warns if >7 days old
- Suggests updating at next
/start
14. Workspace Tips
- Recommends git backup if not initialized
- Validates memory bank is configured
- Provides setup guidance
Status Indicators
| Icon | Status | Meaning |
|---|---|---|
| ✅ | Pass | Check passed successfully |
| ⚠️ | Warn | Warning detected, non-critical |
| ❌ | Fail | Critical issue found |
| ⏭️ | Skip | Check skipped (dependency missing) |
Exit Codes
| Code | Meaning |
|---|---|
0 | All checks passed (warnings are acceptable) |
1 | One or more checks failed (critical issues) |
Auto-Fix Capabilities
The--fix flag automatically resolves:
- Missing
.athena_rootmarker - Missing directory structure
- Incorrect
.envfile permissions - Stale
.git/index.lockfiles
Common Workflows
Fresh Workspace Validation
Pre-Commit Check
Automated CI/CD
Repair Workspace
Integration with Scripts
Parse JSON output in shell scripts:Pattern Credit
This diagnostic system is inspired by OpenClaw’s doctor command, implementing comprehensive health checks for AI agent workspaces.Related Commands
- athena check - Quick basic health check
- athena init - Initialize workspace structure