Skip to content

feat: list Claude and Codex sessions together by default #75

Closed

Description

@abruption

Motivation

Callers currently need to know the target agent before discovery: session-peer list defaults to Claude, and Codex requires --agent codex. This makes cross-agent session selection require separate commands.

In v0.7.0, Codex session rows already contain agent: "codex", while Claude rows have no agent discriminator. A unified result should identify each row without requiring callers to infer its agent from fields such as UUID or PID.

Proposed behaviour

  • Make session-peer list and session-peer list --json discover Claude and Codex together by default.
  • Include a required agent: "codex" | "claude" discriminator in every JSON session row.
  • Retain --agent codex and --agent claude as optional filters.
  • Show an AGENT column in human-readable output so human and JSON discovery cover the same agents.
  • Preserve successful session results when another agent's discovery fails, and expose the incomplete discovery explicitly through diagnostics and documented exit-code behaviour.
  • Keep the existing schema-versioned JSON envelope and single-host/multi-host object-versus-array convention.
  • Preserve each agent's existing identifiers, discovery limits, and --all semantics. Combined discovery must not infer a running Codex session from a saved thread or claim message consumption.

Example JSON payload within the existing envelope:

{
  "sessions": [
    {"agent": "codex", "id": "...", "name": "ontology"},
    {"agent": "claude", "pid": 12345, "name": "api-worker"}
  ]
}

Commands:

session-peer list --json                       # Claude + Codex
session-peer list --agent codex --json         # Codex only
session-peer list --agent claude --json        # Claude only

Compatibility

The default changes from Claude-only to combined discovery. Document this behaviour change and show existing Claude-only callers how to retain their selection with --agent claude. Agent-specific fields remain available alongside the shared discriminator.

A missing Codex home/state DB on a Claude-only machine must not hide Claude results or appear as a successful complete discovery. Likewise, a Claude inspection failure must not discard successfully discovered Codex rows.

Acceptance criteria

  • Default local and SSH listing returns both agents when available.
  • Every session row contains the correct agent discriminator.
  • Explicit agent filters preserve the corresponding existing discovery behaviour.
  • Human-readable output clearly identifies each agent.
  • Partial failures preserve successful rows and distinguish incomplete discovery from a complete empty result.
  • Local, SSH, and repeated-host responses preserve the existing JSON envelope/cardinality contract.
  • Tests cover both agents, one agent installed, neither available, partial failures, filters, --all, and Codex-home options.
  • README, JSON documentation, CLI help, and bundled skill examples describe the new default and compatibility guidance.

Related: #29 (JSON envelope), #44 (Codex discovery), #47 (future agent adapters).

Activity

  1. added
    enhancement
    on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions