Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Description
- I searched existing issues and found related but distinct proposals ([FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490, Feature: Plan-aware session handoff commands (/create_handoff + /resume_plan) #931, Clear context after building detailed implementation plan - Claude Code #478)
Problem
Superpowers workflow runs brainstorming → writing-plans → executing-plans / subagent-driven-development typically in a single Claude Code session. Context window accumulates across phases:
- brainstorming dialogue, rejected alternatives, clarifying Q&A
- spec drafts, revisions, section-by-section validation
- plan iterations, task decomposition discussion
- subagent dispatch logs
By execute phase, context is polluted with stale design/spec deliberation. Model attends to obsolete intermediate state instead of the final artifact. Quality degrades, token cost inflates.
Today users do this manually: quit session → start new one → re-invoke next skill pointing at saved artifact. Fragile, easy to skip, loses skill auto-loading.
Relation to existing issues
- [FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490 (open) — proposes full automation
brainstorm → plan → implementwith model switching + compact between steps. Overlaps but framed as end-to-end automation; this proposal is narrower and orthogonal: context hygiene as a primitive, applicable even when user wants to stay in driver's seat. - Feature: Plan-aware session handoff commands (/create_handoff + /resume_plan) #931 (open) —
/create_handoff+/resume_planfor cross-session continuation when context fills. Different trigger (mid-execution overflow vs. phase boundary); complementary. - Clear context after building detailed implementation plan - Claude Code #478 (closed) — clear context after plan, before execute. Same idea but only one transition out of three.
This issue generalizes #478 to all phase boundaries and decouples it from the full-automation framing of #1490.
Proposal
At each phase transition, support an automated handoff:
- Persist the produced artifact (design doc / spec / plan) to its canonical path under
docs/superpowers/. - Reset Claude Code context (
/clearor compact-equivalent). - Reload only:
- finalized artifact for the completed phase
- skill body for the next phase
- minimal preserved state (active branch, worktree, plan file path)
- Resume in clean context with next-phase skill auto-invoked.
Three transitions:
| From → To | Loaded artifact | Loaded skill |
|---|---|---|
| design → spec | design doc | writing-plans (or spec-writing skill if separated) |
| spec → plan | spec | writing-plans |
| plan → execute | plan | executing-plans or subagent-driven-development |
Why this belongs in core
- Context hygiene is workflow-level concern, not user concern. Skills already know phase boundaries.
- Saved artifacts are already structured (
docs/superpowers/specs/*.md,docs/superpowers/plans/*.md) — handoff has unambiguous input. - Skill chain already declares next step at each handoff message; transition just needs to be executed mechanically instead of advisorily.
- Keeps user-facing UX identical (no new commands required) when opted in by default; complements [FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490 / Feature: Plan-aware session handoff commands (/create_handoff + /resume_plan) #931 rather than competes.
Design questions
- Mechanism: hook on skill completion? new lifecycle event (cf. Expose lifecycle events beyond SessionStart for external integration #1442)? slash command
/handoffuser invokes? skillphase-transitionthat wraps/clear+ reload? - Opt-in vs default: per-skill flag, plugin-level setting, or per-invocation override?
- State preservation: memory/preferences already persist across sessions. What else needs explicit carry-over (active worktree, plan file path, model selection)?
- Compact vs clear: full
/clearloses memory injections; compact preserves them but may keep stale phase content. Probably/clear+ re-fireSessionStartis cleanest. - Failure mode: if next-phase skill cannot be auto-invoked after reset (e.g., harness limitation), fall back to printing exact resume command for user.
Benefits
- Each phase operates on clean, focused context — finalized artifact is ground truth, not one option among many
- Reduced token cost (no replay of brainstorming chatter during execution)
- Removes the manual "quit and resume" step that users skip under pressure
- Foundation for [FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490 full automation (this is the building block; [FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490 is the orchestration on top)
Out of scope
- Model switching across phases (covered by [FEATURE] Full automation for BRAINSTORM->PLAN->IMPLEMENT #1490)
- Mid-phase context overflow handoff (covered by Feature: Plan-aware session handoff commands (/create_handoff + /resume_plan) #931)
- Worktree management (covered by
using-git-worktrees)
Reacted by Rolson Alister, Dmitri Dmitri, Kurt, ShuChangCloud, laiwang233, dar-mit, Matt Cable and gcalle-coder
Activity
stargazer33 commentedon May 12, 2026
Ok, i understand, this should be implemented first: but pls return to #1490 once this one is done!
thanks in advance!
obra commentedon Jun 16, 2026
I'd love this. Unfortunately, the harnesses don't expose the ability for agents to autonomously clear or compact the session. Subagent Driven Development does move most of the implementation-side context into subagents.
stargazer33 commentedon Jun 16, 2026
Well, at the moment I am using such a hack in form of shell script (all this on Ubuntu, OpenCode):
not a rocket science but works :-)