cc-sessions 1.0.1 → 1.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +23 -13
- data/bin/cc +1 -1
- data/bin/cc-bookmark +37 -0
- data/commands/bm.md +7 -35
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76dc4063f182c1d78b8eead156b8e57ffe2728198e72ae30efbcd3234a7fc2a6
|
|
4
|
+
data.tar.gz: 4f739bbcde871c0db6b0473480ab2063d7777ea1ab73f5051fa7c6c6dc104b5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6998837a2bde9b9ce143d47f85d39e5cf1d12ac010849c8971ad1470b7e31d67a712668530a4fa960300e61140fa54e677ade91151bed102805ca4cf8e95cc1c
|
|
7
|
+
data.tar.gz: 2990b688c7cef2a6c87559aa5ed8d6ecd933a4741f84c4af8d965024297a11bc9ef52c7948a81d82da5bd2f8eabeb3e77481cfe594a8fecdfd8423f11722e12d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.2] - 2025-01-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `cc-bookmark` helper script for reliable permission matching
|
|
7
|
+
- SVG logo
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- `/bm` command now uses `cc-bookmark` script (auto-accepts without prompts)
|
|
11
|
+
- Updated README with badges and proper logo placement
|
|
12
|
+
|
|
3
13
|
## [1.0.1] - 2025-01-23
|
|
4
14
|
|
|
5
15
|
### Added
|
data/README.md
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
# CC-sessions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
 [](https://badge.fury.io/rb/cc-sessions) 
|
|
4
|
+
|
|
5
|
+
<img src="img/cc-sessions_logo.svg" align="left" width="150" height="150">
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A simple tool for bookmarking and resuming Claude Code sessions with tags.
|
|
6
8
|
|
|
7
9
|
Claude Code sessions are tied to directories, making it hard to remember where
|
|
8
10
|
you were working on specific projects. This tool lets you tag sessions with
|
|
9
11
|
meaningful names and quickly resume them.
|
|
10
12
|
|
|
13
|
+
<br clear="left"/>
|
|
14
|
+
|
|
11
15
|
## Features
|
|
12
16
|
|
|
13
17
|
- **Bookmark sessions** with `/bm tag1 tag2` inside Claude Code
|
|
14
18
|
- **Resume sessions** with `cc tag` from anywhere
|
|
15
19
|
- **List bookmarks** with `cc -l`
|
|
16
|
-
- **Auto-install** the `/bm` command on first run
|
|
20
|
+
- **Auto-install** the `/bm` command and permission on first run
|
|
17
21
|
|
|
18
22
|
## Installation
|
|
19
23
|
|
|
24
|
+
### From RubyGems (Recommended)
|
|
25
|
+
|
|
20
26
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
cd CC-sessions
|
|
27
|
+
gem install cc-sessions
|
|
28
|
+
```
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
export PATH="$HOME/path/to/CC-sessions/bin:$PATH"
|
|
30
|
+
### From Source
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/isene/CC-sessions.git
|
|
34
|
+
cd CC-sessions
|
|
35
|
+
./install.sh
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
## Usage
|
|
@@ -60,8 +66,11 @@ cc -h
|
|
|
60
66
|
|
|
61
67
|
### First Run
|
|
62
68
|
|
|
63
|
-
On first run, `cc` automatically
|
|
64
|
-
|
|
69
|
+
On first run, `cc` automatically:
|
|
70
|
+
1. Installs the `/bm` command to `~/.claude/commands/`
|
|
71
|
+
2. Adds auto-accept permission to `~/.claude/settings.json`
|
|
72
|
+
|
|
73
|
+
This enables `/bm` to work without confirmation prompts.
|
|
65
74
|
|
|
66
75
|
## Files
|
|
67
76
|
|
|
@@ -69,6 +78,7 @@ This enables the `/bm` command inside Claude Code.
|
|
|
69
78
|
|------|---------|
|
|
70
79
|
| `~/.cc-sessions/bookmarks.json` | Stores your bookmarks |
|
|
71
80
|
| `~/.claude/commands/bm.md` | The `/bm` command definition |
|
|
81
|
+
| `~/.claude/settings.json` | Permission for auto-accept |
|
|
72
82
|
|
|
73
83
|
## Example Workflow
|
|
74
84
|
|
|
@@ -91,4 +101,4 @@ cc rtfm # Instantly back in that session
|
|
|
91
101
|
|
|
92
102
|
## License
|
|
93
103
|
|
|
94
|
-
|
|
104
|
+
This software is released into the public domain under [The Unlicense](https://unlicense.org/).
|
data/bin/cc
CHANGED
|
@@ -21,7 +21,7 @@ BOOKMARKS_FILE = File.join(CONFIG_DIR, 'bookmarks.json')
|
|
|
21
21
|
COMMAND_SOURCE = File.expand_path('../commands/bm.md', __dir__)
|
|
22
22
|
COMMAND_DEST = File.expand_path('~/.claude/commands/bm.md')
|
|
23
23
|
SETTINGS_FILE = File.expand_path('~/.claude/settings.json')
|
|
24
|
-
BM_PERMISSION = 'Bash(
|
|
24
|
+
BM_PERMISSION = 'Bash(cc-bookmark:*)'
|
|
25
25
|
|
|
26
26
|
def ensure_setup
|
|
27
27
|
# Create config directory
|
data/bin/cc-bookmark
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# CC-Bookmark - Helper script for /bm command
|
|
5
|
+
# Bookmarks the current directory with tags
|
|
6
|
+
|
|
7
|
+
require 'json'
|
|
8
|
+
require 'fileutils'
|
|
9
|
+
|
|
10
|
+
CONFIG_DIR = File.expand_path('~/.cc-sessions')
|
|
11
|
+
BOOKMARKS_FILE = File.join(CONFIG_DIR, 'bookmarks.json')
|
|
12
|
+
|
|
13
|
+
FileUtils.mkdir_p(CONFIG_DIR) unless Dir.exist?(CONFIG_DIR)
|
|
14
|
+
|
|
15
|
+
bookmarks = if File.exist?(BOOKMARKS_FILE)
|
|
16
|
+
JSON.parse(File.read(BOOKMARKS_FILE))
|
|
17
|
+
else
|
|
18
|
+
{}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
cwd = Dir.pwd
|
|
22
|
+
tags = ARGV
|
|
23
|
+
|
|
24
|
+
if tags.empty?
|
|
25
|
+
if bookmarks[cwd]
|
|
26
|
+
puts "Current bookmark: #{bookmarks[cwd].join(', ')}"
|
|
27
|
+
else
|
|
28
|
+
puts "No bookmark for this directory. Usage: /bm tag1 tag2 ..."
|
|
29
|
+
end
|
|
30
|
+
else
|
|
31
|
+
bookmarks[cwd] = tags
|
|
32
|
+
File.write(BOOKMARKS_FILE, JSON.pretty_generate(bookmarks))
|
|
33
|
+
puts "Bookmarked: #{cwd}"
|
|
34
|
+
puts "Tags: #{tags.join(', ')}"
|
|
35
|
+
puts ""
|
|
36
|
+
puts "Resume later with: cc #{tags.first}"
|
|
37
|
+
end
|
data/commands/bm.md
CHANGED
|
@@ -10,44 +10,16 @@ The user provides space-separated tags after `/bm`. For example:
|
|
|
10
10
|
|
|
11
11
|
## What to Do
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
2. Parse the tags from the command arguments (the text after `/bm`)
|
|
15
|
-
3. Store the bookmark in `~/.cc-sessions/bookmarks.json`
|
|
16
|
-
4. If no tags provided, show current bookmark for this directory (if any)
|
|
17
|
-
|
|
18
|
-
## Implementation
|
|
19
|
-
|
|
20
|
-
Run this bash command, replacing `$TAGS` with the actual tags provided:
|
|
13
|
+
Run the cc-bookmark command with the provided tags:
|
|
21
14
|
|
|
22
15
|
```bash
|
|
23
|
-
|
|
24
|
-
file = File.expand_path("~/.cc-sessions/bookmarks.json")
|
|
25
|
-
bookmarks = File.exist?(file) ? JSON.parse(File.read(file)) : {}
|
|
26
|
-
cwd = Dir.pwd
|
|
27
|
-
tags = ARGV
|
|
28
|
-
if tags.empty?
|
|
29
|
-
if bookmarks[cwd]
|
|
30
|
-
puts "Current bookmark: #{bookmarks[cwd].join(", ")}"
|
|
31
|
-
else
|
|
32
|
-
puts "No bookmark for this directory. Usage: /bm tag1 tag2 ..."
|
|
33
|
-
end
|
|
34
|
-
else
|
|
35
|
-
bookmarks[cwd] = tags
|
|
36
|
-
File.write(file, JSON.pretty_generate(bookmarks))
|
|
37
|
-
puts "Bookmarked: #{cwd}"
|
|
38
|
-
puts "Tags: #{tags.join(", ")}"
|
|
39
|
-
puts ""
|
|
40
|
-
puts "Resume later with: cc #{tags.first}"
|
|
41
|
-
end
|
|
42
|
-
' $TAGS
|
|
16
|
+
cc-bookmark $TAGS
|
|
43
17
|
```
|
|
44
18
|
|
|
45
|
-
|
|
19
|
+
Replace `$TAGS` with the actual tags provided by the user.
|
|
46
20
|
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
Bookmarked: /path/to/session
|
|
50
|
-
Tags: tag1, tag2, tag3
|
|
21
|
+
## Example
|
|
51
22
|
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
User types: `/bm rtfm ruby`
|
|
24
|
+
|
|
25
|
+
Run: `cc-bookmark rtfm ruby`
|
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.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geir Isene
|
|
@@ -17,6 +17,7 @@ email:
|
|
|
17
17
|
- g@isene.com
|
|
18
18
|
executables:
|
|
19
19
|
- cc
|
|
20
|
+
- cc-bookmark
|
|
20
21
|
extensions: []
|
|
21
22
|
extra_rdoc_files: []
|
|
22
23
|
files:
|
|
@@ -24,6 +25,7 @@ files:
|
|
|
24
25
|
- LICENSE
|
|
25
26
|
- README.md
|
|
26
27
|
- bin/cc
|
|
28
|
+
- bin/cc-bookmark
|
|
27
29
|
- commands/bm.md
|
|
28
30
|
homepage: https://github.com/isene/CC-sessions
|
|
29
31
|
licenses:
|