Skip to content

Feature: auto context-reset between workflow phases (design→spec→plan→execute) #1503

Closed as not planned

Description

@ikeniborn

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

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:

  1. Persist the produced artifact (design doc / spec / plan) to its canonical path under docs/superpowers/.
  2. Reset Claude Code context (/clear or compact-equivalent).
  3. Reload only:
    • finalized artifact for the completed phase
    • skill body for the next phase
    • minimal preserved state (active branch, worktree, plan file path)
  4. 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

Design questions

  • Mechanism: hook on skill completion? new lifecycle event (cf. Expose lifecycle events beyond SessionStart for external integration #1442)? slash command /handoff user invokes? skill phase-transition that 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 /clear loses memory injections; compact preserves them but may keep stale phase content. Probably /clear + re-fire SessionStart is 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

Out of scope

Activity

  1. added
    enhancement
    plans
    on May 11, 2026
  2. stargazer33 commented on May 12, 2026

    @stargazer33

    Ok, i understand, this should be implemented first: but pls return to #1490 once this one is done!

    thanks in advance!

  3. obra commented on Jun 16, 2026

    @obra
    Owner

    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.

  4. stargazer33 commented on Jun 16, 2026

    @stargazer33

    Well, at the moment I am using such a hack in form of shell script (all this on Ubuntu, OpenCode):

    ...
    npx opencode run \
    "Use SUPERPOWERS writing-plans SKILL to turn spec $SPEC_FILE into implementation plan $PLAN_FILE
    Resulting implementation plan **must** be named $PLAN_FILE - NON-NEGOTIABLE!!! " \
    -m opencode-go/qwen3.7-max -f "$SPEC_FILE"
    
    npx opencode run \
    "use SUPERPOWERS subagent-driven-development to execute $PLAN_FILE" \
    -m opencode-go/mimo-v2.5 -f "$PLAN_FILE"
    

    not a rocket science but works :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplans

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions