cc-sessions 1.4.0 → 1.4.2

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/bin/cc-bookmark +20 -3
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c743c60e405530074e227bd6f4b02165cd78c217f0485898bf91505300db5eb
4
- data.tar.gz: 5137132931a0bba947285cf71c36e64b978495ef6235128d56e6841702ca093b
3
+ metadata.gz: cad93912f48c81f33e5532c4a6015164d192899ba9e0bcaaa6a434270e99f881
4
+ data.tar.gz: b3600372722bcd711e490dacbb52e298cb45f1ffc7438c47bbae87dad0d17088
5
5
  SHA512:
6
- metadata.gz: 1f1b848071bce7431e0f2de516e5ab314397be2a0df0c4447c744e4489032e9b509bc540bc5a69fdae170d2a619dfce8eeb9292f33aaf63cc6624e719afe2275
7
- data.tar.gz: 771350b8e375aa0a6399dcce5f17f335b87d612e65d346eb5a5db1e19b65114e30f39be5edb3bdff1303d743e7dd04bcd2ebcf0fda1b7df5233c47d72ebcf7e8
6
+ metadata.gz: 3f575d1ae31c07665d31b1e31ae25f5bf509bc3a5c23f5598d44d9720d7e870cbc0e15ecb55a2c2ad34ac399bff45bf5bfb97688d02ba2cb5df10e0b79feb1f7
7
+ data.tar.gz: 8fb66ea0011e696e15161e7e3dbdf2a13b83dfcc4c3abba8ab8148d8d400d208c4bcfba4fce580aae05c4a0855ad3165290e98807fe1843fd802aa320f65f81e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.2] - 2026-03-03
4
+
5
+ ### Fixed
6
+ - `cc-bookmark` now uses the bookmark's stored path (not bash cwd) for session detection when `CC_SESSION_ID` is set — prevents migration to wrong project when cwd drifts during a session
7
+
8
+ ## [1.4.1] - 2026-03-03
9
+
10
+ ### Fixed
11
+ - `cc-bookmark` query mode now proactively migrates bookmarks when a context continuation is detected (was only printing tags without migrating)
12
+ - Hook now detects new session IDs by comparing newest `.jsonl` against a stamp, instead of only running once per `CC_SESSION_ID`
13
+
14
+ ### Changed
15
+ - Hook outputs "Bookmark auto-migrated" when migration happens during a continuation
16
+ - Migration prints "Bookmark migrated:" instead of "Current bookmark:" so the hook can distinguish migration from no-op
17
+
3
18
  ## [1.4.0] - 2026-03-03
4
19
 
5
20
  ### Fixed
data/bin/cc-bookmark CHANGED
@@ -103,8 +103,16 @@ end
103
103
  FileUtils.mkdir_p(CONFIG_DIR) unless Dir.exist?(CONFIG_DIR)
104
104
 
105
105
  bookmarks = load_bookmarks
106
- cwd = resolve_session_dir(Dir.pwd)
107
106
  original_id = ENV['CC_SESSION_ID'] # Set by `cc` wrapper — reliable
107
+
108
+ # Use the bookmark's stored path (not Dir.pwd) when CC_SESSION_ID is set,
109
+ # because bash cwd can drift to other directories during the session.
110
+ if original_id
111
+ orig_entry = bookmarks['sessions'][original_id]
112
+ cwd = resolve_session_dir(orig_entry['path']) if orig_entry
113
+ end
114
+ cwd ||= resolve_session_dir(Dir.pwd)
115
+
108
116
  session_id = detect_session_id(cwd) # Fallback — picks newest .jsonl
109
117
  tags = ARGV
110
118
 
@@ -114,8 +122,17 @@ if tags.empty?
114
122
  if original_id
115
123
  entry = bookmarks['sessions'][original_id]
116
124
  if entry
117
- # Session ID hasn't changed, or bookmark is still on the original ID
118
- puts "Current bookmark: #{entry['tags'].join(', ')}"
125
+ # Check if session was continued (newer .jsonl exists)
126
+ if session_id && session_id != original_id
127
+ # Migrate bookmark to the new session ID
128
+ bookmarks['sessions'].delete(original_id)
129
+ bookmarks['sessions'][session_id] = entry
130
+ save_bookmarks(bookmarks)
131
+ FileUtils.rm_f(File.join(RESUME_DIR, "#{original_id}.json"))
132
+ puts "Bookmark migrated: #{entry['tags'].join(', ')}"
133
+ else
134
+ puts "Current bookmark: #{entry['tags'].join(', ')}"
135
+ end
119
136
  else
120
137
  # Session ID changed (compaction/context reset).
121
138
  # The bookmark is on the original ID but CC created a new session.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cc-sessions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -12,8 +12,8 @@ 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.4.0: Auto-follows context continuations
16
- to latest session on resume.'
15
+ them with ''cc <tag>'' from anywhere. v1.4.2: Fix cwd drift in session detection
16
+ on context continuations via hook.'
17
17
  email:
18
18
  - g@isene.com
19
19
  executables: