Agent skill
l-thread
Long-duration autonomous task with checkpoints and verification. Use when: - User says "overnight", "long running", "autonomous task" - User mentions "l-thread", "extended task" - Task will consume significant context window - Multi-phase implementation requiring persistence across interruptions
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/l-thread
SKILL.md
Long-Duration Thread: Autonomous Execution with Checkpoints
For tasks too large for a single context window. Implements checkpoint/restore, automatic verification, and graceful recovery.
When to Use
- Large refactors spanning 10+ files
- Full feature implementation with tests
- Migration tasks (dependency upgrades, API changes)
- Any task estimated at >50% context window
Checkpoint Strategy
Automatic Checkpoints
Checkpoints are saved automatically at context usage thresholds. See hooks/checkpoint.md for actions at 70% / 80% / 90%.
Manual Checkpoints
Save checkpoints at these milestones:
- After completing a logical phase
- Before risky operations (schema changes, large refactors)
- After passing verification
Checkpoint Contents
See hooks/checkpoint.md for the full checkpoint JSON schema, storage location, and auto-checkpoint threshold actions.
Save/Restore Commands
# Save checkpoint
/checkpoint save "Completed phase 3"
# List checkpoints
/checkpoint list
# Restore from latest
/checkpoint restore
Verification Stack
Every checkpoint must pass Levels 1-3 before saving. Full verification (Levels 1-5) at task completion. See hooks/verification-check.md for the complete 5-level stack, per-agent requirements, and failure handling.
Workflow
Phase 1: Planning
Task(planner, "Break down [task] into phases with dependencies and estimates")
Produce a phased plan with:
- Ordered phases with dependencies
- Token estimates per phase
- Checkpoint points identified
- Verification criteria per phase
Phase 2: Execution Loop
For each phase:
- Start: Log phase start
- Implement: Execute the phase work
- Verify: Run verification stack
- Checkpoint: Save state if milestone reached
- Monitor: Check context usage, checkpoint if threshold hit
Phase 3: Completion
## Verification Summary
- [x] TypeScript compiles
- [x] Biome lint passes
- [x] Tests pass (N/N)
- [x] All phases completed
<promise>COMPLETE</promise>
Recovery from Interruption
When resuming after interruption:
- Run
checkpoint.sh restoreto load latest state - Check git status for uncommitted work
- Review remaining todos
- Run verification to confirm baseline
- Continue from next incomplete phase
Completion Promise
The task is NOT complete until:
1. All phases done
2. Verification passes (compile + lint + test)
3. Git is clean (all changes committed)
4. Summary provided with what was done
Only then output:
<promise>COMPLETE</promise>
Never claim completion with failing verification.
Example
User: "Migrate all class components to hooks across the app"
→ Task(planner, "Break migration into phases by module")
Plan: 6 phases, ~4 context windows estimated
Phase 1: Core hooks (auth, routing)
→ Implement → Verify → Checkpoint at 30%
Phase 2: Feature hooks (dashboard, settings)
→ Implement → Verify → Checkpoint at 55%
→ Context at 70% → auto-checkpoint, continue
Phase 3: Shared components
→ Context at 90% → auto-checkpoint, hand off
[New session resumes from checkpoint]
Phase 4-6: Continue...
→ Final verification → <promise>COMPLETE</promise>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?