claude-context-auto-handoff 1.0.0 → 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.
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "context-handoff",
3
+ "description": "Claude Code plugin for automatic session context handoff across compactions and stops.",
4
+ "owner": {
5
+ "name": "Ethualo",
6
+ "email": "lkh0926ym@naver.com"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "claude-context-handoff",
11
+ "displayName": "Context Auto-Handoff",
12
+ "description": "Automatically saves session context and generates handoff manifests before Claude compacts or stops.",
13
+ "source": {
14
+ "source": "npm",
15
+ "package": "claude-context-auto-handoff"
16
+ },
17
+ "homepage": "https://github.com/Ethualo/claude-context-auto-handoff",
18
+ "repository": "https://github.com/Ethualo/claude-context-auto-handoff",
19
+ "license": "MIT",
20
+ "author": {
21
+ "name": "Ethualo",
22
+ "email": "lkh0926ym@naver.com"
23
+ },
24
+ "keywords": ["context", "handoff", "session", "memory", "compaction", "claude-code"],
25
+ "category": "productivity"
26
+ }
27
+ ]
28
+ }
@@ -6,9 +6,11 @@
6
6
  "name": "Ethualo",
7
7
  "email": "lkh0926ym@naver.com"
8
8
  },
9
- "engines": {
10
- "claude": "^1.0.0"
11
- },
9
+ "homepage": "https://github.com/Ethualo/claude-context-auto-handoff",
10
+ "repository": "https://github.com/Ethualo/claude-context-auto-handoff",
11
+ "license": "MIT",
12
+ "keywords": ["context", "handoff", "session", "memory", "compaction", "claude-code"],
13
+ "category": "productivity",
12
14
  "mcpServers": {
13
15
  "context-handoff-manager": {
14
16
  "command": "node",
package/README.ko.md CHANGED
@@ -6,7 +6,13 @@
6
6
 
7
7
  ![npm version](https://img.shields.io/npm/v/claude-context-auto-handoff)
8
8
  ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
9
- ![Claude Code](https://img.shields.io/badge/Claude%20Code-%E2%89%A51.0.0-orange)
9
+
10
+ ---
11
+
12
+ ## 필수 요구사항
13
+
14
+ - **Node.js 18+** — `node` 명령어가 `PATH`에 있어야 함
15
+ - **Claude Code** 또는 **Codex** — 플러그인 및 훅 실행에 Claude Code CLI 또는 Codex CLI 필요
10
16
 
11
17
  ---
12
18
 
package/README.md CHANGED
@@ -6,7 +6,13 @@ Claude Code plugin that automatically saves session context and generates token-
6
6
 
7
7
  ![npm version](https://img.shields.io/npm/v/claude-context-auto-handoff)
8
8
  ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
9
- ![Claude Code](https://img.shields.io/badge/Claude%20Code-%E2%89%A51.0.0-orange)
9
+
10
+ ---
11
+
12
+ ## Requirements
13
+
14
+ - **Node.js 18+** — must be on `PATH` as `node`
15
+ - **Claude Code** or **Codex** — plugin and hooks require Claude Code CLI or Codex CLI
10
16
 
11
17
  ---
12
18
 
package/build/index.js CHANGED
@@ -8,17 +8,16 @@ const server = new McpServer({
8
8
  name: 'context-handoff-manager',
9
9
  version: '1.0.0'
10
10
  });
11
- const CONTEXT_THRESHOLD = parseInt(process.env.CONTEXT_THRESHOLD ?? '70', 10);
12
11
  server.tool('generate_handoff_manifest', {
13
- summary: z.string().optional().describe('Detailed session recap — omit if other fields cover it'),
14
- nextSteps: z.array(z.string()).describe('Tasks to continue immediately in the next session'),
15
- taskDescription: z.string().optional().describe('High-level goal + core intent (why this matters). Use telegraphese — drop articles/pronouns.'),
16
- currentStatus: z.string().optional().describe('What is done vs what remains. State why, not just what.'),
17
- keyDecisions: z.array(z.string()).optional().describe('Architecture choices and why — prevents post-compaction amnesia. Format: "Decision: X — Reason: Y"'),
18
- failedApproaches: z.array(z.string()).optional().describe('Already-failed attempts. Format each: "Approach: X → Result: Y → Lesson: Z". Prevents repeating mistakes.'),
19
- blockers: z.string().optional().describe('Unresolved errors or blockers'),
12
+ summary: z.string().optional().describe('Detailed session recap in English — omit if other fields cover it'),
13
+ nextSteps: z.array(z.string()).describe('Tasks to continue immediately in the next session. Write in English.'),
14
+ taskDescription: z.string().optional().describe('High-level goal + core intent (why this matters). Use telegraphese — drop articles/pronouns. Write in English.'),
15
+ currentStatus: z.string().optional().describe('What is done vs what remains. State why, not just what. Write in English.'),
16
+ keyDecisions: z.array(z.string()).optional().describe('Architecture choices and why — prevents post-compaction amnesia. Format: "Decision: X — Reason: Y". Write in English.'),
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
+ blockers: z.string().optional().describe('Unresolved errors or blockers. Write in English.'),
20
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.'),
21
- implicitRules: z.array(z.string()).optional().describe('Tech stack, naming conventions, env vars, implicit project rules — anything not derivable from reading code')
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.')
22
21
  }, async ({ summary, nextSteps, taskDescription, currentStatus, keyDecisions, failedApproaches, blockers, modifiedFiles, implicitRules }) => {
23
22
  try {
24
23
  const claudeDir = path.join(process.cwd(), '.claude');
@@ -38,7 +37,7 @@ server.tool('generate_handoff_manifest', {
38
37
  return {
39
38
  content: [{
40
39
  type: 'text',
41
- text: `Handoff saved.\nLatest: ${mainPath}\nArchive: ${archivePath}\n[Handoff Guard] threshold: ${CONTEXT_THRESHOLD}% | run /resume in next session`
40
+ text: `Handoff saved.\nLatest: ${mainPath}\nArchive: ${archivePath}`
42
41
  }]
43
42
  };
44
43
  }
@@ -90,7 +89,7 @@ function buildMarkdown(params) {
90
89
  if (summary) {
91
90
  sections.push(`## Summary\n${summary}\n`);
92
91
  }
93
- sections.push(`---\n*Run \`/resume\` in the next session to restore this context.*`);
92
+ sections.push(`---\n*Context is auto-restored on session start. Manual restore: \`/resume\`*`);
94
93
  return sections.join('\n');
95
94
  }
96
95
  async function main() {
package/hooks/hooks.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "prompt",
8
- "prompt": "CRITICAL: Context compaction imminent. Call 'generate_handoff_manifest' NOW before compaction. Fill all fields: summary (full session recap), taskDescription (goal), currentStatus (done vs remaining), keyDecisions (architecture choices + why), failedApproaches (already-failed — do NOT retry), nextSteps (next session tasks), blockers (unresolved errors). Do NOT allow compaction without calling this tool."
8
+ "prompt": "CRITICAL: Context compaction imminent. Call 'generate_handoff_manifest' NOW before compaction. Fill all fields: summary (full session recap), taskDescription (goal), currentStatus (done vs remaining), keyDecisions (architecture choices + why), failedApproaches (already-failed — do NOT retry), nextSteps (next session tasks), blockers (unresolved errors). Write ALL field values in English. Do NOT allow compaction without calling this tool."
9
9
  }
10
10
  ]
11
11
  }
@@ -15,7 +15,7 @@
15
15
  "hooks": [
16
16
  {
17
17
  "type": "prompt",
18
- "prompt": "If a work unit just completed (feature done, tests passed, commit made), call 'generate_handoff_manifest'. Fill taskDescription, keyDecisions, and failedApproaches so the next session has full context."
18
+ "prompt": "If a work unit just completed (feature done, tests passed, commit made), call 'generate_handoff_manifest'. Fill taskDescription, keyDecisions, and failedApproaches so the next session has full context. Write ALL field values in English."
19
19
  }
20
20
  ]
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-context-auto-handoff",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A Claude Code plugin to automate session handoffs before context compaction.",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -33,4 +33,4 @@
33
33
  "@types/node": "^20.11.0",
34
34
  "typescript": "^5.3.3"
35
35
  }
36
- }
36
+ }
package/scripts/setup.ps1 CHANGED
@@ -1,4 +1,4 @@
1
- # context-handoff-mcp-server one-line setup for Windows (PowerShell)
1
+ # context-handoff-mcp-server -- one-line setup for Windows (PowerShell)
2
2
  # Usage: irm https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.ps1 | iex
3
3
 
4
4
  $ErrorActionPreference = "Stop"
@@ -11,28 +11,25 @@ Write-Host "[Handoff Setup] Installing $PluginName..."
11
11
  # 1. npm global install (builds TypeScript)
12
12
  npm install -g claude-context-auto-handoff
13
13
 
14
- # 2. hooks.json 등록 (기존 파일이 있으면 경고만)
14
+ # 2. Register hooks.json (warn if already exists)
15
15
  $NpmRoot = (npm root -g).Trim()
16
16
  $HooksSrc = Join-Path $NpmRoot "claude-context-auto-handoff\hooks\hooks.json"
17
17
 
18
18
  if (Test-Path $HooksTarget) {
19
- Write-Host "[Handoff Setup] WARNING: $HooksTarget 이미 존재합니다."
20
- Write-Host " 수동으로 $HooksSrc 내용을 병합하세요."
19
+ Write-Host "[Handoff Setup] WARNING: $HooksTarget already exists."
20
+ Write-Host " Manually merge contents from: $HooksSrc"
21
21
  } else {
22
22
  $HooksDir = Split-Path $HooksTarget
23
23
  if (-not (Test-Path $HooksDir)) { New-Item -ItemType Directory -Force $HooksDir | Out-Null }
24
24
  Copy-Item $HooksSrc $HooksTarget
25
- Write-Host "[Handoff Setup] hooks.json 등록 완료: $HooksTarget"
25
+ Write-Host "[Handoff Setup] hooks.json registered: $HooksTarget"
26
26
  }
27
27
 
28
28
  Write-Host ""
29
- Write-Host "[Handoff Setup] 완료!"
29
+ Write-Host "[Handoff Setup] Done!"
30
30
  Write-Host ""
31
- Write-Host " 임계값 조정 (기본 70%):"
32
- Write-Host " [System.Environment]::SetEnvironmentVariable('CONTEXT_THRESHOLD','65','User')"
31
+ Write-Host " Usage:"
32
+ Write-Host " /handoff -- save current session"
33
+ Write-Host " /resume -- restore previous session"
33
34
  Write-Host ""
34
- Write-Host " 사용법:"
35
- Write-Host " /handoff — 현재 세션 저장"
36
- Write-Host " /resume — 이전 세션 복원"
37
- Write-Host ""
38
- Write-Host " SessionStart 훅이 세션 시작 시 자동으로 이전 컨텍스트를 복원합니다."
35
+ Write-Host " SessionStart hook auto-restores previous context on session open."
package/scripts/setup.sh CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # context-handoff-mcp-server one-line setup for Linux/macOS
2
+ # context-handoff-mcp-server -- one-line setup for Linux/macOS
3
3
  # Usage: curl -fsSL https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.sh | bash
4
4
 
5
5
  set -e
@@ -12,26 +12,23 @@ echo "[Handoff Setup] Installing $PLUGIN_NAME..."
12
12
  # 1. npm global install (builds TypeScript)
13
13
  npm install -g claude-context-auto-handoff
14
14
 
15
- # 2. hooks.json 등록 (기존 파일이 있으면 경고만)
15
+ # 2. Register hooks.json (warn if already exists)
16
16
  HOOKS_SRC="$(npm root -g)/claude-context-auto-handoff/hooks/hooks.json"
17
17
 
18
18
  if [ -f "$HOOKS_TARGET" ]; then
19
- echo "[Handoff Setup] WARNING: $HOOKS_TARGET 이미 존재합니다."
20
- echo " 수동으로 $HOOKS_SRC 내용을 병합하세요."
19
+ echo "[Handoff Setup] WARNING: $HOOKS_TARGET already exists."
20
+ echo " Manually merge contents from: $HOOKS_SRC"
21
21
  else
22
22
  mkdir -p "$(dirname "$HOOKS_TARGET")"
23
23
  cp "$HOOKS_SRC" "$HOOKS_TARGET"
24
- echo "[Handoff Setup] hooks.json 등록 완료: $HOOKS_TARGET"
24
+ echo "[Handoff Setup] hooks.json registered: $HOOKS_TARGET"
25
25
  fi
26
26
 
27
27
  echo ""
28
- echo "[Handoff Setup] 완료!"
28
+ echo "[Handoff Setup] Done!"
29
29
  echo ""
30
- echo " 임계값 조정 (기본 70%):"
31
- echo " export CONTEXT_THRESHOLD=65 # ~/.bashrc 또는 ~/.zshrc에 추가"
30
+ echo " Usage:"
31
+ echo " /handoff -- save current session"
32
+ echo " /resume -- restore previous session"
32
33
  echo ""
33
- echo " 사용법:"
34
- echo " /handoff — 현재 세션 저장"
35
- echo " /resume — 이전 세션 복원"
36
- echo ""
37
- echo " SessionStart 훅이 세션 시작 시 자동으로 이전 컨텍스트를 복원합니다."
34
+ echo " SessionStart hook auto-restores previous context on session open."