Skip to content

feat: add /resume command and use Unicode emoji (v0.1.13)#17

Merged
t2tx merged 1 commit into
mainfrom
feature/resume-and-emoji
Jun 17, 2026
Merged

feat: add /resume command and use Unicode emoji (v0.1.13)#17
t2tx merged 1 commit into
mainfrom
feature/resume-and-emoji

Conversation

@t2tx

@t2tx t2tx commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Ports two fixes from the GitLab sibling repo.

1. /resume — reconnect a thread to a past Claude session

Iris keeps the thread⇄session map in memory, so a restart (e.g. an update) drops it and the next message starts a fresh session. Claude's session JSONL files survive, so /resume lists them and reattaches.

  • claude-sessions.ts (new): read ~/.claude/projects/<encoded-cwd>/*.jsonl; projectDir maps cwd → projects path (/-)
  • session.ts: setResumeId() applies --resume on the next spawn (resumeOverrides map; ensure resolves live entry > resume override)
  • commands.ts: /resume (list recent sessions) and /resume <id> (reconnect, prefix match)
  • /clear kills the process but never deletes the JSONL, so /resume still works afterwards

2. Unicode emoji

Replace Slack shortcodes (:green_circle: etc.) with real Unicode (🟢🔴🔄🧹🏠➡️⚠️✅❌🔒✍️🛠️). Shortcodes were not converted when sent via chat.postMessage (e.g. /sessions status dots rendered as literal text).

Verification

Both verified on the GitLab sibling repo (v0.1.9 / v0.1.10) on Iris-dev: /resume list → reconnect → context restored after a restart; /sessions shows 🟢. pnpm verify green (94 tests). version 0.1.12 → 0.1.13.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added /resume command to list and resume past Claude sessions by session ID.
  • Style

    • Updated emoji formatting across error messages, permission confirmations, and progress indicators for improved compatibility.
  • Tests

    • Added test coverage for session management and resume functionality.
  • Chores

    • Version bumped to 0.1.13.

Port two fixes from the GitLab sibling repo.

1. /resume — reconnect a thread to a past Claude session
   - Iris keeps the thread⇄session map in memory, so a restart (e.g. an
     update) drops it and the next message starts fresh. Claude's session
     JSONL files survive, so /resume lists them and reattaches.
   - claude-sessions.ts: read ~/.claude/projects/<encoded-cwd>/*.jsonl
   - session.ts: setResumeId() applies --resume on the next spawn
   - commands.ts: /resume (list) and /resume <id> (reconnect, prefix match)
   - /clear kills the process but never deletes the JSONL, so /resume still
     works afterwards

2. Unicode emoji — replace Slack shortcodes (:green_circle: etc.) with real
   Unicode (🟢🔴🔄🧹🏠➡️⚠️✅❌🔒✍️🛠️). Shortcodes were not converted when sent
   via chat.postMessage (e.g. /sessions status dots showed as text).

- tests added (94 tests, verify green); version 0.1.12 → 0.1.13

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@t2tx

t2tx commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@t2tx

t2tx commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

Merging without a CodeRabbit review: CodeRabbit did not run (likely the free-tier 4 reviews/hour rate limit after #15/#16). Required checks (verify/coverage/CodeQL) all pass, and this is a straight port of code already verified live on the GitLab sibling repo (v0.1.9 emoji / v0.1.10 /resume).

@t2tx t2tx merged commit 47022b1 into main Jun 17, 2026
4 checks passed
@t2tx t2tx deleted the feature/resume-and-emoji branch June 17, 2026 08:21
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e4ffdcd-be8a-4f97-ba90-93c305e8fe6a

📥 Commits

Reviewing files that changed from the base of the PR and between 1b17c4b and 7af65ee.

📒 Files selected for processing (10)
  • package.json
  • src/claude-sessions.test.ts
  • src/claude-sessions.ts
  • src/commands.test.ts
  • src/commands.ts
  • src/format.ts
  • src/index.ts
  • src/permission.ts
  • src/session.ts
  • src/stream-buffer.ts

Walkthrough

Adds a /resume slash command that reads Claude Code's persisted JSONL session files via a new claude-sessions.ts module, extends SessionManager with setResumeId to force respawn with --resume, and wires the command handler into commands.ts. Separately normalizes Slack emoji aliases to unicode across several user-facing message strings and bumps the package version to 0.1.13.

Changes

/resume Command Feature

Layer / File(s) Summary
ClaudeSession module and JSONL parser
src/claude-sessions.ts, src/claude-sessions.test.ts
Defines ClaudeSession interface, projectDir path encoder, internal firstUserPrompt JSONL parser (handles string and array content, skips tag-prefixed lines), and listClaudeSessions enumerator sorted by mtimeMs. Tests cover path encoding, empty directory, and single-file JSONL session parsing.
SessionManager resume override
src/session.ts
Adds resumeOverrides map and setResumeId(sessionKey, sessionId) method; closes any live process and removes its entry so the next message spawns with --resume. ensure() reads the pending override and clears it after use.
/resume command wiring and handler
src/commands.ts, src/commands.test.ts
Imports listClaudeSessions, registers cmdResume in COMMANDS, adds /resume and /resume <id> to /help output, and implements the handler: lists recent sessions when called with no argument, or matches by id prefix and calls setResumeId. Tests cover the stub, help text, no-sessions response, and unknown-id error.

Emoji Normalization and Version Bump

Layer / File(s) Summary
Unicode emoji replacements and version bump
src/commands.ts, src/format.ts, src/index.ts, src/permission.ts, src/stream-buffer.ts, package.json
Replaces Slack alias tokens (:lock:, :warning:, :white_check_mark:, :x:, :hammer_and_wrench:, :writing_hand:) with direct unicode emoji in cmdSessions, cmdRestart, cmdClear, cmdSwitch, toolProgressLine, onError, permission click responses, permissionBlocks, and TYPING_INDICATOR. Bumps version to 0.1.13.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/resume-and-emoji

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant