From 2efce9fd2a45217e8bb631faf04e4b463f67959c Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Fri, 10 Apr 2026 11:45:20 -0700 Subject: [PATCH 1/2] perf(workflow): limit prior-phase context to 3 most recent phases (#1969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When CONTEXT_WINDOW >= 500000 (1M models), the planner loaded ALL prior phase CONTEXT.md and SUMMARY.md files for cross-phase consistency. On projects with 20+ phases, this consumed significant context budget with diminishing returns — decisions from phase 2 are rarely relevant to phase 22. Limit to the 3 most recent completed phases, which provides enough cross-phase context for consistency while keeping the planner's context budget focused on the current phase's plans. Closes #1969 Co-Authored-By: Claude Opus 4.6 --- get-shit-done/workflows/plan-phase.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 6903e3529..88bde190a 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -34,7 +34,7 @@ AGENT_SKILLS_CHECKER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agen CONTEXT_WINDOW=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get context_window 2>/dev/null || echo "200000") ``` -When `CONTEXT_WINDOW >= 500000`, the planner prompt includes prior phase CONTEXT.md files so cross-phase decisions are consistent (e.g., "use library X for all data fetching" from Phase 2 is visible to Phase 5's planner). +When `CONTEXT_WINDOW >= 500000`, the planner prompt includes the 3 most recent prior phase CONTEXT.md and SUMMARY.md files so cross-phase decisions are consistent (e.g., "use library X for all data fetching" from Phase 2 is visible to Phase 5's planner). Limited to 3 to stay within context budget on large projects. Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `text_mode`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_reviews`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`, `response_language`. @@ -642,9 +642,10 @@ Planner prompt: - {reviews_path} (Cross-AI Review Feedback - if --reviews) - {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists) ${CONTEXT_WINDOW >= 500000 ? ` -**Cross-phase context (1M model enrichment):** -- Prior phase CONTEXT.md files (locked decisions from earlier phases — maintain consistency) -- Prior phase SUMMARY.md files (what was actually built — reuse patterns, avoid duplication) +**Cross-phase context (1M model enrichment — 3 most recent prior phases only):** +- CONTEXT.md files from the 3 most recent completed phases (locked decisions — maintain consistency) +- SUMMARY.md files from the 3 most recent completed phases (what was built — reuse patterns, avoid duplication) +- Skip phases older than the 3 most recent to stay within context budget ` : ''} From e0b766a08bac0d7f85f13f1dab40cc7bd497aa69 Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Sat, 11 Apr 2026 03:31:09 -0700 Subject: [PATCH 2/2] perf(workflow): include Depends on phases in prior-phase context (#1969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per approved spec in #1969, the planner must include CONTEXT.md and SUMMARY.md from any phases listed in the current phase's 'Depends on:' field in ROADMAP.md, in addition to the 3 most recent completed phases. This ensures explicit dependencies are always visible to the planner regardless of recency — e.g., Phase 7 declaring 'Depends on: Phase 2' always sees Phase 2's context, not just when Phase 2 is among the 3 most recent. Review feedback on #2058 from @trek-e. --- get-shit-done/workflows/plan-phase.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 88bde190a..5d4a29753 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -34,7 +34,7 @@ AGENT_SKILLS_CHECKER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agen CONTEXT_WINDOW=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get context_window 2>/dev/null || echo "200000") ``` -When `CONTEXT_WINDOW >= 500000`, the planner prompt includes the 3 most recent prior phase CONTEXT.md and SUMMARY.md files so cross-phase decisions are consistent (e.g., "use library X for all data fetching" from Phase 2 is visible to Phase 5's planner). Limited to 3 to stay within context budget on large projects. +When `CONTEXT_WINDOW >= 500000`, the planner prompt includes the 3 most recent prior phase CONTEXT.md and SUMMARY.md files PLUS any phases explicitly listed in the current phase's `Depends on:` field in ROADMAP.md. Explicit dependencies always load regardless of recency (e.g., Phase 7 declaring `Depends on: Phase 2` always sees Phase 2's context). Bounded recency keeps the planner's context budget focused on recent work. Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `text_mode`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_reviews`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`, `response_language`. @@ -642,10 +642,11 @@ Planner prompt: - {reviews_path} (Cross-AI Review Feedback - if --reviews) - {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists) ${CONTEXT_WINDOW >= 500000 ? ` -**Cross-phase context (1M model enrichment — 3 most recent prior phases only):** +**Cross-phase context (1M model enrichment):** - CONTEXT.md files from the 3 most recent completed phases (locked decisions — maintain consistency) - SUMMARY.md files from the 3 most recent completed phases (what was built — reuse patterns, avoid duplication) -- Skip phases older than the 3 most recent to stay within context budget +- CONTEXT.md and SUMMARY.md from any phases listed in the current phase's "Depends on:" field in ROADMAP.md (regardless of recency — explicit dependencies always load, deduplicated against the 3 most recent) +- Skip all other prior phases to stay within context budget ` : ''}