Skip to main content

Module sessions

Module sessions 

Source
Expand description

omni-dev sessions — track the Claude Code, Codex and pi.dev sessions running across every terminal and VS Code window, via the daemon’s sessions service.

The subcommands split by role:

  • list is a read client (like omni-dev worktrees list): it asks the daemon’s sessions service for the live set and renders it.
  • hook is the feed sink: Claude Code (or Codex, with --agent codex) runs it per hook event; it reads the hook JSON on stdin, maps it to an observe/end op, and fire-and-forgets it to the daemon socket. It must never block or fail a Claude turn — a missing daemon, a bad payload, or any other error is swallowed and it always exits 0.
  • install-hooks / uninstall-hooks idempotently merge (or remove) the hook block in ~/.claude/settings.json, preserving any hooks already there. When pi.dev is installed they also write (or remove) the generated pi extension in ~/.pi/agent/extensions/, which reports straight to the socket (#1901), and when Codex is installed the same hook block, tagged --agent codex, in $CODEX_HOME/hooks.json — position-stably, since Codex trusts a hook by its index (#1907).
  • install-wrapper / uninstall-wrapper are the same idea for Feed 4: they write the shim that VS Code’s Claude extension launches omni-dev claude-wrap through, and point the extension’s claudeCode.claudeProcessWrapper setting at it.

The register/heartbeat feed from the companion VS Code extension talks to the socket directly (like the worktrees companion), not through this CLI.

Structs§

HookCommand
The Claude Code / Codex hook sink: reads one hook event’s JSON on stdin and reports it to the daemon. Fire-and-forget and infallible-by-design.
InstallHooksCommand
Installs the sessions-tracker hooks into ~/.claude/settings.json, plus the pi.dev extension when pi is installed and the Codex hooks when Codex is.
InstallWrapperCommand
Installs the claude-wrap shim and points VS Code’s Claude extension at it.
ListCommand
Lists the live cross-window set of running Claude sessions.
SessionsCommand
Sessions: see the Claude Code sessions running across every terminal and VS Code window, kept live by the daemon.
UninstallHooksCommand
Removes the sessions-tracker hooks from ~/.claude/settings.json, the pi.dev extension, and the Codex hooks.
UninstallWrapperCommand
Removes the wrapper setting and the shim it points at.
WindowCommand
Reports a window’s Claude embedding counts (the companion window feed op).
WindowUnregisterCommand
Removes a window’s embedding report — the companion window-unregister feed op made typed. Prints whether an entry was actually removed.

Enums§

HookAgent
The agents whose hooks run HookCommand. pi.dev reports through its own extension, so it has no hook variant.
SessionsSubcommands
Sessions subcommands.