claude-context-auto-handoff 1.0.2 → 1.0.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.
package/build/index.js CHANGED
@@ -17,15 +17,15 @@ server.tool('generate_handoff_manifest', {
17
17
  failedApproaches: z.array(z.string()).optional().describe('Already-failed attempts. Format each: "Approach: X → Result: Y → Lesson: Z". Prevents repeating mistakes. Write in English.'),
18
18
  blockers: z.string().optional().describe('Unresolved errors or blockers. Write in English.'),
19
19
  modifiedFiles: z.array(z.string()).optional().describe('Changed files with delta notes. Format: "path/to/file: what changed" — NO code snippets, path+delta only.'),
20
- implicitRules: z.array(z.string()).optional().describe('Tech stack, naming conventions, env vars, implicit project rules — anything not derivable from reading code. Write in English.')
21
- }, async ({ summary, nextSteps, taskDescription, currentStatus, keyDecisions, failedApproaches, blockers, modifiedFiles, implicitRules }) => {
20
+ implicitRules: z.array(z.string()).optional().describe('Tech stack, naming conventions, env vars, implicit project rules — anything not derivable from reading code. Write in English.'),
21
+ workingDirectory: z.string().optional().describe('Absolute path to the project root where handoff.md should be written. Required on Windows where process.cwd() may return System32.')
22
+ }, async ({ summary, nextSteps, taskDescription, currentStatus, keyDecisions, failedApproaches, blockers, modifiedFiles, implicitRules, workingDirectory }) => {
22
23
  try {
23
- const claudeDir = path.join(process.cwd(), '.claude');
24
+ const projectRoot = workingDirectory || process.env['CLAUDE_PROJECT_DIR'] || process.cwd();
25
+ const claudeDir = path.join(projectRoot, '.claude');
24
26
  const handoffsDir = path.join(claudeDir, 'handoffs');
25
- if (!fs.existsSync(claudeDir))
26
- fs.mkdirSync(claudeDir, { recursive: true });
27
- if (!fs.existsSync(handoffsDir))
28
- fs.mkdirSync(handoffsDir, { recursive: true });
27
+ fs.mkdirSync(claudeDir, { recursive: true });
28
+ fs.mkdirSync(handoffsDir, { recursive: true });
29
29
  const now = new Date();
30
30
  const displayTime = now.toLocaleString();
31
31
  const timestamp = now.toISOString().replace(/[:.]/g, '-');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-context-auto-handoff",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A Claude Code plugin to automate session handoffs before context compaction.",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -12,6 +12,7 @@
12
12
  "build",
13
13
  ".claude-plugin",
14
14
  "hooks",
15
+ "skills",
15
16
  "templates",
16
17
  "scripts",
17
18
  "README.md",
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Save current session context to handoff file. Use when user runs /handoff or asks to save session state before ending.
3
+ ---
4
+
5
+ Save session context to `.claude/handoff.md` and timestamped archive to `.claude/handoffs/`.
6
+
7
+ ## Content Generation Rules (STRICT)
8
+
9
+ Write all field values using telegraphese — drop articles, pronouns, polite words. Maximize density.
10
+
11
+ - **NO code snippets** in any field. Reference file paths + line-level delta notes only.
12
+ - **WHY over WHAT**: Every decision/status must state the reason, not just the action.
13
+ - **failedApproaches**: Format each entry as `"Approach: X → Result: Y → Lesson: Z"`. This prevents the next session from repeating mistakes.
14
+ - **taskDescription**: Include both Goal and Core Intent (why this matters to the project).
15
+ - **implicitRules**: Capture tech stack, naming conventions, env vars — anything not derivable from reading the code.
16
+
17
+ ## Steps
18
+
19
+ 1. Gather from current session:
20
+ - taskDescription: final goal + core intent (why)
21
+ - summary: terse session recap (telegraphese)
22
+ - currentStatus: done vs remaining
23
+ - keyDecisions: architecture choices + why (prevents post-compaction amnesia)
24
+ - failedApproaches: already-failed attempts in `Approach→Result→Lesson` format
25
+ - blockers: unresolved errors
26
+ - modifiedFiles: changed files with delta notes (no code, path + what changed)
27
+ - implicitRules: stack, conventions, env vars
28
+
29
+ 2. Call `generate_handoff_manifest`:
30
+ - `summary`, `nextSteps` — required
31
+ - `taskDescription`, `currentStatus`, `keyDecisions`, `failedApproaches`, `modifiedFiles`, `implicitRules` — recommended
32
+ - `blockers` — optional
33
+
34
+ 3. Confirm to user:
35
+ - Latest: `.claude/handoff.md`
36
+ - Archive: `.claude/handoffs/handoff-{timestamp}.md`
37
+ - Next session: run `/resume` or SessionStart hook auto-restores
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Restore previous session context from handoff file. Use when user runs /resume or asks to continue from last session.
3
+ ---
4
+
5
+ Reads `.claude/handoff.md`. Falls back to latest file in `.claude/handoffs/`.
6
+
7
+ ## Steps
8
+
9
+ 1. Read `.claude/handoff.md`
10
+ 2. If missing, find latest `handoff-*.md` in `.claude/handoffs/`
11
+ 3. If neither found: tell user "No handoff file. Run /handoff first."
12
+ 4. If found:
13
+ - Parse: Task Description, Current Status, Key Decisions, Failed Approaches, Blockers, Next Steps
14
+ - Brief user in their language
15
+ - Never retry Failed Approaches
16
+ - Start from first Next Step immediately