context-persistence
Claude Codeで長期的な機能開発や中断からの再開が必要な際に、計画・状況・タスクの3ファイル構成や進捗管理、迅速な再開手順、情報更新頻度などを活用し、セッションの中断にも対応しながら作業を進めるSkill。
📜 元の英語説明(参考)
Waypoint plans methodology and session survival patterns for Claude Code. Use when working on long-running features, need to resume after context reset, want to document task progress, or need to survive session interruptions. Covers three-file structure (plan/context/tasks), SESSION PROGRESS tracking, quick resume instructions, update frequency, and context handoff patterns.
🇯🇵 日本人クリエイター向け解説
Claude Codeで長期的な機能開発や中断からの再開が必要な際に、計画・状況・タスクの3ファイル構成や進捗管理、迅速な再開手順、情報更新頻度などを活用し、セッションの中断にも対応しながら作業を進めるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o context-persistence.zip https://jpskill.com/download/18830.zip && unzip -o context-persistence.zip && rm context-persistence.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18830.zip -OutFile "$d\context-persistence.zip"; Expand-Archive "$d\context-persistence.zip" -DestinationPath $d -Force; ri "$d\context-persistence.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
context-persistence.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
context-persistenceフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] context-persistence
コンテキスト永続化スキル
目的
現在の作業、決定、進捗状況を構造化されたドキュメントとして維持することで、コンテキストのリセット、セッションの中断、または長時間の休憩の後でも、Claude Code がシームレスに作業を再開できるようにします。
このスキルを使用するタイミング
以下のキーワードを言及すると、自動的に有効になります。
- ウェイポイント計画、ウェイポイントプランニング
- 作業の再開、作業の継続
- セッションの維持、コンテキストのリセット
- タスクの引き継ぎ、進捗状況の追跡
- 長期にわたる機能またはプロジェクト
- 現在の状態を文書化する必要がある
問題点:コンテキストのリセット
コンテキストのリセット中に何が起こるか:
- ❌ すべての会話履歴が失われる
- ❌ 現在のタスクコンテキストが忘れられる
- ❌ 決定と根拠がなくなる
- ❌ 進捗状況が追跡されない
- ❌ すべてを再説明する必要がある
コンテキスト永続化を使用した場合:
- ✅ 現在のタスクが文書化される
- ✅ 決定と根拠が保持される
- ✅ 進捗状況が明確に追跡される
- ✅ 1分未満で迅速に再開できる
- ✅ 将来のセッションへのシームレスな引き継ぎ
3ファイル構造
コアパターンでは、plans/active/{task-name}/ にある3つの補完的なファイルを使用します。
1. {task-name}-plan.md - 戦略計画
目的: 高レベルの戦略とアプローチ
内容:
- 機能/タスクの概要
- 要件と受け入れ基準
- アーキテクチャのアプローチ
- 実装フェーズ
- 依存関係と制約
- リスクと軽減策
更新頻度: めったにない(アプローチが変更された場合のみ)
例:
# Authentication Implementation Plan
## Overview
Add JWT-based authentication to replace session cookies for mobile app support.
## Requirements
- JWT tokens with refresh mechanism
- Supabase Auth integration
- Protected API routes
- Mobile-friendly (stateless)
## Architecture
- Auth middleware in Edge Functions
- Token storage in httpOnly cookies (web) + AsyncStorage (mobile)
- Row-Level Security policies for data access
## Implementation Phases
1. Supabase Auth setup
2. Edge Function auth middleware
3. Frontend auth hooks
4. RLS policies
5. Migration from existing auth
## Dependencies
- Supabase setup complete
- Database schema finalized
2. {task-name}-context.md - 現在の状態と進捗状況
目的: 現在の状態、決定、進捗状況を記述した生きたドキュメント
内容:
- セッションの進捗状況(頻繁に更新)
- 行われた主要な決定
- 重要な発見
- 現在のブロッカー
- 変更されたファイル
- 迅速な再開手順
更新頻度: 各重要な変更または決定の後
例:
# Authentication Implementation Context
## SESSION PROGRESS (2025-01-15 14:30)
### ✅ COMPLETED
- [x] Supabase Auth configured
- [x] Created auth middleware for Edge Functions
- [x] Implemented login/signup pages
- [x] Added auth context provider
### 🟡 IN PROGRESS
- [ ] Implementing token refresh logic (CURRENT)
- Working on: lib/supabase/auth.ts
- Next: Handle token expiration gracefully
### ⏳ PENDING
- [ ] Add RLS policies
- [ ] Migrate existing users
- [ ] Add mobile auth flow
- [ ] Write auth tests
### 🎯 NEXT ACTION
Continue implementing refreshToken() function in lib/supabase/auth.ts
- Handle expired tokens
- Refresh transparently
- Redirect to login if refresh fails
## KEY DECISIONS
### Decision: JWT vs. Session Cookies (2025-01-12)
**Chose**: JWT tokens
**Rationale**: Need stateless auth for mobile apps
**Impact**: Requires token refresh mechanism
### Decision: Supabase Auth vs. Custom (2025-01-13)
**Chose**: Supabase Auth
**Rationale**: Built-in RLS integration, handles token refresh
**Impact**: Less custom code, tighter Supabase integration
## IMPORTANT DISCOVERIES
### Token Refresh Timing
Discovered tokens expire after 1 hour by default. Need to:
- Refresh proactively at 50 minutes
- Handle edge case of offline user
- Store refresh token securely
### RLS Row vs. Column Level
Supabase RLS is row-level only, not column-level.
For sensitive columns, need separate tables.
## CURRENT BLOCKERS
None currently. Auth flow is straightforward with Supabase.
## FILES MODIFIED
### Created
- lib/supabase/auth.ts (auth utilities)
- app/(auth)/login/page.tsx
- app/(auth)/signup/page.tsx
- components/auth/auth-provider.tsx
### Modified
- lib/supabase/client.ts (added auth hooks)
- middleware.ts (added auth middleware)
## QUICK RESUME
To continue this work:
1. Read this file (context.md) for current state
2. Check tasks.md for checklist
3. Refer to plan.md for overall strategy
4. Current file: lib/supabase/auth.ts
5. Next: Implement refreshToken() function
6. After that: Test token refresh flow
3. {task-name}-tasks.md - 実行可能なチェックリスト
目的: 受け入れ基準を含む、詳細で実行可能なタスク
内容:
- 詳細なタスクの内訳
- 各タスクの受け入れ基準
- タスク間の依存関係
- タスクのステータス(保留中/進行中/完了)
更新頻度: 毎日、またはタスク完了後
例:
# Authentication Implementation Tasks
## Phase 1: Supabase Setup ✅
- [x] Create Supabase project (Acceptance: Project created, credentials stored)
- [x] Enable Email auth provider (Acceptance: Can sign up via email)
- [x] Configure redirect URLs (Acceptance: Auth callbacks work locally + prod)
- [x] Add auth schema to database (Acceptance: Users table exists)
## Phase 2: Backend Auth 🟡
- [x] Create auth utilities (Acceptance: getUser(), signIn(), signUp() functions work)
- [ ] Implement token refresh **(IN PROGRESS)**
- Acceptance: Tokens refresh automatically before expiry
- Dependencies: Auth utilities complete
- Notes: Need to handle offline case
- [ ] Add auth middleware to Edge Functions
- Acceptance: Protected routes return 401 if not authenticated
- Dependencies: Token refresh working
- [ ] Create auth helper for server components
- Acceptance: Can check auth in Server Components
## Phase 3: Frontend Auth ⏳
- [x] Create auth context provider (Acceptance: Auth state available app-wide)
- [x] Build login page (Acceptance: Can log in with email/password)
- [x] Build signup page (Acceptance: Can create 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Context Persistence Skill
Purpose
Ensure Claude Code can resume work seamlessly after context resets, session interruptions, or long breaks by maintaining structured documentation of current work, decisions, and progress.
When to Use This Skill
Automatically activates when you mention:
- Waypoint plans, waypoint planning
- Resuming work, continuing work
- Session survival, context reset
- Task handoff, progress tracking
- Long-running features or projects
- Need to document current state
The Problem: Context Resets
What happens during a context reset:
- ❌ All conversation history lost
- ❌ Current task context forgotten
- ❌ Decisions and rationale gone
- ❌ Progress not tracked
- ❌ Have to re-explain everything
With context persistence:
- ✅ Current task documented
- ✅ Decisions and rationale preserved
- ✅ Progress clearly tracked
- ✅ Quick resume in < 1 minute
- ✅ Seamless handoff to future sessions
Three-File Structure
The core pattern uses three complementary files in plans/active/{task-name}/:
1. {task-name}-plan.md - The Strategic Plan
Purpose: High-level strategy and approach
Contains:
- Feature/task overview
- Requirements and acceptance criteria
- Architecture approach
- Implementation phases
- Dependencies and constraints
- Risks and mitigations
Update frequency: Rarely (only when approach changes)
Example:
# Authentication Implementation Plan
## Overview
Add JWT-based authentication to replace session cookies for mobile app support.
## Requirements
- JWT tokens with refresh mechanism
- Supabase Auth integration
- Protected API routes
- Mobile-friendly (stateless)
## Architecture
- Auth middleware in Edge Functions
- Token storage in httpOnly cookies (web) + AsyncStorage (mobile)
- Row-Level Security policies for data access
## Implementation Phases
1. Supabase Auth setup
2. Edge Function auth middleware
3. Frontend auth hooks
4. RLS policies
5. Migration from existing auth
## Dependencies
- Supabase setup complete
- Database schema finalized
2. {task-name}-context.md - Current State & Progress
Purpose: Living document of current state, decisions, and progress
Contains:
- SESSION PROGRESS (updated frequently)
- Key decisions made
- Important discoveries
- Current blockers
- Files modified
- Quick resume instructions
Update frequency: After each significant change or decision
Example:
# Authentication Implementation Context
## SESSION PROGRESS (2025-01-15 14:30)
### ✅ COMPLETED
- [x] Supabase Auth configured
- [x] Created auth middleware for Edge Functions
- [x] Implemented login/signup pages
- [x] Added auth context provider
### 🟡 IN PROGRESS
- [ ] Implementing token refresh logic (CURRENT)
- Working on: lib/supabase/auth.ts
- Next: Handle token expiration gracefully
### ⏳ PENDING
- [ ] Add RLS policies
- [ ] Migrate existing users
- [ ] Add mobile auth flow
- [ ] Write auth tests
### 🎯 NEXT ACTION
Continue implementing refreshToken() function in lib/supabase/auth.ts
- Handle expired tokens
- Refresh transparently
- Redirect to login if refresh fails
## KEY DECISIONS
### Decision: JWT vs. Session Cookies (2025-01-12)
**Chose**: JWT tokens
**Rationale**: Need stateless auth for mobile apps
**Impact**: Requires token refresh mechanism
### Decision: Supabase Auth vs. Custom (2025-01-13)
**Chose**: Supabase Auth
**Rationale**: Built-in RLS integration, handles token refresh
**Impact**: Less custom code, tighter Supabase integration
## IMPORTANT DISCOVERIES
### Token Refresh Timing
Discovered tokens expire after 1 hour by default. Need to:
- Refresh proactively at 50 minutes
- Handle edge case of offline user
- Store refresh token securely
### RLS Row vs. Column Level
Supabase RLS is row-level only, not column-level.
For sensitive columns, need separate tables.
## CURRENT BLOCKERS
None currently. Auth flow is straightforward with Supabase.
## FILES MODIFIED
### Created
- lib/supabase/auth.ts (auth utilities)
- app/(auth)/login/page.tsx
- app/(auth)/signup/page.tsx
- components/auth/auth-provider.tsx
### Modified
- lib/supabase/client.ts (added auth hooks)
- middleware.ts (added auth middleware)
## QUICK RESUME
To continue this work:
1. Read this file (context.md) for current state
2. Check tasks.md for checklist
3. Refer to plan.md for overall strategy
4. Current file: lib/supabase/auth.ts
5. Next: Implement refreshToken() function
6. After that: Test token refresh flow
3. {task-name}-tasks.md - Actionable Checklist
Purpose: Granular, actionable tasks with acceptance criteria
Contains:
- Detailed task breakdown
- Acceptance criteria for each task
- Dependencies between tasks
- Task status (pending/in-progress/complete)
Update frequency: Daily or after completing tasks
Example:
# Authentication Implementation Tasks
## Phase 1: Supabase Setup ✅
- [x] Create Supabase project (Acceptance: Project created, credentials stored)
- [x] Enable Email auth provider (Acceptance: Can sign up via email)
- [x] Configure redirect URLs (Acceptance: Auth callbacks work locally + prod)
- [x] Add auth schema to database (Acceptance: Users table exists)
## Phase 2: Backend Auth 🟡
- [x] Create auth utilities (Acceptance: getUser(), signIn(), signUp() functions work)
- [ ] Implement token refresh **(IN PROGRESS)**
- Acceptance: Tokens refresh automatically before expiry
- Dependencies: Auth utilities complete
- Notes: Need to handle offline case
- [ ] Add auth middleware to Edge Functions
- Acceptance: Protected routes return 401 if not authenticated
- Dependencies: Token refresh working
- [ ] Create auth helper for server components
- Acceptance: Can check auth in Server Components
## Phase 3: Frontend Auth ⏳
- [x] Create auth context provider (Acceptance: Auth state available app-wide)
- [x] Build login page (Acceptance: Can log in with email/password)
- [x] Build signup page (Acceptance: Can create account)
- [ ] Add protected route wrapper
- Acceptance: Redirects to login if not authenticated
- Dependencies: Auth context complete
- [ ] Add loading states
- Acceptance: Shows loading spinner during auth checks
## Phase 4: Security 🔒
- [ ] Add RLS policies
- Acceptance: Users can only access their own data
- Files: supabase/migrations/xxx_rls_policies.sql
- [ ] Test auth edge cases
- Expired tokens
- Invalid tokens
- Network failures
- Concurrent sessions
## Phase 5: Migration 📦
- [ ] Create migration script for existing users
- [ ] Test migration locally
- [ ] Schedule maintenance window
- [ ] Execute migration in production
- [ ] Verify all users migrated successfully
SESSION PROGRESS Pattern
The SESSION PROGRESS section is the most important part of context.md:
Structure
## SESSION PROGRESS (2025-01-15 14:30)
### ✅ COMPLETED
[What's done - be specific]
### 🟡 IN PROGRESS
[What you're working on RIGHT NOW]
### ⏳ PENDING
[What's coming next]
### 🚫 BLOCKED
[What's preventing progress - if any]
### 🎯 NEXT ACTION
[Specific next step with file + function]
Best Practices
DO ✅:
- Update after each significant milestone
- Be specific about current file/function
- Include "NEXT ACTION" for easy resume
- Mark completed items immediately
- Note blockers as they arise
DON'T ❌:
- Leave stale progress (update regularly)
- Be vague ("working on auth" → "implementing refreshToken() in auth.ts")
- Forget to mark completed items
- Skip the NEXT ACTION (critical for resume)
Update Frequency
| Event | Update SESSION PROGRESS? |
|---|---|
| Completed a full task | ✅ Yes |
| Significant decision made | ✅ Yes |
| Discovered blocker | ✅ Yes |
| Changed approach | ✅ Yes |
| Switching to different task | ✅ Yes |
| Minor code change | ❌ No |
| Formatting/cleanup | ❌ No |
| Reading code | ❌ No |
Quick Resume Instructions
Always include this section in context.md:
## QUICK RESUME
To continue this work:
1. **Read**: This file (context.md) for current state
2. **Check**: tasks.md for detailed checklist
3. **Reference**: plan.md for overall strategy
4. **Current file**: [exact file path]
5. **Current function**: [exact function/component name]
6. **Next step**: [specific action to take]
7. **After that**: [following step]
8. **Expected time**: [estimate for next step]
### If Context is Stale (> 3 days old)
1. Verify current code state matches context
2. Check for changes by others (git log)
3. Update context.md before proceeding
When to Create Waypoint Plans
Always Create For
✅ Features taking > 2 hours ✅ Multi-session work ✅ Complex implementations ✅ Work likely to be interrupted ✅ Team handoffs ✅ Refactorings affecting multiple files
Optional For
⚠️ Simple bug fixes (< 30 min) ⚠️ Documentation updates ⚠️ Minor UI tweaks ⚠️ Configuration changes
Never Create For
❌ Trivial changes ❌ Automated tasks ❌ One-liner fixes
Rule of Thumb: If you might forget context after lunch, create a waypoint plan.
Directory Structure
plans/
├── active/ # Current work
│ ├── auth-implementation/
│ │ ├── auth-implementation-plan.md
│ │ ├── auth-implementation-context.md
│ │ └── auth-implementation-tasks.md
│ ├── payments-integration/
│ │ ├── payments-integration-plan.md
│ │ ├── payments-integration-context.md
│ │ └── payments-integration-tasks.md
│ └── README.md # Active work index
├── archived/ # Completed work
│ └── [moved completed tasks]
└── templates/ # Templates for new tasks
├── template-plan.md
├── template-context.md
└── template-tasks.md
File Naming Convention
Pattern: {task-slug}-{type}.md
Examples:
auth-implementation-plan.mdauth-implementation-context.mdauth-implementation-tasks.md
task-slug:
- Lowercase
- Hyphen-separated
- Descriptive (not generic)
- Max 3-4 words
Good slugs:
auth-implementationstripe-paymentsuser-dashboard
Bad slugs:
feature(too generic)task-123(meaningless)implement_new_authentication_system_with_jwt(too long)
Commands for Claude Code Waypoint Plugin
Provide these commands:
# Create new waypoint plan
/create-plan [task-name] # Creates 3-file structure
# Update existing waypoint
/update-context # Updates SESSION PROGRESS
# Resume work
/resume # Shows latest context + next action
/resume [task-name] # Resume specific task
# Archive completed work
/archive [task-name] # Moves to archived/
Integration with Commands
/create-plan Command
Creates the three-file structure automatically:
/create-plan auth-implementation
Creates:
- plans/active/auth-implementation/auth-implementation-plan.md
- plans/active/auth-implementation/auth-implementation-context.md
- plans/active/auth-implementation/auth-implementation-tasks.md
See the /create-plan command documentation for details.
/update-context Command
Updates SESSION PROGRESS section with prompts:
/update-context
Prompts:
- What did you complete?
- What are you currently working on?
- What's the specific file/function?
- What's the next action?
- Any blockers?
/resume Command
Displays context for quick resume:
/resume
Output:
📂 Resuming: auth-implementation
📋 CONTEXT SUMMARY:
- Last updated: 2 hours ago
- In progress: Implementing token refresh
✅ COMPLETED (3/8): ...
🟡 IN PROGRESS (1/8): ...
➡️ NEXT ACTION: Implement refreshToken() in lib/supabase/auth.ts
Best Practices
DO ✅
- Update context after significant changes (not after every line)
- Be specific in NEXT ACTION (file + function + what to do)
- Mark tasks complete immediately (don't batch them)
- Document decisions with rationale (the "why" not just "what")
- Include code snippets in context (for complex logic)
- Add timestamps to SESSION PROGRESS (know when it was updated)
- Archive completed tasks (keep active/ directory clean)
DON'T ❌
- Don't let context get stale (> 3 days without update = stale)
- Don't be vague ("working on auth" tells you nothing)
- Don't skip NEXT ACTION (critical for resuming)
- Don't forget to update after decisions (decisions are context!)
- Don't duplicate info (plan vs. context vs. tasks have different purposes)
- Don't commit sensitive info (credentials, API keys)
Handling Context Staleness
Detecting Staleness
Context is stale if:
- Last updated > 3 days ago
- Code changed significantly since update
- Blocker was noted but not resolved
- IN PROGRESS task completed but not marked
Refreshing Stale Context
## Context Refresh Checklist
Before resuming stale context:
- [ ] Read current code in "current file"
- [ ] Check git log for changes since last update
- [ ] Verify IN PROGRESS task is actually in progress
- [ ] Update completed tasks
- [ ] Remove resolved blockers
- [ ] Update NEXT ACTION if changed
- [ ] Add note: "Context refreshed on [date]"
Example: Complete Context Lifecycle
Day 1: Create Waypoint Plan
User: "Let's implement JWT authentication"
Claude: "I'll create a waypoint plan for this task"
/create-plan auth-implementation
Creates 3 files with:
- Plan: Overall strategy
- Context: Empty SESSION PROGRESS
- Tasks: Broken down checklist
Day 1: Work & Update
After 2 hours of work:
## SESSION PROGRESS (2025-01-15 14:30)
### ✅ COMPLETED
- [x] Supabase Auth configured
- [x] Created auth utilities
### 🟡 IN PROGRESS
- [ ] Implementing login page
### 🎯 NEXT ACTION
Complete LoginForm component in app/(auth)/login/page.tsx
Day 2: Resume
User: "Continue with authentication"
Claude: /resume
→ Shows SESSION PROGRESS
→ "You were implementing LoginForm component"
→ Continues seamlessly
Day 3: Context Reset
Context reset happens (100K tokens)
User: "Continue with authentication"
Claude: /resume
→ Reads context.md
→ "I see you're implementing JWT auth"
→ "Last worked on: LoginForm component"
→ "Next action: Add form validation"
→ Continues without missing a beat
Day 5: Complete & Archive
User: "Authentication is done"
Claude: Updates all tasks to completed
/archive auth-implementation
Moves files to:
plans/archived/auth-implementation/
Summary
Claude Code Waypoint Plugin enables:
- ✅ Seamless resume after context resets
- ✅ Quick handoff between sessions
- ✅ Clear progress tracking
- ✅ Decision documentation
- ✅ Team collaboration
Three-file structure:
- plan.md: Strategy (rarely changes)
- context.md: Current state (updated frequently)
- tasks.md: Actionable checklist (updated daily)
Key section: SESSION PROGRESS in context.md
Commands: /create-plan, /update-context, /resume
Rule: If work takes > 2 hours or spans multiple sessions, create a waypoint plan!
Use this skill to make Claude Code resilient to context resets and interruptions.