Plan & Task Persistence
Goal
Maintain plans and task progress across Claude Code sessions so that work can be resumed without losing context.
Session Start / Post-Compaction / Session Resume
On new session start, after context compaction, or on session resume, perform the following:
- Consume checkpoints: Check
.claude/context-checkpoints/ for any checkpoint files
- Read each checkpoint file
- Integrate modified file lists and user decisions into the active task's
context-*.md
- If a checkpoint contains knowledge-worthy findings, invoke
record-knowledge
- Delete consumed checkpoint files
- Check incomplete work:
- Git-tracked mode: Read
.claude/tasks/readme.md for active plans, then read the active task's latest context-*.md to restore detailed context
- Issue-centric mode: Check assigned issues (e.g.,
gh issue list --assignee=@me) for open tasks
- On progress update, also update the issue tracker (comments, checklists) if applicable.
Progress Update Triggers
- Explicit: User says "progress update" or equivalent → execute immediately
- Implicit: User signals a break or completion (e.g., "thanks", "taking a break", "that's it for today") → suggest "Shall I update progress?" before proceeding
- Milestone: A significant chunk of work is completed → suggest "Shall I update progress?"
Progress update procedure:
- Check related issues (
gh issue list)
- Post a progress comment (completed work, next steps, related work)
- Update issue checklists if applicable
- Commit and push if there are pending changes
Setup
Copy the template files to .claude/tasks/:
mkdir -p .claude/tasks
cp assets/tasks-CLAUDE.md .claude/tasks/CLAUDE.md
cp assets/tasks-readme.md .claude/tasks/readme.md
For Issue-centric mode, also add .claude/tasks/ to .gitignore.
Two Modes
Choose the mode that fits your team's workflow:
|
Git-tracked mode |
Issue-centric mode |
| Primary source of truth |
.claude/tasks/ (committed to Git) |
Issue tracker (GitLab, GitHub, Jira, etc.) |
.claude/tasks/ role |
Shared plan/task storage |
Local working memo (gitignored) |
| Team visibility |
Via Git commits |
Via issue tracker |
| Best for |
Small teams, single-repo projects |
Teams already using an issue tracker |
Issue-centric mode
When an issue tracker is the primary source of truth:
.claude/tasks/ is gitignored — add .claude/tasks/ to .gitignore
- Plans and progress live in the issue tracker;
.claude/tasks/ is a local scratchpad for the current session
- Anything worth sharing with the team belongs in the issue tracker, not in
.claude/tasks/
- At session start, check assigned issues in your tracker instead of
.claude/tasks/readme.md
The rest of this document describes Git-tracked mode. For issue-centric mode, adapt the procedures below: use .claude/tasks/ as a local memo and post shared artifacts to the issue tracker.
Git-tracked mode
When to Use
- Starting a multi-step task that may span multiple sessions
- Resuming work — check
.claude/tasks/readme.md for incomplete plans
- Updating progress on an existing plan
- Closing out or archiving a completed plan
Directory Naming
.claude/tasks/<slug>-<account>-<date>/ # Without issue reference
.claude/tasks/<slug>-i<issue>-<account>-<date>/ # With issue reference
- Separate components with
- (hyphen)
- Separate words within slug with
_ (underscore)
- Slug uses lowercase alphanumeric only; date is YYYYMMDD
- Example:
docker_migration-alice-20260304/
- Example:
auth_refactor-i42-bob-20260304/
Directory Structure
.claude/tasks/
├── readme.md # Index of all plans (status and summary)
├── <slug>-<account>-<date>/
│ ├── readme.md # Handoff notes: current state, next actions, blockers
│ ├── plan-v1.md # Initial plan (approach, design decisions, context)
│ ├── plan-v2.md # Revised plan (v1 remains unchanged)
│ ├── todo.md # Current task progress (frequently updated)
│ ├── context-*.md # Session context: investigation details, trial & error, decisions
│ └── ...
context-*.md (Session Context Files)
Captures detailed working context that is too granular for plan-vN.md but essential for resuming work after compaction or across sessions. Each file represents a focused context segment.
Naming: context-YYYYMMDD-HHMMSS-topic.md
Format:
---
created: YYYY-MM-DD HH:MM:SS
status: active | consumed
tags: "#tag1 #tag2"
---
## HH:MM - <summary>
<details — investigation findings, configuration tried, error messages, decision rationale>
Lifecycle:
- active: Being written to during the current session
- consumed: Content has been integrated into knowledge entries or a new plan revision; kept for reference but not actively read on session start
Source of truth hierarchy:
| Information |
Source of truth |
Mirrors |
| Plan approach & rationale |
plan-vN.md |
issue body |
| Task progress |
todo.md |
issue checklists |
| Detailed working context |
context-*.md |
(not mirrored) |
| Team-shared knowledge |
knowledge entries |
(not mirrored) |
| Team visibility & progress |
issue |
(authoritative) |
| Session handoff |
readme.md |
(not mirrored) |
Creating a Plan
- Create
.claude/tasks/<slug>-<account>-<date>/ following the naming convention
- Issue link check (strongly recommended):
a. Search for related issues:
gh issue list -S "<keywords>" (includes open issues)
b. Search closed issues too: gh issue list -S "<keywords>" --state closed to avoid creating duplicate work
c. If a related issue exists, use the -i<issue> naming convention (e.g., auth_refactor-i42-bob-20260304/)
d. If no issue exists, consider creating one for team visibility before proceeding
- Search related knowledge: Grep
.claude/knowledge/entries/ for tags and keywords related to the plan's topic. Look for:
- Past pitfalls (
#pitfall) that may recur
- Design decisions and their rationale
- Related tooling or configuration knowledge
- Write
plan-v1.md with: approach, design decisions, background, completion criteria. If related knowledge was found in step 3, include a Related Knowledge section:## Related Knowledge
- [entry title](../../knowledge/entries/YYYY/MM/slug.md) — why it's relevant
- Capture detailed context: If the plan involves context too detailed for
plan-v1.md (investigation results, API behavior, configuration specifics, design trade-off analysis), create context-YYYYMMDD-HHMMSS-topic.md in the task directory. Plans summarize what and why; context files preserve the details that future sessions need to resume work. Only invoke record-knowledge for findings that are universally valuable to the team beyond this specific task
- Write
todo.md with a checkbox task list
- Write
readme.md with the plan's purpose and current state
- Add an entry to
.claude/tasks/readme.md
- Issue sync: If linked to an issue, update the issue body with the plan summary (approach, phases, completion criteria)
Working on Tasks
- Update
todo.md only — do not modify plan files
- Mark task status:
- [ ] (pending) → - [~] (in progress) → - [x] (done)
- Record discovered issues or blockers indented below the relevant task
- Add new task lines to
todo.md as work expands
- Capture context incrementally: When detailed findings emerge during work (investigation results, root causes, configuration specifics, trial & error), write them to
context-*.md in the task directory. This is automated by the PostToolUse hook for file changes, but also write manually for reasoning, decisions, and analysis that don't correspond to file edits. This ensures details survive context compaction
- Promote to knowledge selectively: Only invoke
record-knowledge for findings that are universally valuable beyond this specific task (team-shared pitfalls, reusable patterns, tool quirks). Task-specific details stay in context-*.md
- Issue sync: When updating
todo.md or readme.md, also update the linked issue (if any) with the same progress. This is not optional — if an issue link exists, keep it in sync
Issue Tracker Sync
If the plan is linked to an issue in your project's issue tracker:
- Check the issue for updates before starting work on
.claude/tasks/
- Reflect any direction changes or new comments into
.claude/tasks/
- Include the issue reference in commit messages
- Update the issue body or post a progress comment when task status changes
Revising a Plan
- Do NOT edit existing
plan-vN.md files — create plan-vN+1.md instead
- Reset
todo.md to match the new plan (carry over incomplete items)
- Update
<slug>/readme.md with which version is current and why the revision was needed
- Claude Code reads only the latest
plan-vN.md and todo.md
- Issue sync: If linked to an issue, update the issue body to reflect the revised plan
Committing Progress
- Commit when task progress changes (completion, blockers found, etc.)
- If linked to an issue, report progress there as well
Pausing or Completing Work
On session end or interruption
- Update
<slug>/readme.md with handoff notes: current state, next actions, any blockers
- Mark completed context files as
status: consumed if their content has been fully integrated
- Next session starts by checking
.claude/tasks/readme.md for incomplete plans and reading active context-*.md files
On plan completion
- Mark all tasks in
todo.md as done
- Update
<slug>/readme.md state to "completed"
- Move the entry in
.claude/tasks/readme.md from the active table to the completed table
- Issue sync: If linked to an issue, update the issue with completion status and final summary
- Knowledge extraction (retrospective): Review the completed work and extract lessons learned:
- Scan
context-*.md files and todo.md for blockers, workarounds, and unexpected discoveries
- Check for overlap with existing knowledge entries to avoid duplication — Grep
.claude/knowledge/entries/ for key terms from the findings
- Compare the plan (what was expected) with the actual outcome (what happened)
- For each piece of team-valuable tacit knowledge found (not task-specific details), invoke
record-knowledge to create an entry
- If related knowledge entries were referenced in the plan, update them with new findings
- Mark all context files as
status: consumed
- Retrospective prompt: Notify the user with a brief summary:
- What was completed
- What knowledge was promoted from context to entries
- Ask: "Are there lessons from this work not yet captured?"
1---2name: plan-task3description: Persist multi-step plans and task progress across Claude Code sessions. Use when starting work that may span multiple sessions, resuming incomplete plans, or updating task progress. Supports two modes: Git-tracked (shared via commits) and Issue-centric (issue tracker as primary source of truth, local scratchpad for sessions).4license: MIT5---6
7# Plan & Task Persistence
8
9## Goal
10
11Maintain plans and task progress across Claude Code sessions so that work can be resumed without losing context.
12
13## Session Start / Post-Compaction / Session Resume
14
15On new session start, after context compaction, or on session resume, perform the following:
16
171. **Consume checkpoints**: Check `.claude/context-checkpoints/` for any checkpoint files
18 - Read each checkpoint file
19 - Integrate modified file lists and user decisions into the active task's `context-*.md`
20 - If a checkpoint contains knowledge-worthy findings, invoke `record-knowledge`
21 - Delete consumed checkpoint files
222. **Check incomplete work**:
23 - **Git-tracked mode**: Read `.claude/tasks/readme.md` for active plans, then read the active task's latest `context-*.md` to restore detailed context
24 - **Issue-centric mode**: Check assigned issues (e.g., `gh issue list --assignee=@me`) for open tasks
253. On progress update, also update the issue tracker (comments, checklists) if applicable.
26
27## Progress Update Triggers
28
29- **Explicit**: User says "progress update" or equivalent → execute immediately
30- **Implicit**: User signals a break or completion (e.g., "thanks", "taking a break", "that's it for today") → suggest "Shall I update progress?" before proceeding
31- **Milestone**: A significant chunk of work is completed → suggest "Shall I update progress?"
32
33Progress update procedure:
341. Check related issues (`gh issue list`)
352. Post a progress comment (completed work, next steps, related work)
363. Update issue checklists if applicable
374. Commit and push if there are pending changes
38
39## Setup
40
41Copy the template files to `.claude/tasks/`:
42
43```bash
44mkdir -p .claude/tasks
45cp assets/tasks-CLAUDE.md .claude/tasks/CLAUDE.md
46cp assets/tasks-readme.md .claude/tasks/readme.md
47```
48
49For **Issue-centric mode**, also add `.claude/tasks/` to `.gitignore`.
50
51## Two Modes
52
53Choose the mode that fits your team's workflow:
54
55| | Git-tracked mode | Issue-centric mode |
56|---|---|---|
57| Primary source of truth | `.claude/tasks/` (committed to Git) | Issue tracker (GitLab, GitHub, Jira, etc.) |
58| `.claude/tasks/` role | Shared plan/task storage | Local working memo (gitignored) |
59| Team visibility | Via Git commits | Via issue tracker |
60| Best for | Small teams, single-repo projects | Teams already using an issue tracker |
61
62### Issue-centric mode
63
64When an issue tracker is the primary source of truth:
65
66- `.claude/tasks/` is **gitignored** — add `.claude/tasks/` to `.gitignore`
67- Plans and progress live in the issue tracker; `.claude/tasks/` is a local scratchpad for the current session
68- Anything worth sharing with the team belongs in the issue tracker, not in `.claude/tasks/`
69- At session start, check assigned issues in your tracker instead of `.claude/tasks/readme.md`
70
71The rest of this document describes **Git-tracked mode**. For issue-centric mode, adapt the procedures below: use `.claude/tasks/` as a local memo and post shared artifacts to the issue tracker.
72
73---
74
75## Git-tracked mode
76
77## When to Use
78
79- Starting a multi-step task that may span multiple sessions
80- Resuming work — check `.claude/tasks/readme.md` for incomplete plans
81- Updating progress on an existing plan
82- Closing out or archiving a completed plan
83
84## Directory Naming
85
86```
87.claude/tasks/<slug>-<account>-<date>/ # Without issue reference
88.claude/tasks/<slug>-i<issue>-<account>-<date>/ # With issue reference
89```
90
91- Separate components with `-` (hyphen)
92- Separate words within slug with `_` (underscore)
93- Slug uses lowercase alphanumeric only; date is YYYYMMDD
94- Example: `docker_migration-alice-20260304/`
95- Example: `auth_refactor-i42-bob-20260304/`
96
97## Directory Structure
98
99```
100.claude/tasks/
101├── readme.md # Index of all plans (status and summary)
102├── <slug>-<account>-<date>/
103│ ├── readme.md # Handoff notes: current state, next actions, blockers
104│ ├── plan-v1.md # Initial plan (approach, design decisions, context)
105│ ├── plan-v2.md # Revised plan (v1 remains unchanged)
106│ ├── todo.md # Current task progress (frequently updated)
107│ ├── context-*.md # Session context: investigation details, trial & error, decisions
108│ └── ...
109```
110
111### context-*.md (Session Context Files)
112
113Captures detailed working context that is too granular for plan-vN.md but essential for resuming work after compaction or across sessions. Each file represents a focused context segment.
114
115**Naming**: `context-YYYYMMDD-HHMMSS-topic.md`
116
117**Format**:
118```markdown
119---
120created: YYYY-MM-DD HH:MM:SS
121status: active | consumed
122tags: "#tag1 #tag2"
123---
124
125## HH:MM - <summary>
126
127<details — investigation findings, configuration tried, error messages, decision rationale>
128```
129
130**Lifecycle**:
131- **active**: Being written to during the current session
132- **consumed**: Content has been integrated into knowledge entries or a new plan revision; kept for reference but not actively read on session start
133
134**Source of truth hierarchy**:
135
136| Information | Source of truth | Mirrors |
137|-------------|----------------|---------|
138| Plan approach & rationale | plan-vN.md | issue body |
139| Task progress | todo.md | issue checklists |
140| Detailed working context | context-*.md | (not mirrored) |
141| Team-shared knowledge | knowledge entries | (not mirrored) |
142| Team visibility & progress | issue | (authoritative) |
143| Session handoff | readme.md | (not mirrored) |
144
145## Creating a Plan
146
1471. Create `.claude/tasks/<slug>-<account>-<date>/` following the naming convention
1482. **Issue link check** (strongly recommended):
149 a. Search for related issues: `gh issue list -S "<keywords>"` (includes open issues)
150 b. Search closed issues too: `gh issue list -S "<keywords>" --state closed` to avoid creating duplicate work
151 c. If a related issue exists, use the `-i<issue>` naming convention (e.g., `auth_refactor-i42-bob-20260304/`)
152 d. If no issue exists, consider creating one for team visibility before proceeding
1533. **Search related knowledge**: Grep `.claude/knowledge/entries/` for tags and keywords related to the plan's topic. Look for:
154 - Past pitfalls (`#pitfall`) that may recur
155 - Design decisions and their rationale
156 - Related tooling or configuration knowledge
1574. Write `plan-v1.md` with: approach, design decisions, background, completion criteria. If related knowledge was found in step 3, include a **Related Knowledge** section:
158 ```markdown
159 ## Related Knowledge
160 - [entry title](../../knowledge/entries/YYYY/MM/slug.md) — why it's relevant
161 ```
1625. **Capture detailed context**: If the plan involves context too detailed for `plan-v1.md` (investigation results, API behavior, configuration specifics, design trade-off analysis), create `context-YYYYMMDD-HHMMSS-topic.md` in the task directory. Plans summarize *what* and *why*; context files preserve the *details* that future sessions need to resume work. Only invoke `record-knowledge` for findings that are universally valuable to the team beyond this specific task
1636. Write `todo.md` with a checkbox task list
1647. Write `readme.md` with the plan's purpose and current state
1658. Add an entry to `.claude/tasks/readme.md`
1669. **Issue sync**: If linked to an issue, update the issue body with the plan summary (approach, phases, completion criteria)
167
168## Working on Tasks
169
170- Update `todo.md` only — do not modify plan files
171- Mark task status: `- [ ]` (pending) → `- [~]` (in progress) → `- [x]` (done)
172- Record discovered issues or blockers indented below the relevant task
173- Add new task lines to `todo.md` as work expands
174- **Capture context incrementally**: When detailed findings emerge during work (investigation results, root causes, configuration specifics, trial & error), write them to `context-*.md` in the task directory. This is automated by the PostToolUse hook for file changes, but also write manually for reasoning, decisions, and analysis that don't correspond to file edits. This ensures details survive context compaction
175- **Promote to knowledge selectively**: Only invoke `record-knowledge` for findings that are universally valuable beyond this specific task (team-shared pitfalls, reusable patterns, tool quirks). Task-specific details stay in `context-*.md`
176- **Issue sync**: When updating `todo.md` or `readme.md`, also update the linked issue (if any) with the same progress. This is not optional — if an issue link exists, keep it in sync
177
178### Issue Tracker Sync
179
180If the plan is linked to an issue in your project's issue tracker:
181
182- Check the issue for updates before starting work on `.claude/tasks/`
183- Reflect any direction changes or new comments into `.claude/tasks/`
184- Include the issue reference in commit messages
185- Update the issue body or post a progress comment when task status changes
186
187## Revising a Plan
188
189- Do NOT edit existing `plan-vN.md` files — create `plan-vN+1.md` instead
190- Reset `todo.md` to match the new plan (carry over incomplete items)
191- Update `<slug>/readme.md` with which version is current and why the revision was needed
192- Claude Code reads only the latest `plan-vN.md` and `todo.md`
193- **Issue sync**: If linked to an issue, update the issue body to reflect the revised plan
194
195## Committing Progress
196
197- Commit when task progress changes (completion, blockers found, etc.)
198- If linked to an issue, report progress there as well
199
200## Pausing or Completing Work
201
202### On session end or interruption
203
204- Update `<slug>/readme.md` with handoff notes: current state, next actions, any blockers
205- Mark completed context files as `status: consumed` if their content has been fully integrated
206- Next session starts by checking `.claude/tasks/readme.md` for incomplete plans and reading active `context-*.md` files
207
208### On plan completion
209
210- Mark all tasks in `todo.md` as done
211- Update `<slug>/readme.md` state to "completed"
212- Move the entry in `.claude/tasks/readme.md` from the active table to the completed table
213- **Issue sync**: If linked to an issue, update the issue with completion status and final summary
214- **Knowledge extraction (retrospective)**: Review the completed work and extract lessons learned:
215 1. Scan `context-*.md` files and `todo.md` for blockers, workarounds, and unexpected discoveries
216 2. Check for overlap with existing knowledge entries to avoid duplication — Grep `.claude/knowledge/entries/` for key terms from the findings
217 3. Compare the plan (what was expected) with the actual outcome (what happened)
218 4. For each piece of **team-valuable** tacit knowledge found (not task-specific details), invoke `record-knowledge` to create an entry
219 5. If related knowledge entries were referenced in the plan, update them with new findings
220 6. Mark all context files as `status: consumed`
221- **Retrospective prompt**: Notify the user with a brief summary:
222 - What was completed
223 - What knowledge was promoted from context to entries
224 - Ask: "Are there lessons from this work not yet captured?"