Doctor Command
Thecodaph doctor command provides a comprehensive diagnostic report of your Codaph setup.
What Doctor Checks
- Current working directory and repo identification
- Mubit configuration: API key, project ID, actor ID, run scope
- Environment variables:
MUBIT_API_KEY,CODEX_PATH, etc. - Sync automation: Hook status, cooldown settings
- Remote sync state: Last successful sync, deduplication stats
- OpenAI integration: API key and agent status
src/index.ts:557 (doctor function)
Common Issues
Mubit Sync Issues
”Mubit is disabled”
Cause: No Mubit API key found in environment or settings. Fix:- Get an API key from console.mubit.ai
- Save it globally:
- Verify with:
Mubit runtime: enabled
”Mubit write failed”
Cause: Network timeout or slow connection to Mubit API. Fix:- Check network connectivity:
- Increase timeout:
- For bulk imports, use local-only mode then repair:
src/lib/ingest-pipeline.ts:167
High Deduplication Count
Observation:
codaph pull shows dedup=348, imported=0- You’ve already run
codaph pullrecently - Multiple users are syncing the same project
- You ran
codaph repair cloud(replays existing events)
”Suspected Server Cap”
Cause: Mubit timeline API has a maximum page size limit. Impact: You may not see events beyond the cap in a single pull. Mitigation:- Codaph automatically deduplicates across multiple pulls
- Increase pull frequency (reduce cooldown)
- Use session-scoped runs for large projects
src/mubit-remote-sync.ts:395
Sync Automation Issues
Git Hooks Not Triggering
Symptom:
git commit doesn’t trigger codaph pullSync automation: enabled (post-commit:on, ...)
Source: src/sync-automation.ts:89
”Another Codaph sync is already running”
Cause: Sync lock file (.codaph/sync-lock.json) exists from previous operation.
Fix:
- Wait a few seconds for the other process to finish
- If stuck (crashed process), manually remove lock:
- Verify no other Codaph processes are running:
src/sync-automation.ts:84
Cooldown Preventing Pull
Symptom:
codaph pull says “No remote changes detected” immediately after pushcooldown=300s
Override for single pull:
~/.codaph/settings.json:
src/sync-automation.ts:96
Agent Provider Issues
”No agent providers detected”
Symptom:
codaph push reports scan 0/0 | match 0 | events 0.codex/, .claude/, etc.) found.
Fix:
- Run an agent first:
- Verify marker directory exists:
- Explicitly specify providers:
- Codex (OpenAI):
.codex/ - Claude Code (Anthropic):
.claude/ - Gemini CLI (Google):
~/.config/gemini/
src/lib/agent-providers.ts:54
Provider History Import Failed
Cause: Agent history directory missing or inaccessible. Fix:- Check agent history location:
- Verify file permissions:
- Skip failed provider:
src/index.ts:1449
Session/Timeline Issues
”Session not found”
Cause: Session ID doesn’t exist in local mirror. Fix:- List available sessions:
- Pull latest from Mubit:
- Verify session ID format (8+ hex chars):
Empty Timeline
Symptom:
codaph timeline --session abc123 shows no events- Check session exists:
- Try without filters:
- Check mirror directly:
TUI Issues
”TUI requires an interactive terminal”
Cause: Running in non-interactive environment (CI, piped input, etc.). Fix: Use CLI commands instead:TUI Rendering Issues
Symptom: Garbled text, overlapping lines, or incorrect colors
- Check terminal size:
- Try different terminal:
- Update terminal emulator to support:
- ANSI colors
- UTF-8
- Cursor positioning
Installation Issues
”command not found: codaph”
Cause: Codaph not installed or not in PATH. Fix:Permission Denied
Cause: No write permissions in current directory. Fix:Diagnostic Commands
Check Configuration
Check Sync Status
- Local mirror stats
- Last sync times
- Automation status
- Pending triggers
Inspect Sync State
- Last successful sync timestamp
- Timeline counts
- Deduplication stats
- Error messages
Check Sync Logs
Verify Mirror Integrity
Advanced Diagnostics
Enable Verbose Logging
Force Refresh
Test Mubit Connectivity
- API key validity
- Network connectivity
- Firewall/proxy settings
Repair Cloud Sync
- Cloud sync was interrupted
- Events missing from Mubit
- Changed project ID or run scope
Getting Help
If issues persist:- Check documentation: docs.codaph.dev
- Run diagnostics:
codaph doctor - Check logs:
.codaph/sync-automation-log.jsonl - Report issues: github.com/codaph/codaph/issues
- Output of
codaph doctor - Error messages (redact sensitive data)
- Steps to reproduce
- Operating system and Node.js version
Related
codaph doctor— Diagnostic command referencecodaph status— Status command reference- Sync Automation — Understanding git hooks and triggers
- Mubit Memory — Cloud memory architecture