claude-context-auto-handoff 1.0.5 → 1.0.7

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.
@@ -1,28 +1,29 @@
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
- }
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
+ "version": "1.0.7",
12
+ "displayName": "Context Auto-Handoff",
13
+ "description": "Automatically saves session context and generates handoff manifests before Claude compacts or stops.",
14
+ "source": {
15
+ "source": "npm",
16
+ "package": "claude-context-auto-handoff"
17
+ },
18
+ "homepage": "https://github.com/Ethualo/claude-context-auto-handoff",
19
+ "repository": "https://github.com/Ethualo/claude-context-auto-handoff",
20
+ "license": "MIT",
21
+ "author": {
22
+ "name": "Ethualo",
23
+ "email": "lkh0926ym@naver.com"
24
+ },
25
+ "keywords": ["context", "handoff", "session", "memory", "compaction", "claude-code"],
26
+ "category": "productivity"
27
+ }
28
+ ]
29
+ }
@@ -1,20 +1,20 @@
1
- {
2
- "name": "claude-context-handoff",
3
- "version": "1.0.5",
4
- "description": "Automatically saves session context and generates handoff manifests before Claude compacts or stops.",
5
- "author": {
6
- "name": "Ethualo",
7
- "email": "lkh0926ym@naver.com"
8
- },
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",
14
- "mcpServers": {
15
- "context-handoff-manager": {
16
- "command": "node",
17
- "args": ["${CLAUDE_PLUGIN_ROOT}/build/index.js"]
18
- }
19
- }
20
- }
1
+ {
2
+ "name": "claude-context-handoff",
3
+ "version": "1.0.7",
4
+ "description": "Automatically saves session context and generates handoff manifests before Claude compacts or stops.",
5
+ "author": {
6
+ "name": "Ethualo",
7
+ "email": "lkh0926ym@naver.com"
8
+ },
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",
14
+ "mcpServers": {
15
+ "context-handoff-manager": {
16
+ "command": "node",
17
+ "args": ["${CLAUDE_PLUGIN_ROOT}/build/index.js"]
18
+ }
19
+ }
20
+ }
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ethualo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ethualo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ko.md CHANGED
@@ -1,196 +1,206 @@
1
- # claude-context-auto-handoff
2
-
3
- **[English](README.md)** | 한국어
4
-
5
- 컨텍스트 압축 또는 세션 종료 직전, 다음 세션이 현재 맥락을 그대로 이어받을 수 있도록 토큰 효율적인 핸드오프 문서를 자동으로 작성하는 Claude Code 플러그인.
6
-
7
- ![npm version](https://img.shields.io/npm/v/claude-context-auto-handoff)
8
- ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
9
-
10
- ---
11
-
12
- ## 필수 요구사항
13
-
14
- - **Node.js 18+** — `node` 명령어가 `PATH`에 있어야 함
15
- - **Claude Code** 또는 **Codex** — 플러그인 및 훅 실행에 Claude Code CLI 또는 Codex CLI 필요
16
-
17
- ---
18
-
19
- ## 개요
20
-
21
- Claude의 컨텍스트 창이 가득 차면 대화가 자동으로 압축됩니다. 시점에 내린 설계 결정, 해결 중이던 버그, 다음 할 일이 흐릿해집니다. 이 플러그인은 `PreCompact`와 `Stop` 이벤트를 감지해 압축 전에 AI가 직접 핸드오프 문서를 작성하도록 합니다. 다음 세션은 그 파일 하나로 즉시 이어집니다.
22
-
23
- 핸드오프 내용은 **텔레그래피즘** (관사·군더더기·코드 스니펫 없음) 으로 작성되어 토큰 효율을 극대화하면서도 다음 세션에 필요한 모든 결정 맥락을 보존합니다.
24
-
25
- ---
26
-
27
- ## 구성 요소
28
-
29
- ### 도구 (Tools)
30
-
31
- - **`generate_handoff_manifest`** — 현재 프로젝트의 `.claude/handoff.md`에 구조화된 핸드오프 문서를 저장합니다. `.claude/handoffs/handoff-{timestamp}.md`에도 아카이브됩니다.
32
-
33
- | 파라미터 | 타입 | 필수 | 설명 |
34
- |----------|------|------|------|
35
- | `summary` | `string` | | 간결한 세션 요약 (텔레그래피즘) |
36
- | `nextSteps` | `string[]` | ✅ | 다음 세션에서 즉시 이어받을 할 일 목록 |
37
- | `taskDescription` | `string` | | 상위 목표 + 핵심 의도 (왜 중요한가) |
38
- | `currentStatus` | `string` | ✗ | 완료된 vs 남은 무엇이 아닌 왜를 명시 |
39
- | `keyDecisions` | `string[]` | ✗ | 아키텍처 결정과 이유. 형식: `"Decision: X Reason: Y"` |
40
- | `failedApproaches` | `string[]` | ✗ | 이미 실패한 시도. 형식: `"Approach: X Result: Y Lesson: Z"` |
41
- | `modifiedFiles` | `string[]` | ✗ | 변경 파일과 델타 메모. 형식: `"경로/파일: 무엇을 변경"` 코드 금지 |
42
- | `implicitRules` | `string[]` | ✗ | 기술 스택, 네이밍 컨벤션, 환경변수 코드에서 유추 불가한 규칙 |
43
- | `blockers` | `string` | ✗ | 미해결 에러 또는 막혀 있는 문제 |
44
-
45
- ### 스킬 (Skills)
46
-
47
- | 명령어 | 동작 |
48
- |--------|------|
49
- | `/handoff-save` | 세션 컨텍스트 수집 후 `generate_handoff_manifest` 호출 |
50
- | `/handoff-resume` | `.claude/handoff.md` 읽어 새 세션에서 컨텍스트 복원 |
51
-
52
- ### (Hooks)
53
-
54
- Claude Code 훅은 기본 내장. Codex 훅은 `templates/.codex`를 프로젝트 루트에 복사해야 활성화됩니다 ([Codex 설치](#codex) 참조).
55
-
56
- | 이벤트 | 동작 |
57
- |--------|------|
58
- | `PreCompact` | 컨텍스트 압축 직전 `generate_handoff_manifest` 호출 지시 |
59
- | `Stop` | 핸드오프 파일이 오래됐거나 없으면 경고 |
60
- | `SessionStart` | `.claude/handoff.md` 존재 시 자동으로 컨텍스트 복원 |
61
-
62
- ---
63
-
64
- ## 빠른 시작
65
-
66
- **Linux / macOS**
67
- ```bash
68
- curl -fsSL https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.sh | bash
69
- ```
70
-
71
- **Windows (PowerShell)**
72
- ```powershell
73
- irm https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.ps1 | iex
74
- ```
75
-
76
- **npm (크로스플랫폼)**
77
- ```bash
78
- npm install -g claude-context-auto-handoff
79
- claude-context-handoff-setup
80
- ```
81
-
82
- ---
83
-
84
- ## 설치
85
-
86
- ### Claude Code 플러그인으로 설치
87
-
88
- ```bash
89
- claude plugin install claude-context-auto-handoff
90
- ```
91
-
92
- ### npm 패키지로 설치
93
-
94
- ```bash
95
- npm install -g claude-context-auto-handoff
96
- claude-context-handoff-setup # hooks.json 자동 배치
97
- ```
98
-
99
- ### MCP 수동 설정 (Claude Code)
100
-
101
- Claude Code `settings.json`에 추가:
102
-
103
- ```json
104
- {
105
- "mcpServers": {
106
- "context-handoff-manager": {
107
- "command": "node",
108
- "args": ["/path/to/build/index.js"]
109
- }
110
- }
111
- }
112
- ```
113
-
114
- ### Codex
115
-
116
- `~/.codex/config.toml`에 추가 (전역 MCP 설정):
117
-
118
- ```toml
119
- [mcp_servers.context-handoff]
120
- command = "node"
121
- args = ["/path/to/build/index.js"]
122
- ```
123
-
124
- 그런 다음 훅 템플릿을 프로젝트 루트에 복사:
125
-
126
- ```bash
127
- cp -r /path/to/claude-context-auto-handoff/templates/.codex ./.codex
128
- ```
129
-
130
- Claude Code와 동일한 `SessionStart`, `PreCompact`, `Stop` 훅이 활성화됩니다.
131
-
132
- ---
133
-
134
- ## 사용법
135
-
136
- ### Claude Code
137
-
138
- 세 훅 모두 자동 실행 — `SessionStart`는 세션 시작 시 컨텍스트 복원, `PreCompact`는 압축 전 저장, `Stop`은 핸드오프가 오래됐을 때 경고. 생성된 문서는 `.claude/handoff.md`에 저장됩니다.
139
-
140
- **수동 체크포인트:**
141
- ```
142
- /handoff-save
143
- ```
144
-
145
- **수동 복원 (자동 복원이 실행되지 않은 경우):**
146
- ```
147
- /handoff-resume
148
- ```
149
-
150
- ### Codex
151
-
152
- 동일한 세 훅이 `.codex/hooks.json`을 통해 자동 실행됩니다. 슬래시 명령어 없음 — 훅이 모두 처리.
153
-
154
- | 이벤트 | 동작 |
155
- |--------|------|
156
- | `SessionStart` | `.claude/handoff.md`를 읽어 컨텍스트로 주입 |
157
- | `PreCompact` | 압축 전 `generate_handoff_manifest` 호출 지시 |
158
- | `Stop` | 핸드오프가 오래됐거나 없으면 경고 |
159
-
160
- ### 출력 형식
161
-
162
- ```markdown
163
- # Session Handoff Snapshot
164
- > **Generated:** 2026. 6. 22. 오후 3:30:00
165
-
166
- ## 🎯 High-Level Objective
167
- * **Goal:** Supabase + Notion 주식 데이터 실시간 동기화 Next.js 15 앱 구축
168
- * **Core Intent:** Zustand 스토어로 클라이언트 재요청 최소화 — 비용 절감
169
-
170
- ## 📌 Current State & Next Steps
171
- * **Status:** Task 3 (Zustand 스토어) 완료
172
- * **Blocker:** Notion API rate limit (3 req/s) — 버퍼 레이어 필요
173
- * **Next Action:** Supabase Edge Functions 디바운스 큐 구현
174
-
175
- ## 🛠️ Modified Files Delta
176
- * src/store/stockStore.ts: Zustand 스토어 뼈대 + syncStatus 상태 정의
177
- * src/app/api/notion/sync/route.ts: POST 핸들러 작성 완료, Supabase 미연결
178
-
179
- ## 🚫 Failed Approaches (DO NOT RETRY)
180
- * Approach: Server Actions에서 Notion API 직접 호출 → Result: 리렌더 시 rate limit 즉시 터짐 → Lesson: 큐 미들웨어 필수
181
- * Approach: useEffect 주기 폴링 Result: Supabase 읽기 사용량 급증 → Lesson: 폐기
182
-
183
- ## 🔑 Crucial Context & Implicit Rules
184
- * Stack: Next.js 15 (App Router), Supabase v2, Zustand v5
185
- * Naming: API 엔드포인트 항상 route.ts, 스토어 PascalCase
186
- * Env: NEXT_PUBLIC_SUPABASE_ANON_KEY 사용
187
-
188
- ---
189
- *다음 세션 시작 자동으로 컨텍스트가 복원됩니다. 수동 복원: `/handoff-resume`*
190
- ```
191
-
192
- ---
193
-
194
- ## 라이선스
195
-
196
- MIT
1
+ # claude-context-auto-handoff
2
+
3
+ **[English](README.md)** | 한국어
4
+
5
+ 컨텍스트 압축이나 세션 종료 직전, 다음 세션이 현재 맥락을 그대로 이어받도록 토큰 효율적인 핸드오프 문서를 자동으로 두는 Claude Code 플러그인.
6
+
7
+ ![npm version](https://img.shields.io/npm/v/claude-context-auto-handoff)
8
+ ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
9
+
10
+ ---
11
+
12
+ ## 필수 요구사항
13
+
14
+ - **Node.js 18+** — `node` 명령어가 `PATH`에 있어야 함
15
+ - **Claude Code** 또는 **Codex** — 플러그인 및 훅 실행에 Claude Code CLI 또는 Codex CLI 필요
16
+
17
+ ---
18
+
19
+ ## 개요
20
+
21
+ Claude의 컨텍스트 창이 가득 차면 대화가 자동으로 압축됩니다. 이때 방금 내린 설계 결정, 해결 중이던 버그, 다음 할 일이 흐릿해집니다. 이 플러그인은 `PreCompact`와 `Stop` 이벤트를 감지해 압축 전에 AI가 직접 핸드오프 문서를 씁니다. 다음 세션은 그 파일 하나로 즉시 이어집니다.
22
+
23
+ 핸드오프 내용은 **텔레그래피즘**(관사·군더더기·코드 스니펫 없음)으로 작성해 토큰은 아끼면서도 다음 세션에 필요한 결정 맥락은 그대로 남깁니다.
24
+
25
+ 초안 작성(1회 저장당 3-6k 토큰 규모)은 Haiku 서브에이전트에 위임되며, 서브에이전트가 `generate_handoff_manifest` 호출까지 직접 수행합니다 — 초안이 메인 세션 모델 컨텍스트를 거치지 않습니다.
26
+
27
+ ---
28
+
29
+ ## 구성 요소
30
+
31
+ ### 도구 (Tools)
32
+
33
+ - **`generate_handoff_manifest`** 현재 프로젝트의 `.claude/handoff.md`에 구조화된 핸드오프 문서를 저장합니다. `.claude/handoffs/{YYYY-MM-DD}/handoff-{timestamp}.md`에도 아카이브됩니다 (최근 50개 파일만 유지, 자동 정리). 동시에 `.claude/handoffs/index.md`에 한 줄 요약(날짜, 키워드, 헤드라인, 경로)을 upsert해 — 아카이브 파일을 전부 열지 않고도 grep 한 번으로 과거 세션을 찾을 수 있는 경량 인덱스를 유지합니다. 한 세션 안에서 여러 번 저장돼도(예: 긴 세션에서 `PreCompact`와 `Stop`이 둘 다 발동) 새 파일을 쌓지 않고 그 세션의 아카이브 파일·인덱스 줄을 그대로 갱신합니다 — MCP 서버 프로세스 하나당 세션ID 하나를 부여해 frontmatter `session:` 필드에 기록합니다.
34
+
35
+ | 파라미터 | 타입 | 필수 | 설명 |
36
+ |----------|------|------|------|
37
+ | `nextSteps` | `string[]` | | 다음 세션에서 즉시 이어받을 목록 |
38
+ | `summary` | `string` | ✗ | 간결한 세션 요약 (텔레그래피즘)다른 필드로 충분하면 생략 |
39
+ | `taskDescription` | `string` | ✗ | 상위 목표 + 핵심 의도 (왜 중요한가) |
40
+ | `currentStatus` | `string` | ✗ | 완료된 vs 남은 무엇이 아닌 왜를 명시 |
41
+ | `keyDecisions` | `string[]` | ✗ | 아키텍처 결정과 이유. 형식: `"Decision: XReason: Y"` |
42
+ | `failedApproaches` | `string[]` | ✗ | 이미 실패한 시도. 형식: `"Approach: X Result: Y Lesson: Z"` |
43
+ | `modifiedFiles` | `string[]` | ✗ | 변경 파일과 델타 메모. 형식: `"경로/파일: 무엇을 변경"` — 코드 금지 |
44
+ | `implicitRules` | `string[]` | ✗ | 기술 스택, 네이밍 컨벤션, 환경변수 — 코드에서 유추 불가한 규칙 |
45
+ | `blockers` | `string` | ✗ | 미해결 에러 또는 막혀 있는 문제 |
46
+ | `workingDirectory` | `string` | ✗ | handoff.md를 쓸 프로젝트 루트 절대 경로 — Windows에서 `process.cwd()`가 System32를 가리킬 때 필요 |
47
+
48
+ ### 스킬 (Skills)
49
+
50
+ | 명령어 | 동작 |
51
+ |--------|------|
52
+ | `/handoff-save` | Haiku 서브에이전트에 위임 — 세션 컨텍스트 초안 작성 + `generate_handoff_manifest` 호출까지 직접 수행 (3-6k 토큰 초안이 비싼 메인 모델을 거치지 않음) |
53
+ | `/handoff-resume` | `.claude/handoff.md` 읽어 새 세션에서 컨텍스트 복원 |
54
+ | `/handoff-search` | `.claude/handoffs/index.md`를 grep해 주제와 일치하는 과거 세션 검색 DB·임베딩 없음 |
55
+
56
+ ### (Hooks)
57
+
58
+ Claude Code 훅은 기본 내장. Codex 훅은 `templates/.codex`를 프로젝트 루트에 복사해야 활성화됩니다 ([Codex 설치](#codex) 참조).
59
+
60
+ | 이벤트 | 동작 |
61
+ |--------|------|
62
+ | `PreCompact` | 컨텍스트 압축 직전 `handoff-save` 스킬(Haiku 서브에이전트) 호출 지시 |
63
+ | `Stop` | 핸드오프 파일이 오래됐거나 없으면 경고 |
64
+ | `SessionStart` | 핸드오프 존재 시 짧은 힌트(경과 시간, 주제)만 노출 — 전체 내용은 키워드 매칭이나 `/handoff-resume`으로 로드 |
65
+ | `UserPromptSubmit` | 프롬프트가 직전 핸드오프의 키워드와 일치하면 전체 컨텍스트 자동 주입 |
66
+
67
+ ---
68
+
69
+ ## 빠른 시작
70
+
71
+ **Linux / macOS**
72
+ ```bash
73
+ curl -fsSL https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.sh | bash
74
+ ```
75
+
76
+ **Windows (PowerShell)**
77
+ ```powershell
78
+ irm https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.ps1 | iex
79
+ ```
80
+
81
+ **npm (크로스플랫폼)**
82
+ ```bash
83
+ npm install -g claude-context-auto-handoff
84
+ claude-context-handoff-setup
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 설치
90
+
91
+ ### Claude Code 플러그인으로 설치
92
+
93
+ ```bash
94
+ claude plugin install claude-context-auto-handoff
95
+ ```
96
+
97
+ ### npm 패키지로 설치
98
+
99
+ ```bash
100
+ npm install -g claude-context-auto-handoff
101
+ claude-context-handoff-setup # hooks.json 자동 배치
102
+ ```
103
+
104
+ ### MCP 수동 설정 (Claude Code)
105
+
106
+ Claude Code `settings.json`에 추가:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "context-handoff-manager": {
112
+ "command": "node",
113
+ "args": ["/path/to/build/index.js"]
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### Codex
120
+
121
+ `~/.codex/config.toml`에 추가 (전역 MCP 설정):
122
+
123
+ ```toml
124
+ [mcp_servers.context-handoff]
125
+ command = "node"
126
+ args = ["/path/to/build/index.js"]
127
+ ```
128
+
129
+ 그런 다음 훅 템플릿을 프로젝트 루트에 복사:
130
+
131
+ ```bash
132
+ cp -r /path/to/claude-context-auto-handoff/templates/.codex ./.codex
133
+ ```
134
+
135
+ Claude Code와 동일한 `SessionStart`, `PreCompact`, `Stop` 훅이 활성화됩니다.
136
+
137
+ ---
138
+
139
+ ## 사용법
140
+
141
+ ### Claude Code
142
+
143
+ 네 훅 모두 자동으로 돕니다 — `SessionStart`는 핸드오프 있으면 짧은 힌트 노출, `UserPromptSubmit`은 프롬프트가 저장된 키워드와 일치하면 전체 컨텍스트 자동 로드, `PreCompact`는 압축 전 저장, `Stop`은 핸드오프가 오래됐을 때 경고. 생성된 문서는 `.claude/handoff.md`에 저장됩니다.
144
+
145
+ **수동 체크포인트:**
146
+ ```
147
+ /handoff-save
148
+ ```
149
+
150
+ **수동 복원 (키워드 매칭이 안 됐을 경우):**
151
+ ```
152
+ /handoff-resume
153
+ ```
154
+
155
+ **과거 세션 검색:**
156
+ ```
157
+ /handoff-search <주제>
158
+ ```
159
+
160
+ ### Codex
161
+
162
+ 같은 세 훅이 `.codex/hooks.json`으로 자동 실행됩니다. 슬래시 명령어 없음 — 훅이 모두 처리.
163
+
164
+ | 이벤트 | 동작 |
165
+ |--------|------|
166
+ | `SessionStart` | `.claude/handoff.md`를 읽어 컨텍스트로 주입 |
167
+ | `PreCompact` | 압축 handoff-save 스킬(Haiku 서브에이전트) 호출 지시 |
168
+ | `Stop` | 핸드오프가 오래됐거나 없으면 경고 |
169
+
170
+ ### 출력 형식
171
+
172
+ ```markdown
173
+ # Session Handoff Snapshot
174
+ > **Generated:** 2026. 6. 22. 오후 3:30:00
175
+
176
+ ## 🎯 High-Level Objective
177
+ * **Goal:** Supabase + Notion 주식 데이터 실시간 동기화 Next.js 15 앱 구축
178
+ * **Core Intent:** Zustand 스토어로 클라이언트 재요청 최소화 — 비용 절감
179
+
180
+ ## 📌 Current State & Next Steps
181
+ * **Status:** Task 3 (Zustand 스토어) 완료
182
+ * **Blocker:** Notion API rate limit (3 req/s) — 버퍼 레이어 필요
183
+ * **Next Action:** Supabase Edge Functions 디바운스 큐 구현
184
+
185
+ ## 🛠️ Modified Files Delta
186
+ * src/store/stockStore.ts: Zustand 스토어 뼈대 + syncStatus 상태 정의
187
+ * src/app/api/notion/sync/route.ts: POST 핸들러 작성 완료, Supabase 미연결
188
+
189
+ ## 🚫 Failed Approaches (DO NOT RETRY)
190
+ * Approach: Server Actions에서 Notion API 직접 호출 → Result: 리렌더 시 rate limit 즉시 터짐 → Lesson: 큐 미들웨어 필수
191
+ * Approach: useEffect 주기 폴링 → Result: Supabase 읽기 사용량 급증 → Lesson: 폐기
192
+
193
+ ## 🔑 Crucial Context & Implicit Rules
194
+ * Stack: Next.js 15 (App Router), Supabase v2, Zustand v5
195
+ * Naming: API 엔드포인트 항상 route.ts, 스토어 PascalCase
196
+ * Env: NEXT_PUBLIC_SUPABASE_ANON_KEY 사용 중
197
+
198
+ ---
199
+ *세션 시작 시 짧은 힌트만 노출됩니다. 전체 컨텍스트는 다음 프롬프트가 위 키워드와 일치할 때, 또는 수동 `/handoff-resume`으로 로드됩니다.*
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 라이선스
205
+
206
+ MIT