cc-sessions 1.1.2 → 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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/bin/cc +44 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08f5aaa3822c2214d30f6ec9638c598224c9a0e183f0658f38a01e2f67a430a2'
4
- data.tar.gz: 99647df99dad310ed40b44a2f5006caf6a069c4b5fe72f3cb8bfc65b68d63c93
3
+ metadata.gz: 06e2ca6f4ef6b30f3405ddb5be9af6f30c0c9f9d2b3d71882df8b4fc3f37d043
4
+ data.tar.gz: b021936ca48295dbe300b366cc1fef360be465559dd4fc94195b67a96b8a2d0b
5
5
  SHA512:
6
- metadata.gz: c3139c6b7a3050fc1ee632641cfedf895a1b2df284cce4a1fc8f5c826471b5f2b0521e10ca98b876cac94c302fb96c3acf45d8fdf9bae8ce02ae7b0c482d52c6
7
- data.tar.gz: abc0b29d3b81eea62d5b21acba5d1973f1e071dfafc59d23ab0f00d6e8a465a039a784bc9d5ccaf58c6dc58fcbc206cd3cea076404c520a83ee865566f1559c7
6
+ metadata.gz: 74a0948aba216611e7d6f6b0816e94f2371ab7861f3f23eff90f33631165149290036b106a902073e4d1131c3a6e7d4a3f7babf4046b9086e76543750490417d
7
+ data.tar.gz: dc30be2e052937a75d2a8688583d26668f828ae65f94170527c05c57e5093d41b9657cd4c3c2734e2fb1b5d51df3b9e60cd5841c50b8a41fe75a4d99c0aa4809
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## [1.1.2] - 2025-01-23
4
10
 
5
11
  ### Added
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])
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.2
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-01-24 00:00:00.000000000 Z
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