# Defer Work Pattern

Captures work-in-progress to a file so users can resume in a fresh session without losing context.

## When to Use

- After critique/trade-off checks surface issues requiring decisions
- When context window is getting full
- When work is too complex to complete in current session
- When user explicitly requests deferral

## Core Principle

**Always write the file.** Don't wait for the user to say "defer." After any critique or trade-off check, write the defer file immediately. This gives the user options:

1. **Leave** - Context is captured. Start fresh session anytime.
2. **Continue** - Work from the defer file as the task tracker.

Either way, the file exists and nothing is lost.

## Workflow

### 1. Write the Defer File

Location: `.claude/deferred/YYYY-MM-DD-<topic>.md`

Use the template in `template.md`. Include:
- What we were doing and why
- Findings from critique/check
- Open questions requiring decisions
- Concrete tasks to complete the work

### 2. Inform the User

After writing the file, tell the user:

```
Checkpoint saved to .claude/deferred/YYYY-MM-DD-<topic>.md

You can:
- Clear context now and resume later with "pick up <topic>"
- Continue here - I'll work from the checkpoint file

What would you like to do?
```

### 3. If Continuing

When the user chooses to continue (or in a resumed session):

**Use subagents for efficiency.** Dispatch Task tool agents to:
- Read the defer file for context
- Execute individual tasks
- Mark tasks complete in the file

This keeps the main thread focused on coordination, not implementation. The defer file becomes the shared source of truth between main thread and subagents.

### 4. Cleanup

When all tasks are complete:
- Verify the work meets original intent
- Delete the defer file
- Inform the user the deferred work is complete

## File Naming

Format: `YYYY-MM-DD-<topic>.md`

Examples:
- `2026-01-20-skill-brainstorming.md`
- `2026-01-20-plugin-audit-findings.md`
- `2026-01-20-agent-design-tradeoffs.md`

Keep `<topic>` short but descriptive. It's used for resumption: "pick up <topic>".

## Resumption

Users can resume with natural language:
- "pick up skill brainstorming"
- "continue the plugin audit"
- "what deferred work do I have?"

On resumption:
1. Read the defer file
2. Summarize current state
3. Ask which task to tackle first (or recommend one)
4. Use subagents to execute tasks
