Overview
Codaph uses Mubit as a shared collaborative backend for cross-contributor context and semantic query. This enables teams to:- Share agent activity across contributors
- Query semantic context from any contributor’s work
- Track multi-contributor sessions
- Synchronize reasoning and file changes
Mubit Memory Engine
Fromsrc/lib/memory-mubit.ts:427-830:
Core Concepts
Run Scopes
Run Scopes
Mubit organizes events into runs. Codaph supports two run scopes:Session Scope (Check current scope:
session):- Each captured session gets its own Mubit run ID:
codaph:<projectId>:<sessionId> - Isolated per-session context
- Best for personal workflows
project):- All sessions share one Mubit run ID:
codaph:<projectId> - Unified cross-contributor context
- Recommended for teams
Project Identity
Project Identity
Codaph resolves project identity in priority order:Set project ID manually:This ensures all team members share the same Mubit project ID regardless of local checkout path.
- Explicit
--mubit-project-idflag MUBIT_PROJECT_IDorCODAPH_PROJECT_IDenv var- Project settings (
~/.codaph/settings.json) - GitHub auto-detection from
git remote origin - Local path hash fallback
src/settings-store.ts:detectGitHubDefaults):Actor Identity
Actor Identity
Codaph tracks contributors via Actor ID is attached to all events, enabling contributor filtering in TUI and queries.
actorId. Resolution order:--mubit-actor-idflagCODAPH_ACTOR_IDenv var- Global Codaph settings
- GitHub user from
gh api user(login) - Git config
user.name - Shell
USERorUSERNAME
Run ID Patterns
Fromsrc/lib/memory-mubit.ts:391-425:
codaph-prompts:<repoId>: Prompt-only timeline for quick browsingcodaph-sessions:<repoId>: Session summary snapshotscodaph-diffs:<repoId>: Chunked diff data for large sessions
Collaboration Workflows
cd /path/to/shared-repo
codaph init \
--mubit-api-key <team-key> \
--mubit-project-id owner/repo \
--mubit-run-scope project \
--mubit-actor-id alice
{
"schema": "codaph.project.v2",
"mubitProjectId": "owner/repo",
"mubitRunScope": "project",
"agentProviders": ["codex", "claude-code"],
"syncAutomation": {
"enabled": true,
"gitPostCommit": true,
"agentComplete": true
}
}
cd /path/to/shared-repo
codaph init --mubit-actor-id bob
# Codaph detects mubitProjectId from git remote or project.json
Multi-Contributor Session Review
From TUI inspect view (src/index.ts:6394-6471):
- Open TUI:
codaph tui - Select a session (may contain multiple contributors)
- Press
cto open Contributors overlay - Navigate with
↑/↓to see:- Actor ID
- Prompt count per contributor
- Thought count
- File count
- Trace (prompt → thoughts → files)
- Press
Enteron a contributor to filter prompts to only that actor - Press
fto cycle through actor filters - Review contributor-specific changes in Diff pane
Semantic Query Across Contributors
Mubit’s semantic query works across all contributors in project scope:Sync Automation for Teams
Fromsrc/sync-automation.ts and src/index.ts:1983-2076:
Git Hooks
Install team-wide automation:- Triggers
codaph syncafter relevant events - Respects cooldown (default: 600s between auto-pulls)
- Marks pending triggers if lock is busy
- Logs to
.codaph/sync-automation-log.jsonl
Sync Lock
Fromsrc/sync-automation.ts:acquireSyncLock:
.codaph/mubit-remote-sync-state.json):
Cooldown Configuration
Prevent excessive cloud pulls:src/sync-automation.ts:shouldRunRemotePullNow):
hook-agent-completehook-post-commithook-post-pushtui-startup(whenautoWarmTuiOnOpenenabled)
codaph pull ignores cooldown.
Mubit API Integration
Fromsrc/lib/memory-mubit.ts:427-830:
Event Ingestion
src/lib/memory-mubit.ts:308-385):
To reduce bandwidth, Codaph compacts event payloads before sending to Mubit:
Semantic Query
Context Snapshot
Fetch full run context snapshot:Best Practices
Use Project Scope for Teams
Use Project Scope for Teams
Recommended:Why?
- All contributors see each other’s sessions
- Semantic queries work across the team
- Shared context for onboarding
- Cross-contributor file change tracking
- Personal projects
- Experimentation
- Isolated feature development
Consistent Project ID
Consistent Project ID
Ensure all team members use the same project ID:
-
Auto-detect from GitHub: Use consistent remote URL
-
Or set explicitly:
-
Commit project.json (created by
codaph init):
Unique Actor IDs
Unique Actor IDs
Each team member should have a unique actor ID:Why?
- Enables contributor filtering in TUI
- Tracks who made which changes
- Supports audit trails
- Powers semantic queries like “what did alice change?”
Sync Regularly
Sync Regularly
Set up automation to keep shared context fresh:Tip: Enable
autoPullOnSync for automatic cloud pulls:Monitor Sync State
Monitor Sync State
Regularly check sync health:Look for:
- Recent
lastSuccessAttimestamps - Non-zero
receivedTimelineCount - Low
consecutiveSameSnapshotCount(< 10) - No
lastErrormessages
Troubleshooting
Contributors Not Showing
Contributors Not Showing
Issue: TUI contributors overlay is empty or missing teammates.Causes:
- Different project IDs across team members
- Session scope instead of project scope
- Sync not running
Mubit Query Empty Results
Mubit Query Empty Results
Issue:
codaph mubit query returns no results despite activity.Causes:- Wrong run ID
- Mubit API key not set
- Events not synced to cloud
Sync Lock Busy
Sync Lock Busy
Issue:
codaph sync fails with “Another Codaph sync is already running”.Cause: Concurrent sync attempt or stale lock file.Fix:High Deduplication Count
High Deduplication Count
Issue:
codaph status shows high dedup count, low import count.Cause: Events already exist in cloud (normal after backfill).Fix: This is expected behavior. Deduplication prevents duplicate events.If concerned: