cc-sessions 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +1 -0
  4. data/bin/cc +18 -2
  5. data/bin/cc-bookmark +10 -2
  6. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 605f4de2854d8c09e7930c20cb0bce3f3b511d6dc4d7f7e87258d1eb9082108f
4
- data.tar.gz: c87c3a2b615a1631c5932154055b49d8bebec23663031dd1ffb446fe79477cef
3
+ metadata.gz: 7c743c60e405530074e227bd6f4b02165cd78c217f0485898bf91505300db5eb
4
+ data.tar.gz: 5137132931a0bba947285cf71c36e64b978495ef6235128d56e6841702ca093b
5
5
  SHA512:
6
- metadata.gz: 1f9d6e2c15ff339679c7a65fe43354b2ee4518c8ebe78af68092492244c35e82f4afeac6a119e36914ba63e4734283e188b28b7d65e3fa77cebb3f51e5b056f6
7
- data.tar.gz: 776a04d367ad4c6e169ebc58819a1cf62baa835f32f9fd9bd680a16d04fbabe65f5fe07b70f251d7221421be944a5e8226b489cd2099f625926243a1505bcba0
6
+ metadata.gz: 1f1b848071bce7431e0f2de516e5ab314397be2a0df0c4447c744e4489032e9b509bc540bc5a69fdae170d2a619dfce8eeb9292f33aaf63cc6624e719afe2275
7
+ data.tar.gz: 771350b8e375aa0a6399dcce5f17f335b87d612e65d346eb5a5db1e19b65114e30f39be5edb3bdff1303d743e7dd04bcd2ebcf0fda1b7df5233c47d72ebcf7e8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0] - 2026-03-03
4
+
5
+ ### Fixed
6
+ - Resuming a session that had a context continuation now auto-follows to the latest session ID instead of jumping back to the old one
7
+ - Re-bookmarking (`/bm`) in a continued session now uses the detected (newest) session ID instead of the stale env var
8
+
9
+ ### Changed
10
+ - `resume_session` detects newer `.jsonl` files and auto-migrates the bookmark before resuming
11
+ - `cc-bookmark` prefers detected session ID over `CC_SESSION_ID` env var in bookmark mode
12
+ - Old bookmarks and breadcrumbs cleaned up automatically during migration
13
+
3
14
  ## [1.3.0] - 2026-02-27
4
15
 
5
16
  ### Added
data/README.md CHANGED
@@ -19,6 +19,7 @@ meaningful names and quickly resume them.
19
19
  - **Resume sessions** with `cc tag` from anywhere
20
20
  - **Interactive list** with `cc -l` (arrow keys or j/k to navigate)
21
21
  - **Running indicator** shows green `●` next to active sessions in `cc -l`
22
+ - **Auto-follow continuations** — when Claude creates a new session (context reset), `cc` detects it and resumes the latest session automatically
22
23
  - **Delete bookmarks** with `d` in list or `cc -d tag`
23
24
  - **Auto-install** the `/bm` command and permission on first run
24
25
  - **Zero dependencies** - pure Ruby
data/bin/cc CHANGED
@@ -390,10 +390,26 @@ def resume_session(session_id, path)
390
390
  exit 1
391
391
  end
392
392
 
393
- # Save resume breadcrumb so cc-bookmark can track session continuations
394
- # (when context resets, Claude creates a new session ID)
395
393
  bookmarks = load_bookmarks
396
394
  entry = bookmarks['sessions'][session_id]
395
+
396
+ # Auto-migrate: if a newer session exists (context continuation), use it
397
+ unless session_id.start_with?('path:')
398
+ session_dir = resolve_session_dir(path)
399
+ newest_id = detect_session_id(session_dir)
400
+ if newest_id && newest_id != session_id && entry
401
+ puts dim("Session was continued — following to latest.")
402
+ bookmarks['sessions'].delete(session_id)
403
+ bookmarks['sessions'][newest_id] = entry
404
+ save_bookmarks(bookmarks)
405
+ # Clean up old breadcrumb if any
406
+ FileUtils.rm_f(File.join(CONFIG_DIR, 'resumed', "#{session_id}.json"))
407
+ session_id = newest_id
408
+ end
409
+ end
410
+
411
+ # Save resume breadcrumb so cc-bookmark can track session continuations
412
+ # (when context resets, Claude creates a new session ID)
397
413
  if entry && !session_id.start_with?('path:')
398
414
  resume_dir = File.join(CONFIG_DIR, 'resumed')
399
415
  FileUtils.mkdir_p(resume_dir)
data/bin/cc-bookmark CHANGED
@@ -170,8 +170,16 @@ if tags.empty?
170
170
  end
171
171
  else
172
172
  # Bookmark mode: set tags for current session
173
- # Prefer env var session ID, then detected, then path-based
174
- key = original_id || session_id || "path:#{cwd}"
173
+ # Prefer detected (newest) session ID over env var — the env var may be stale
174
+ # after a context continuation where Claude created a new session ID
175
+ key = session_id || original_id || "path:#{cwd}"
176
+
177
+ # Clean up old bookmark if session ID changed (migration)
178
+ if original_id && original_id != key && bookmarks['sessions'][original_id]
179
+ bookmarks['sessions'].delete(original_id)
180
+ FileUtils.rm_f(File.join(RESUME_DIR, "#{original_id}.json"))
181
+ end
182
+
175
183
  bookmarks['sessions'][key] = { 'path' => cwd, 'tags' => tags }
176
184
  save_bookmarks(bookmarks)
177
185
  puts "Bookmarked: #{cwd}"
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cc-sessions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-27 00:00:00.000000000 Z
11
+ date: 2026-03-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'A simple tool for bookmarking and resuming Claude Code sessions. Tag
14
14
  sessions with meaningful names using /bm inside Claude Code, then quickly resume
15
- them with ''cc <tag>'' from anywhere. v1.3.0: Running session indicator, resume
16
- breadcrumbs, env-var session tracking.'
15
+ them with ''cc <tag>'' from anywhere. v1.4.0: Auto-follows context continuations
16
+ to latest session on resume.'
17
17
  email:
18
18
  - g@isene.com
19
19
  executables: