claude-code-handoff 1.2.0 → 1.3.1
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.
- package/README.md +58 -8
- package/cli.js +17 -13
- package/commands/delete-handoff.md +67 -0
- package/commands/handoff.md +2 -2
- package/commands/resume.md +6 -8
- package/commands/save-handoff.md +3 -3
- package/install.sh +17 -13
- package/package.json +3 -2
- package/uninstall.sh +1 -0
- package/update.sh +75 -0
package/README.md
CHANGED
|
@@ -10,11 +10,33 @@
|
|
|
10
10
|
|
|
11
11
|
## The Problem
|
|
12
12
|
|
|
13
|
-
Claude Code
|
|
13
|
+
Claude Code operates within a **200K token context window**. As you work, every message, tool call, file read, and response consumes tokens. Eventually, the context fills up — and that's where things break.
|
|
14
|
+
|
|
15
|
+
### With auto-compact ON (default)
|
|
16
|
+
|
|
17
|
+
When context usage approaches the limit, Claude Code triggers **auto-compact**: it summarizes the entire conversation into a compressed buffer of approximately **33K tokens**. In theory, this lets you keep working without interruption. In practice, the summarization is **lossy** — Claude loses critical details:
|
|
18
|
+
|
|
19
|
+
- Exact file paths and line numbers discussed earlier
|
|
20
|
+
- Decision rationale ("why did we choose approach A over B?")
|
|
21
|
+
- Specific code patterns and variable names
|
|
22
|
+
- Nuanced context about edge cases and constraints
|
|
23
|
+
- What was already tried and failed
|
|
24
|
+
|
|
25
|
+
The result: Claude starts repeating mistakes, asking questions you already answered, and proposing solutions that were already rejected. Development quality degrades progressively with each compaction cycle.
|
|
26
|
+
|
|
27
|
+
### With auto-compact OFF
|
|
28
|
+
|
|
29
|
+
If you disable auto-compact to preserve full-fidelity context, you hit a hard wall: when the 200K window fills up, you **must** `/clear`. Total context loss. You start from absolute zero — re-explaining the project, the architecture, what was done, what's next.
|
|
30
|
+
|
|
31
|
+
### The real cost
|
|
32
|
+
|
|
33
|
+
Either way, you lose. Auto-compact gives you a degraded Claude that forgets. Manual clear gives you an amnesiac Claude that knows nothing. Both waste tokens, time, and developer patience.
|
|
34
|
+
|
|
35
|
+
**This is the problem claude-code-handoff solves.**
|
|
14
36
|
|
|
15
37
|
## The Solution
|
|
16
38
|
|
|
17
|
-
**claude-code-handoff**
|
|
39
|
+
Instead of relying on lossy compression or starting from zero, **claude-code-handoff** gives Claude **structured persistent memory** — 5 slash commands that capture exactly what matters and restore it cleanly:
|
|
18
40
|
|
|
19
41
|
| Command | Description |
|
|
20
42
|
|---------|-------------|
|
|
@@ -22,6 +44,9 @@ Claude Code loses all context when you `/clear` or start a new session. Long-run
|
|
|
22
44
|
| `/resume` | Resume from a saved session — interactive picker |
|
|
23
45
|
| `/save-handoff` | Save with options — choose where and how |
|
|
24
46
|
| `/switch-context <topic>` | Switch between parallel workstreams |
|
|
47
|
+
| `/delete-handoff` | Delete one or more saved handoffs |
|
|
48
|
+
|
|
49
|
+
The workflow becomes: work until context is full → `/handoff` → `/clear` → `/resume` → continue with full context. No degradation, no amnesia. Just clean handoffs.
|
|
25
50
|
|
|
26
51
|
Session state is stored in `.claude/handoffs/` (gitignored) — each developer keeps their own context, no conflicts.
|
|
27
52
|
|
|
@@ -34,7 +59,7 @@ cd your-project
|
|
|
34
59
|
npx claude-code-handoff
|
|
35
60
|
```
|
|
36
61
|
|
|
37
|
-
That's it. Open Claude Code and your
|
|
62
|
+
That's it. Open Claude Code and your 5 commands are ready.
|
|
38
63
|
|
|
39
64
|
---
|
|
40
65
|
|
|
@@ -133,7 +158,7 @@ graph TD
|
|
|
133
158
|
|
|
134
159
|
```bash
|
|
135
160
|
cd your-project
|
|
136
|
-
npx claude-code-handoff
|
|
161
|
+
npx claude-code-handoff@1.3.0
|
|
137
162
|
```
|
|
138
163
|
|
|
139
164
|
### Option B: curl
|
|
@@ -160,7 +185,8 @@ your-project/
|
|
|
160
185
|
│ ├── handoff.md ← /handoff (auto-save)
|
|
161
186
|
│ ├── resume.md ← /resume (interactive picker)
|
|
162
187
|
│ ├── save-handoff.md ← /save-handoff (wizard)
|
|
163
|
-
│
|
|
188
|
+
│ ├── switch-context.md ← /switch-context (workstream switch)
|
|
189
|
+
│ └── delete-handoff.md ← /delete-handoff (remove handoffs)
|
|
164
190
|
├── rules/
|
|
165
191
|
│ └── session-continuity.md ← Auto-loaded behavioral rules
|
|
166
192
|
└── handoffs/ ← Session state (gitignored)
|
|
@@ -327,7 +353,31 @@ The installer adds a `session-continuity.md` rules file that Claude auto-loads o
|
|
|
327
353
|
|
|
328
354
|
- **On session start**: Claude knows `_active.md` exists but doesn't read it unless asked
|
|
329
355
|
- **During work**: Claude proactively reminds you to save after significant milestones
|
|
330
|
-
- **Command awareness**: Claude understands all
|
|
356
|
+
- **Command awareness**: Claude understands all 5 commands natively
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Update
|
|
361
|
+
|
|
362
|
+
Update commands and rules to the latest version without touching your handoff data:
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
cd your-project
|
|
366
|
+
npx claude-code-handoff@latest
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Or via curl:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
cd your-project
|
|
373
|
+
curl -fsSL https://raw.githubusercontent.com/eximIA-Ventures/claude-code-handoff/main/update.sh | bash
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
This will:
|
|
377
|
+
- Overwrite command files with the latest versions
|
|
378
|
+
- Update the rules file
|
|
379
|
+
- Remove legacy Portuguese commands if present (`retomar`, `salvar-handoff`, `trocar-contexto`)
|
|
380
|
+
- **Not touch** your `.claude/handoffs/` data
|
|
331
381
|
|
|
332
382
|
---
|
|
333
383
|
|
|
@@ -339,7 +389,7 @@ curl -fsSL https://raw.githubusercontent.com/eximIA-Ventures/claude-code-handoff
|
|
|
339
389
|
```
|
|
340
390
|
|
|
341
391
|
The uninstaller:
|
|
342
|
-
- Removes all
|
|
392
|
+
- Removes all 5 command files
|
|
343
393
|
- Removes the rules file
|
|
344
394
|
- Preserves handoff data if sessions exist (won't delete your session history)
|
|
345
395
|
- Cleans `.gitignore` entries
|
|
@@ -347,7 +397,7 @@ The uninstaller:
|
|
|
347
397
|
|
|
348
398
|
Or remove manually:
|
|
349
399
|
```bash
|
|
350
|
-
rm .claude/commands/{handoff,resume,save-handoff,switch-context}.md
|
|
400
|
+
rm .claude/commands/{handoff,resume,save-handoff,switch-context,delete-handoff}.md
|
|
351
401
|
rm .claude/rules/session-continuity.md
|
|
352
402
|
rm -rf .claude/handoffs/ # ⚠️ deletes all session history
|
|
353
403
|
```
|
package/cli.js
CHANGED
|
@@ -36,26 +36,27 @@ function copyFile(src, dst) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// 1. Create directories
|
|
39
|
-
console.log(` ${YELLOW}[1/
|
|
39
|
+
console.log(` ${YELLOW}[1/8]${NC} Creating directories...`);
|
|
40
40
|
ensureDir(path.join(CLAUDE_DIR, 'commands'));
|
|
41
41
|
ensureDir(path.join(CLAUDE_DIR, 'rules'));
|
|
42
42
|
ensureDir(path.join(CLAUDE_DIR, 'handoffs', 'archive'));
|
|
43
43
|
|
|
44
44
|
// 2. Copy commands
|
|
45
|
-
console.log(` ${YELLOW}[2/
|
|
45
|
+
console.log(` ${YELLOW}[2/8]${NC} Installing commands...`);
|
|
46
46
|
copyFile('commands/resume.md', path.join(CLAUDE_DIR, 'commands', 'resume.md'));
|
|
47
47
|
copyFile('commands/save-handoff.md', path.join(CLAUDE_DIR, 'commands', 'save-handoff.md'));
|
|
48
48
|
copyFile('commands/switch-context.md', path.join(CLAUDE_DIR, 'commands', 'switch-context.md'));
|
|
49
49
|
copyFile('commands/handoff.md', path.join(CLAUDE_DIR, 'commands', 'handoff.md'));
|
|
50
|
+
copyFile('commands/delete-handoff.md', path.join(CLAUDE_DIR, 'commands', 'delete-handoff.md'));
|
|
50
51
|
|
|
51
52
|
// 3. Copy rules
|
|
52
|
-
console.log(` ${YELLOW}[3/
|
|
53
|
+
console.log(` ${YELLOW}[3/8]${NC} Installing rules...`);
|
|
53
54
|
copyFile('rules/session-continuity.md', path.join(CLAUDE_DIR, 'rules', 'session-continuity.md'));
|
|
54
55
|
|
|
55
56
|
// 4. Create initial _active.md
|
|
56
57
|
const activePath = path.join(CLAUDE_DIR, 'handoffs', '_active.md');
|
|
57
58
|
if (!fs.existsSync(activePath)) {
|
|
58
|
-
console.log(` ${YELLOW}[4/
|
|
59
|
+
console.log(` ${YELLOW}[4/8]${NC} Creating initial handoff...`);
|
|
59
60
|
fs.writeFileSync(activePath, `# Session Handoff
|
|
60
61
|
|
|
61
62
|
> No active session yet. Use \`/handoff\` or \`/save-handoff\` to save your first session state.
|
|
@@ -82,11 +83,11 @@ if (!fs.existsSync(activePath)) {
|
|
|
82
83
|
(none)
|
|
83
84
|
`);
|
|
84
85
|
} else {
|
|
85
|
-
console.log(` ${YELLOW}[4/
|
|
86
|
+
console.log(` ${YELLOW}[4/8]${NC} Handoff already exists, keeping it`);
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
// 5. Update .gitignore
|
|
89
|
-
console.log(` ${YELLOW}[5/
|
|
90
|
+
console.log(` ${YELLOW}[5/8]${NC} Updating .gitignore...`);
|
|
90
91
|
const gitignorePath = path.join(PROJECT_DIR, '.gitignore');
|
|
91
92
|
if (fs.existsSync(gitignorePath)) {
|
|
92
93
|
const content = fs.readFileSync(gitignorePath, 'utf-8');
|
|
@@ -98,7 +99,7 @@ if (fs.existsSync(gitignorePath)) {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
// 6. Update CLAUDE.md
|
|
101
|
-
console.log(` ${YELLOW}[6/
|
|
102
|
+
console.log(` ${YELLOW}[6/8]${NC} Updating CLAUDE.md...`);
|
|
102
103
|
const claudeMdPath = path.join(CLAUDE_DIR, 'CLAUDE.md');
|
|
103
104
|
const continuityBlock = `## Session Continuity (MANDATORY)
|
|
104
105
|
|
|
@@ -123,17 +124,19 @@ if (fs.existsSync(claudeMdPath)) {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
// 7. Verify
|
|
126
|
-
console.log(` ${YELLOW}[7/
|
|
127
|
+
console.log(` ${YELLOW}[7/8]${NC} Verifying installation...`);
|
|
127
128
|
let installed = 0;
|
|
128
|
-
for (const f of ['resume.md', 'save-handoff.md', 'switch-context.md', 'handoff.md']) {
|
|
129
|
+
for (const f of ['resume.md', 'save-handoff.md', 'switch-context.md', 'handoff.md', 'delete-handoff.md']) {
|
|
129
130
|
if (fs.existsSync(path.join(CLAUDE_DIR, 'commands', f))) installed++;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
console.log('');
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
console.log(` ${YELLOW}[8/8]${NC} Done!`);
|
|
135
|
+
console.log('');
|
|
136
|
+
if (installed === 5) {
|
|
137
|
+
console.log(`${GREEN} Installed successfully! (${installed}/5 commands)${NC}`);
|
|
135
138
|
} else {
|
|
136
|
-
console.log(`${YELLOW} Partial install: ${installed}/
|
|
139
|
+
console.log(`${YELLOW} Partial install: ${installed}/5 commands${NC}`);
|
|
137
140
|
}
|
|
138
141
|
console.log('');
|
|
139
142
|
console.log(' Commands available:');
|
|
@@ -141,9 +144,10 @@ console.log(` ${CYAN}/handoff${NC} Auto-save session (no wizard)
|
|
|
141
144
|
console.log(` ${CYAN}/resume${NC} Resume with wizard`);
|
|
142
145
|
console.log(` ${CYAN}/save-handoff${NC} Save session state (wizard)`);
|
|
143
146
|
console.log(` ${CYAN}/switch-context${NC} Switch workstream`);
|
|
147
|
+
console.log(` ${CYAN}/delete-handoff${NC} Delete handoff(s)`);
|
|
144
148
|
console.log('');
|
|
145
149
|
console.log(' Files:');
|
|
146
|
-
console.log(' .claude/commands/
|
|
150
|
+
console.log(' .claude/commands/ 5 command files');
|
|
147
151
|
console.log(' .claude/rules/ session-continuity.md');
|
|
148
152
|
console.log(' .claude/handoffs/ session state (gitignored)');
|
|
149
153
|
console.log('');
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Delete Handoff
|
|
2
|
+
|
|
3
|
+
Delete one or more handoff files from the session continuity system.
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
### Step 1: Discover all handoffs
|
|
8
|
+
|
|
9
|
+
1. List all `.md` files in `.claude/handoffs/` (root) and `.claude/handoffs/archive/`
|
|
10
|
+
2. For each file found, read the first 10 lines to extract: **Active Workstream** and **Last Updated**
|
|
11
|
+
3. Skip files that are empty or contain only the default placeholder
|
|
12
|
+
|
|
13
|
+
### Step 2: Present wizard
|
|
14
|
+
|
|
15
|
+
Use the AskUserQuestion tool to present available handoffs.
|
|
16
|
+
|
|
17
|
+
Build the options list:
|
|
18
|
+
- For each handoff found: add as option with label "[workstream name]" and description showing last updated date + file path
|
|
19
|
+
- All handoffs are listed equally — no distinction between root and archive
|
|
20
|
+
- If NO handoffs exist, tell the user: "No handoffs found. Nothing to delete."
|
|
21
|
+
- Enable **multiSelect: true** so the user can select multiple handoffs at once
|
|
22
|
+
|
|
23
|
+
Question: "Which handoff(s) do you want to delete?"
|
|
24
|
+
Header: "Delete"
|
|
25
|
+
|
|
26
|
+
### Step 3: Confirm deletion
|
|
27
|
+
|
|
28
|
+
After the user selects, list the files that will be deleted and ask for confirmation using AskUserQuestion:
|
|
29
|
+
|
|
30
|
+
Question: "Confirm deletion of [count] handoff(s)? This cannot be undone."
|
|
31
|
+
Header: "Confirm"
|
|
32
|
+
Options:
|
|
33
|
+
- "Yes, delete" — "Permanently remove the selected handoff files"
|
|
34
|
+
- "Cancel" — "Keep all handoffs, do nothing"
|
|
35
|
+
|
|
36
|
+
### Step 4: Execute deletion
|
|
37
|
+
|
|
38
|
+
If confirmed:
|
|
39
|
+
1. Delete each selected `.md` file
|
|
40
|
+
2. Report what was deleted
|
|
41
|
+
|
|
42
|
+
Output:
|
|
43
|
+
```
|
|
44
|
+
## Handoffs deleted
|
|
45
|
+
|
|
46
|
+
- [workstream name] — `[file path]`
|
|
47
|
+
- [workstream name] — `[file path]`
|
|
48
|
+
|
|
49
|
+
[count] handoff(s) removed.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If cancelled:
|
|
53
|
+
```
|
|
54
|
+
Deletion cancelled. No handoffs were removed.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Shortcut
|
|
58
|
+
|
|
59
|
+
If `$ARGUMENTS` is provided (e.g., `/delete-handoff ws2-course-creator`):
|
|
60
|
+
- Search for a `.md` file matching `$ARGUMENTS` in `.claude/handoffs/` and `.claude/handoffs/archive/`
|
|
61
|
+
- If found, skip to Step 3 (confirm deletion) with that single file
|
|
62
|
+
- If not found, show the wizard with a note: "Handoff '$ARGUMENTS' not found. Choose from available:"
|
|
63
|
+
|
|
64
|
+
## Important
|
|
65
|
+
- ALWAYS confirm before deleting — never delete without explicit user approval
|
|
66
|
+
- Deletion is permanent — there is no archive/trash for deleted handoffs
|
|
67
|
+
- If the user selects all handoffs, warn: "This will remove ALL session handoffs."
|
package/commands/handoff.md
CHANGED
|
@@ -55,7 +55,7 @@ Write `.claude/handoffs/_active.md` with this template:
|
|
|
55
55
|
> Updated automatically. Read this to resume work after /clear.
|
|
56
56
|
|
|
57
57
|
## Last Updated
|
|
58
|
-
[YYYY-MM-DD] — [brief description of session]
|
|
58
|
+
[YYYY-MM-DD HH:MM] — [brief description of session]
|
|
59
59
|
|
|
60
60
|
## Active Workstream
|
|
61
61
|
**[workstream name]** — [one-line description]
|
|
@@ -68,7 +68,7 @@ Write `.claude/handoffs/_active.md` with this template:
|
|
|
68
68
|
|
|
69
69
|
## What Was Done
|
|
70
70
|
|
|
71
|
-
### Session 1 ([YYYY-MM-DD])
|
|
71
|
+
### Session 1 ([YYYY-MM-DD HH:MM])
|
|
72
72
|
- [concrete action 1]
|
|
73
73
|
- [concrete action 2]
|
|
74
74
|
- ...
|
package/commands/resume.md
CHANGED
|
@@ -6,17 +6,17 @@ Resume work from a previous session using the handoff system.
|
|
|
6
6
|
|
|
7
7
|
### Step 1: Discover all handoffs
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
9
|
+
1. List all `.md` files in `.claude/handoffs/` (root) and `.claude/handoffs/archive/`
|
|
10
|
+
2. For each file found, read the first 10 lines to extract: **Active Workstream**, **Last Updated**, and the first line of **What's Next**
|
|
11
|
+
3. Skip files that are empty or contain only the default placeholder
|
|
12
12
|
|
|
13
13
|
### Step 2: Present wizard
|
|
14
14
|
|
|
15
15
|
Use the AskUserQuestion tool to present available handoffs as options.
|
|
16
16
|
|
|
17
17
|
Build the options list:
|
|
18
|
-
-
|
|
19
|
-
-
|
|
18
|
+
- For each handoff found: add as option with label "[workstream name]" and description showing last updated date + first pending item
|
|
19
|
+
- All handoffs are listed equally — no "active" or "archived" distinction in the UI
|
|
20
20
|
- If NO handoffs exist at all, skip the wizard and tell the user: "No handoffs found. Use `/save-handoff` at the end of this session to create the first one."
|
|
21
21
|
|
|
22
22
|
Question: "Which session do you want to resume?"
|
|
@@ -64,12 +64,10 @@ Wait for user instruction before proceeding.
|
|
|
64
64
|
## Shortcut
|
|
65
65
|
|
|
66
66
|
If `$ARGUMENTS` is provided (e.g., `/resume auth-refactor`), skip the wizard:
|
|
67
|
-
-
|
|
68
|
-
- If not found, check if `_active.md` workstream slug matches `$ARGUMENTS`
|
|
67
|
+
- Search for a `.md` file matching `$ARGUMENTS` in `.claude/handoffs/` and `.claude/handoffs/archive/`
|
|
69
68
|
- If still not found, show the wizard with a note: "Handoff '$ARGUMENTS' not found. Choose from available:"
|
|
70
69
|
|
|
71
70
|
## Important
|
|
72
71
|
- Do NOT activate any agent automatically — let the user decide
|
|
73
72
|
- Do NOT start working — only present context and wait
|
|
74
73
|
- If the handoff references an agent (e.g., @architect), mention it but don't activate
|
|
75
|
-
- The wizard should clearly show which is the ACTIVE handoff vs archived ones
|
package/commands/save-handoff.md
CHANGED
|
@@ -75,7 +75,7 @@ Use this structure for the handoff content:
|
|
|
75
75
|
> Updated automatically. Read this to resume work after /clear.
|
|
76
76
|
|
|
77
77
|
## Last Updated
|
|
78
|
-
[
|
|
78
|
+
[YYYY-MM-DD HH:MM] — [brief description]
|
|
79
79
|
|
|
80
80
|
## Active Workstream
|
|
81
81
|
[workstream name and brief context]
|
|
@@ -88,10 +88,10 @@ Use this structure for the handoff content:
|
|
|
88
88
|
|
|
89
89
|
## What Was Done
|
|
90
90
|
|
|
91
|
-
### Session [N] ([
|
|
91
|
+
### Session [N] ([YYYY-MM-DD HH:MM])
|
|
92
92
|
[bullet points of concrete actions — be specific, not vague]
|
|
93
93
|
|
|
94
|
-
### Session [N-1] ([
|
|
94
|
+
### Session [N-1] ([YYYY-MM-DD HH:MM])
|
|
95
95
|
[preserve previous sessions — don't delete history]
|
|
96
96
|
|
|
97
97
|
## What's Next
|
package/install.sh
CHANGED
|
@@ -45,25 +45,26 @@ download_file() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
# 1. Create directories
|
|
48
|
-
echo -e " ${YELLOW}[1/
|
|
48
|
+
echo -e " ${YELLOW}[1/8]${NC} Creating directories..."
|
|
49
49
|
mkdir -p "$CLAUDE_DIR/commands"
|
|
50
50
|
mkdir -p "$CLAUDE_DIR/rules"
|
|
51
51
|
mkdir -p "$CLAUDE_DIR/handoffs/archive"
|
|
52
52
|
|
|
53
53
|
# 2. Download/copy commands
|
|
54
|
-
echo -e " ${YELLOW}[2/
|
|
54
|
+
echo -e " ${YELLOW}[2/8]${NC} Installing commands..."
|
|
55
55
|
download_file "commands/resume.md" "$CLAUDE_DIR/commands/resume.md"
|
|
56
56
|
download_file "commands/save-handoff.md" "$CLAUDE_DIR/commands/save-handoff.md"
|
|
57
57
|
download_file "commands/switch-context.md" "$CLAUDE_DIR/commands/switch-context.md"
|
|
58
58
|
download_file "commands/handoff.md" "$CLAUDE_DIR/commands/handoff.md"
|
|
59
|
+
download_file "commands/delete-handoff.md" "$CLAUDE_DIR/commands/delete-handoff.md"
|
|
59
60
|
|
|
60
61
|
# 3. Download/copy rules
|
|
61
|
-
echo -e " ${YELLOW}[3/
|
|
62
|
+
echo -e " ${YELLOW}[3/8]${NC} Installing rules..."
|
|
62
63
|
download_file "rules/session-continuity.md" "$CLAUDE_DIR/rules/session-continuity.md"
|
|
63
64
|
|
|
64
65
|
# 4. Create initial _active.md if not exists
|
|
65
66
|
if [ ! -f "$CLAUDE_DIR/handoffs/_active.md" ]; then
|
|
66
|
-
echo -e " ${YELLOW}[4/
|
|
67
|
+
echo -e " ${YELLOW}[4/8]${NC} Creating initial handoff..."
|
|
67
68
|
cat > "$CLAUDE_DIR/handoffs/_active.md" << 'HANDOFF'
|
|
68
69
|
# Session Handoff
|
|
69
70
|
|
|
@@ -91,11 +92,11 @@ if [ ! -f "$CLAUDE_DIR/handoffs/_active.md" ]; then
|
|
|
91
92
|
(none)
|
|
92
93
|
HANDOFF
|
|
93
94
|
else
|
|
94
|
-
echo -e " ${YELLOW}[4/
|
|
95
|
+
echo -e " ${YELLOW}[4/8]${NC} Handoff already exists, keeping it"
|
|
95
96
|
fi
|
|
96
97
|
|
|
97
98
|
# 5. Add to .gitignore
|
|
98
|
-
echo -e " ${YELLOW}[5/
|
|
99
|
+
echo -e " ${YELLOW}[5/8]${NC} Updating .gitignore..."
|
|
99
100
|
GITIGNORE="$PROJECT_DIR/.gitignore"
|
|
100
101
|
if [ -f "$GITIGNORE" ]; then
|
|
101
102
|
if ! grep -q ".claude/handoffs/" "$GITIGNORE" 2>/dev/null; then
|
|
@@ -109,7 +110,7 @@ else
|
|
|
109
110
|
fi
|
|
110
111
|
|
|
111
112
|
# 6. Add to CLAUDE.md
|
|
112
|
-
echo -e " ${YELLOW}[6/
|
|
113
|
+
echo -e " ${YELLOW}[6/8]${NC} Updating CLAUDE.md..."
|
|
113
114
|
CLAUDE_MD="$CLAUDE_DIR/CLAUDE.md"
|
|
114
115
|
CONTINUITY_BLOCK='## Session Continuity (MANDATORY)
|
|
115
116
|
|
|
@@ -150,17 +151,19 @@ CLAUDEMD
|
|
|
150
151
|
fi
|
|
151
152
|
|
|
152
153
|
# 7. Summary
|
|
153
|
-
echo -e " ${YELLOW}[7/
|
|
154
|
+
echo -e " ${YELLOW}[7/8]${NC} Verifying installation..."
|
|
154
155
|
INSTALLED=0
|
|
155
|
-
for f in resume.md save-handoff.md switch-context.md handoff.md; do
|
|
156
|
+
for f in resume.md save-handoff.md switch-context.md handoff.md delete-handoff.md; do
|
|
156
157
|
[ -f "$CLAUDE_DIR/commands/$f" ] && INSTALLED=$((INSTALLED + 1))
|
|
157
158
|
done
|
|
158
159
|
|
|
159
160
|
echo ""
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
echo -e " ${YELLOW}[8/8]${NC} Done!"
|
|
162
|
+
echo ""
|
|
163
|
+
if [ "$INSTALLED" -eq 5 ]; then
|
|
164
|
+
echo -e "${GREEN} Installed successfully! ($INSTALLED/5 commands)${NC}"
|
|
162
165
|
else
|
|
163
|
-
echo -e "${YELLOW} Partial install: $INSTALLED/
|
|
166
|
+
echo -e "${YELLOW} Partial install: $INSTALLED/5 commands${NC}"
|
|
164
167
|
fi
|
|
165
168
|
echo ""
|
|
166
169
|
echo -e " Commands available:"
|
|
@@ -168,9 +171,10 @@ echo -e " ${CYAN}/handoff${NC} Auto-save session (no wizard)"
|
|
|
168
171
|
echo -e " ${CYAN}/resume${NC} Resume with wizard"
|
|
169
172
|
echo -e " ${CYAN}/save-handoff${NC} Save session state (wizard)"
|
|
170
173
|
echo -e " ${CYAN}/switch-context${NC} Switch workstream"
|
|
174
|
+
echo -e " ${CYAN}/delete-handoff${NC} Delete handoff(s)"
|
|
171
175
|
echo ""
|
|
172
176
|
echo -e " Files:"
|
|
173
|
-
echo -e " .claude/commands/
|
|
177
|
+
echo -e " .claude/commands/ 5 command files"
|
|
174
178
|
echo -e " .claude/rules/ session-continuity.md"
|
|
175
179
|
echo -e " .claude/handoffs/ session state (gitignored)"
|
|
176
180
|
echo ""
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-handoff",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Session continuity for Claude Code —
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "Session continuity for Claude Code — 5 slash commands to save, resume, delete, and switch workstreams across /clear",
|
|
5
5
|
"bin": "./cli.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"cli.js",
|
|
8
8
|
"install.sh",
|
|
9
9
|
"uninstall.sh",
|
|
10
|
+
"update.sh",
|
|
10
11
|
"commands/",
|
|
11
12
|
"rules/",
|
|
12
13
|
"LICENSE",
|
package/uninstall.sh
CHANGED
|
@@ -32,6 +32,7 @@ rm -f "$CLAUDE_DIR/commands/handoff.md"
|
|
|
32
32
|
rm -f "$CLAUDE_DIR/commands/resume.md"
|
|
33
33
|
rm -f "$CLAUDE_DIR/commands/save-handoff.md"
|
|
34
34
|
rm -f "$CLAUDE_DIR/commands/switch-context.md"
|
|
35
|
+
rm -f "$CLAUDE_DIR/commands/delete-handoff.md"
|
|
35
36
|
# Also remove legacy Portuguese commands if present
|
|
36
37
|
rm -f "$CLAUDE_DIR/commands/retomar.md"
|
|
37
38
|
rm -f "$CLAUDE_DIR/commands/salvar-handoff.md"
|
package/update.sh
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# claude-code-handoff — Update
|
|
3
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/eximIA-Ventures/claude-code-handoff/main/update.sh | bash
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
GREEN='\033[0;32m'
|
|
8
|
+
YELLOW='\033[1;33m'
|
|
9
|
+
CYAN='\033[0;36m'
|
|
10
|
+
RED='\033[0;31m'
|
|
11
|
+
NC='\033[0m'
|
|
12
|
+
|
|
13
|
+
REPO="eximIA-Ventures/claude-code-handoff"
|
|
14
|
+
BRANCH="main"
|
|
15
|
+
RAW_BASE="https://raw.githubusercontent.com/$REPO/$BRANCH"
|
|
16
|
+
PROJECT_DIR="$(pwd)"
|
|
17
|
+
CLAUDE_DIR="$PROJECT_DIR/.claude"
|
|
18
|
+
|
|
19
|
+
echo ""
|
|
20
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
21
|
+
echo -e "${CYAN} claude-code-handoff — Update${NC}"
|
|
22
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
23
|
+
echo ""
|
|
24
|
+
echo -e " Project: ${GREEN}$PROJECT_DIR${NC}"
|
|
25
|
+
echo ""
|
|
26
|
+
|
|
27
|
+
# Check if installed
|
|
28
|
+
if [ ! -d "$CLAUDE_DIR/commands" ] || [ ! -f "$CLAUDE_DIR/commands/resume.md" ]; then
|
|
29
|
+
echo -e " ${RED}claude-code-handoff is not installed in this project.${NC}"
|
|
30
|
+
echo -e " Run: npx claude-code-handoff"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Detect if running from cloned repo or via curl
|
|
35
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" 2>/dev/null)" 2>/dev/null && pwd 2>/dev/null || echo "")"
|
|
36
|
+
|
|
37
|
+
download_file() {
|
|
38
|
+
local src="$1"
|
|
39
|
+
local dst="$2"
|
|
40
|
+
if [ -n "$SCRIPT_DIR" ] && [ -f "$SCRIPT_DIR/$src" ]; then
|
|
41
|
+
cp "$SCRIPT_DIR/$src" "$dst"
|
|
42
|
+
else
|
|
43
|
+
curl -fsSL "$RAW_BASE/$src" -o "$dst"
|
|
44
|
+
fi
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# 1. Update commands
|
|
48
|
+
echo -e " ${YELLOW}[1/3]${NC} Updating commands..."
|
|
49
|
+
download_file "commands/handoff.md" "$CLAUDE_DIR/commands/handoff.md"
|
|
50
|
+
download_file "commands/resume.md" "$CLAUDE_DIR/commands/resume.md"
|
|
51
|
+
download_file "commands/save-handoff.md" "$CLAUDE_DIR/commands/save-handoff.md"
|
|
52
|
+
download_file "commands/switch-context.md" "$CLAUDE_DIR/commands/switch-context.md"
|
|
53
|
+
|
|
54
|
+
# 2. Update rules
|
|
55
|
+
echo -e " ${YELLOW}[2/3]${NC} Updating rules..."
|
|
56
|
+
download_file "rules/session-continuity.md" "$CLAUDE_DIR/rules/session-continuity.md"
|
|
57
|
+
|
|
58
|
+
# 3. Remove legacy Portuguese commands if present
|
|
59
|
+
echo -e " ${YELLOW}[3/3]${NC} Cleaning up legacy files..."
|
|
60
|
+
CLEANED=0
|
|
61
|
+
for f in retomar.md salvar-handoff.md trocar-contexto.md; do
|
|
62
|
+
if [ -f "$CLAUDE_DIR/commands/$f" ]; then
|
|
63
|
+
rm -f "$CLAUDE_DIR/commands/$f"
|
|
64
|
+
CLEANED=$((CLEANED + 1))
|
|
65
|
+
fi
|
|
66
|
+
done
|
|
67
|
+
|
|
68
|
+
echo ""
|
|
69
|
+
echo -e "${GREEN} Updated successfully!${NC}"
|
|
70
|
+
if [ "$CLEANED" -gt 0 ]; then
|
|
71
|
+
echo -e " Removed $CLEANED legacy command(s)"
|
|
72
|
+
fi
|
|
73
|
+
echo ""
|
|
74
|
+
echo -e " Handoff data in .claude/handoffs/ was ${CYAN}not touched${NC}."
|
|
75
|
+
echo ""
|