Overview
Connect your current AI session to hcom. Detects vanilla Claude/Gemini/Codex installations, recovers orphaned processes, or rebinds session identities.Syntax
Flags
Rebind to a different instance nameUseful for resuming stopped sessions or claiming a specific identity
Recover orphaned PTY process by name or PIDOrphans are processes tracked in pidtrack but not in the instances table
Behavior Modes
Bare Start (No Flags)
Auto-detects tool and creates/resumes instance:- Vanilla Tool Detection: If running in unhooked Claude/Gemini/Codex, offers to install hooks
- Existing Identity: If
--namematches an existing instance, resumes it - New Instance: Generates unique name and creates fresh instance
Rebind Mode (--as <name>)
Claim a stopped instance identity:
- Last event cursor (pending messages delivered)
- Session ID
- Name
- Process bindings
- Active status
Orphan Recovery (--orphan <target>)
Recover a PTY process that lost its instance registration:
- Reuses original name if valid and available
- Generates new name if conflict exists
- Removes pidtrack entry after recovery
- Logs
life/startedevent withreason=orphan_recover
Subagent Mode (Internal)
When--name <agent-id> matches a parent’s running_tasks.subagents, creates structured subagent name like parent_task_1.
This mode is automatically triggered by Claude Code’s Task tool and should not be invoked manually.
Environment Variables
Custom hcom directory (default:
~/.hcom)For sandbox or project-local mode:Examples
Vanilla Tool Setup
Resume Stopped Session
Recover Orphan
Sandbox Mode
Output
Successful Start
Vanilla Tool Detection
Orphan Recovery
Exit Codes
Successfully started or already active
- Identity resolution failed
- Orphan not found
- Hook installation failed
- Running tasks prevent rebind/orphan recovery
Notes
Hook Auto-Install:
hcom start automatically installs missing hooks for detected vanilla tools (Claude, Gemini, Codex). Requires tool restart to activate.Subagent Guard: Subagents (spawned via Claude’s Task tool) cannot use
--as or --orphan. They must use hcom start --name <agent-id> to register.One-Time Stop: Subagents get ONE start. Any stop (self or external) permanently ends the session. Subsequent starts are blocked with “Your session was stopped by X” error.
Remote Instances: Rebinding remote instances (from other devices via relay) sends control message instead of local rebind.
Cursor Preservation:
--as mode restores last_event_id from stopped snapshot, ensuring pending messages are delivered after rebind.Related Commands
hcom list- Check your identity and statushcom stop- Disconnect from hcomhcom r- Resume with full session historyhcom hooks- Manage hook installation