Skip to content

Add partio attach command to manually link untracked sessions to commits #158

@jcleira

Description

@jcleira

Description

When Claude Code sessions are started outside the normal pre-commit hook flow — for example, when Partio wasn't enabled at session start, when the agent was launched from a parent directory before the repo was initialized, or when a session ran without triggering the pre-commit hook — users have no way to retroactively link those sessions to their commits.

Add a partio attach command that accepts a session ID and optional commit hash, then creates a checkpoint on the partio/checkpoints/v1 branch linking the session to that commit.

partio attach <session-id>                 # link to HEAD
partio attach <session-id> <commit-hash>  # link to specific commit

Source: entireio/cli changelog 0.5.3 (entire attach command, PR #688/#743)

Acceptance Criteria

  • partio attach <session-id> links a previously untracked session to the most recent commit
  • partio attach <session-id> <commit-hash> links the session to the specified commit
  • Command validates that the session ID exists in the local sessions directory
  • Command creates a checkpoint on the orphan branch linking session to commit
  • Command fails gracefully with a helpful error if the session or commit is not found
  • Command is idempotent: re-attaching an already-linked session updates rather than duplicates

Context Hints

  • cmd/partio/ — add new attach command
  • internal/checkpoint/ — checkpoint creation logic
  • internal/agent/claude/ — session discovery and JSONL parsing
  • internal/session/ — session lifecycle types
  • internal/git/ — git operations for commit amendment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions