Skip to content

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 1, 2026

Summary

  • Renames the resume command to attach
  • Implements MRU-based session selection per the CLI specification
  • Updates help text and examples

Changes

The attach command now supports three usage patterns:

Arguments Behavior
None Attach to the most recently accessed session globally
branch only Attach to the most recent session for that instance
branch and session Attach to the specified session

The command uses the session management APIs (GetGlobalMRUSession, GetMRUSession, AttachSession) instead of directly attaching to the container.

Test plan

  • Verify hjk attach attaches to the global MRU session
  • Verify hjk attach <branch> attaches to the MRU session for that instance
  • Verify hjk attach <branch> <session> attaches to the specified session
  • Verify appropriate error messages when no sessions exist

Closes JMG-12

🤖 Generated with Claude Code

Rename the resume command to attach and implement MRU-based session
selection per the CLI specification:

- No args: attach to the most recently accessed session globally
- Branch only: attach to the most recent session for that instance
- Branch + session: attach to the explicit session

The command now uses the session management APIs (GetGlobalMRUSession,
GetMRUSession, AttachSession) instead of directly attaching to the
container. Error messages guide users to use 'run' when no sessions
exist.

Closes: JMG-12

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@linear
Copy link

linear bot commented Jan 1, 2026

jmgilman and others added 2 commits December 31, 2025 19:41
- Use 'hjk' instead of 'headjack' in examples
- Document Zellij keybinding per CLI spec
- Update stop.go to reference 'hjk run' instead of 'resume'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all error messages in attach.go to suggest 'hjk run' instead
of just 'run' for consistency with CLI spec.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmgilman jmgilman merged commit 15765be into master Jan 1, 2026
1 check passed
@jmgilman jmgilman deleted the joshuagilman/jmg-12-command-attach-rename-from-resume branch January 1, 2026 03:54
jmgilman added a commit that referenced this pull request Jan 3, 2026
Current behavior:
The resume command required explicit branch specification and directly attached to containers without session management or MRU-based selection.

New behavior:
The attach command implements MRU-based session selection with three modes: no args attaches to the most recently accessed session globally, branch only attaches to the most recent session for that instance, and branch + session attaches to the explicit session. Uses session management APIs and provides helpful error messages guiding users to use hjk run when no sessions exist.

Breaking Changes:
- Renamed resume command to attach
- Changed command syntax and argument handling
- Removed agent functionality from attach command

Closes: #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants