cc-sessions 1.1.1 → 1.1.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +3 -1
- data/bin/cc +44 -0
- data/commands/bm.md +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06e2ca6f4ef6b30f3405ddb5be9af6f30c0c9f9d2b3d71882df8b4fc3f37d043
|
|
4
|
+
data.tar.gz: b021936ca48295dbe300b366cc1fef360be465559dd4fc94195b67a96b8a2d0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74a0948aba216611e7d6f6b0816e94f2371ab7861f3f23eff90f33631165149290036b106a902073e4d1131c3a6e7d4a3f7babf4046b9086e76543750490417d
|
|
7
|
+
data.tar.gz: dc30be2e052937a75d2a8688583d26668f828ae65f94170527c05c57e5093d41b9657cd4c3c2734e2fb1b5d51df3b9e60cd5841c50b8a41fe75a4d99c0aa4809
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.3] - 2025-02-04
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `cc -C` / `cc --current` to show currently running Claude Code sessions
|
|
7
|
+
- Shows PID, working directory, and tags for each running session
|
|
8
|
+
|
|
9
|
+
## [1.1.2] - 2025-01-23
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `/bm?` command to check current bookmark status
|
|
13
|
+
|
|
3
14
|
## [1.1.1] - 2025-01-23
|
|
4
15
|
|
|
5
16
|
### Changed
|
data/README.md
CHANGED
|
@@ -15,6 +15,7 @@ meaningful names and quickly resume them.
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
17
|
- **Bookmark sessions** with `/bm tag1 tag2` inside Claude Code
|
|
18
|
+
- **Check bookmark** with `/bm?` to see current tags
|
|
18
19
|
- **Resume sessions** with `cc tag` from anywhere
|
|
19
20
|
- **Interactive list** with `cc -l` (arrow keys or j/k to navigate)
|
|
20
21
|
- **Delete bookmarks** with `d` in list or `cc -d tag`
|
|
@@ -44,7 +45,8 @@ cd CC-sessions
|
|
|
44
45
|
Inside a Claude Code session, use the `/bm` command:
|
|
45
46
|
|
|
46
47
|
```
|
|
47
|
-
/bm rtfm ruby filemanager
|
|
48
|
+
/bm rtfm ruby filemanager # Bookmark with tags
|
|
49
|
+
/bm? # Show current bookmark status
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
This bookmarks the current session with three tags. You can later resume it
|
data/bin/cc
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
# cc - Continue session in current dir, or start new
|
|
9
9
|
# cc <tag> - Resume session bookmarked with <tag>
|
|
10
10
|
# cc -l, --list - List all bookmarked sessions
|
|
11
|
+
# cc -C, --current - Show currently running Claude Code sessions
|
|
11
12
|
# cc -h, --help - Show help
|
|
12
13
|
#
|
|
13
14
|
# Bookmarking (in Claude Code):
|
|
@@ -19,6 +20,7 @@ require 'io/console'
|
|
|
19
20
|
|
|
20
21
|
# Simple ANSI helpers
|
|
21
22
|
def cyan(s) = "\e[36m#{s}\e[0m"
|
|
23
|
+
def green(s) = "\e[32m#{s}\e[0m"
|
|
22
24
|
def dim(s) = "\e[2m#{s}\e[0m"
|
|
23
25
|
def red(s) = "\e[31m#{s}\e[0m"
|
|
24
26
|
def rev(s) = "\e[7m#{s}\e[0m"
|
|
@@ -79,6 +81,44 @@ rescue JSON::ParserError
|
|
|
79
81
|
{}
|
|
80
82
|
end
|
|
81
83
|
|
|
84
|
+
def find_tags_for_path(path, bookmarks)
|
|
85
|
+
bookmarks[path] || []
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def show_current_sessions
|
|
89
|
+
# Find running claude processes (exclude grep itself and this script)
|
|
90
|
+
pids = `pgrep -x claude 2>/dev/null`.split.map(&:to_i)
|
|
91
|
+
|
|
92
|
+
if pids.empty?
|
|
93
|
+
puts "No Claude Code sessions currently running."
|
|
94
|
+
return
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
bookmarks = load_bookmarks
|
|
98
|
+
|
|
99
|
+
puts "Currently running Claude Code sessions:\n\n"
|
|
100
|
+
|
|
101
|
+
pids.each do |pid|
|
|
102
|
+
# Get working directory from /proc
|
|
103
|
+
cwd_link = "/proc/#{pid}/cwd"
|
|
104
|
+
next unless File.exist?(cwd_link)
|
|
105
|
+
|
|
106
|
+
begin
|
|
107
|
+
cwd = File.readlink(cwd_link)
|
|
108
|
+
tags = find_tags_for_path(cwd, bookmarks)
|
|
109
|
+
tag_str = tags.empty? ? dim('(no tags)') : green(tags.join(', '))
|
|
110
|
+
|
|
111
|
+
puts " PID #{cyan(pid.to_s)}: #{cwd}"
|
|
112
|
+
puts " Tags: #{tag_str}"
|
|
113
|
+
puts
|
|
114
|
+
rescue Errno::EACCES
|
|
115
|
+
# Can't read cwd for this process
|
|
116
|
+
puts " PID #{cyan(pid.to_s)}: #{dim('(permission denied)')}"
|
|
117
|
+
puts
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
82
122
|
def find_session_by_tag(tag)
|
|
83
123
|
bookmarks = load_bookmarks
|
|
84
124
|
bookmarks.each do |path, tags|
|
|
@@ -243,6 +283,7 @@ def show_help
|
|
|
243
283
|
cc Continue session in current dir, or start new
|
|
244
284
|
cc <tag> Resume session bookmarked with <tag>
|
|
245
285
|
cc -l, --list Interactive list of bookmarked sessions
|
|
286
|
+
cc -C, --current Show currently running Claude Code sessions
|
|
246
287
|
cc -d, --delete <tag> Delete bookmark matching <tag>
|
|
247
288
|
cc -h, --help Show this help
|
|
248
289
|
|
|
@@ -253,6 +294,7 @@ def show_help
|
|
|
253
294
|
cc rtfm Resume session tagged 'rtfm'
|
|
254
295
|
cc Continue in current dir or start fresh
|
|
255
296
|
cc -l Show interactive list (d to delete, Enter to select)
|
|
297
|
+
cc -C Show running sessions with their tags
|
|
256
298
|
cc -d rtfm Delete bookmark tagged 'rtfm'
|
|
257
299
|
|
|
258
300
|
FILES:
|
|
@@ -294,6 +336,8 @@ when '-h', '--help'
|
|
|
294
336
|
show_help
|
|
295
337
|
when '-l', '--list'
|
|
296
338
|
list_bookmarks
|
|
339
|
+
when '-C', '--current'
|
|
340
|
+
show_current_sessions
|
|
297
341
|
when '-d', '--delete'
|
|
298
342
|
if ARGV[1]
|
|
299
343
|
delete_bookmark_by_tag(ARGV[1])
|
data/commands/bm.md
CHANGED
|
@@ -4,22 +4,25 @@ Bookmark the current Claude Code session with tags for easy resumption later.
|
|
|
4
4
|
|
|
5
5
|
## Arguments
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- `/bm
|
|
9
|
-
- `/bm rtfm ruby filemanager` - multiple tags
|
|
7
|
+
- `/bm tag1 tag2` - Bookmark with tags
|
|
8
|
+
- `/bm?` or `/bm ?` - Show current bookmark status
|
|
10
9
|
|
|
11
10
|
## What to Do
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
If the argument is `?` or empty after `/bm?`:
|
|
13
|
+
```bash
|
|
14
|
+
cc-bookmark
|
|
15
|
+
```
|
|
14
16
|
|
|
17
|
+
Otherwise, run with the provided tags:
|
|
15
18
|
```bash
|
|
16
19
|
cc-bookmark $TAGS
|
|
17
20
|
```
|
|
18
21
|
|
|
19
22
|
Replace `$TAGS` with the actual tags provided by the user.
|
|
20
23
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
User types: `/bm rtfm ruby`
|
|
24
|
+
## Examples
|
|
24
25
|
|
|
25
|
-
Run: `cc-bookmark rtfm ruby`
|
|
26
|
+
- `/bm rtfm ruby` → Run: `cc-bookmark rtfm ruby`
|
|
27
|
+
- `/bm?` → Run: `cc-bookmark` (shows current bookmark)
|
|
28
|
+
- `/bm ?` → Run: `cc-bookmark` (shows current bookmark)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cc-sessions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.3
|
|
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-
|
|
11
|
+
date: 2026-02-04 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
|