Skip to main content

What is STATE.md?

STATE.md is the project’s short-term memory spanning all phases and sessions. Purpose: Enable instant session restoration and track accumulated context. Problem it solves: Information is captured in summaries, issues, and decisions but not systematically consumed. Sessions start without context. Solution: A single, small file that’s:
  • Read FIRST in every workflow
  • Updated after every significant action
  • Contains digest of accumulated context
  • Enables /gsd:resume-work instant restoration
Size constraint: STATE.md stays under 100 lines. It’s a DIGEST, not an archive. Detail lives in PROJECT.md, SUMMARY.md, ROADMAP.md.

File Structure

Lifecycle

Creation

When: After ROADMAP.md is created (during /gsd:new-project) Initial state:
  • Reference PROJECT.md (read for current context)
  • Initialize empty accumulated context sections
  • Set position to “Phase 1 ready to plan”
  • Progress: 0%

Reading

First step of EVERY workflow:
Workflows that read STATE.md:
  • /gsd:progress — Present status to user
  • /gsd:plan-phase — Inform planning decisions
  • /gsd:execute-phase — Know current position
  • /gsd:verify-work — Understand context for UAT
  • /gsd:resume-work — Full context restoration
  • /gsd:quick — Position awareness for ad-hoc work

Writing

After every significant action: Update mechanism (via CLI tool):

Sections Explained

Project Reference

Purpose: Quick context pointer to PROJECT.md Contents:
  • Core value (the ONE thing that matters)
  • Current focus (which phase)
  • Last update date (triggers re-read if stale)
Why not inline project details? Keeps STATE.md small. Claude reads PROJECT.md directly for full context. Update trigger: When PROJECT.md is modified (decision logged, constraint added)

Current Position

Purpose: Instant “where am I?” answer Contents:
  • Phase X of Y — which phase in roadmap
  • Plan A of B — which plan within current phase
  • Status — current state (ready to plan, planning, ready to execute, in progress, phase complete)
  • Last activity — what happened most recently
  • Progress bar — visual indicator of overall completion
Progress calculation:
Example bars:
  • [░░░░░░░░░░] 0% — Just started
  • [███░░░░░░░] 28% — Early progress
  • [██████████] 100% — Milestone complete

Performance Metrics

Purpose: Track velocity, detect degradation, estimate completion Contents:
  • Velocity: Total plans completed, average duration, total time
  • By Phase: Per-phase breakdown (enables “Phase 2 was slow, why?”)
  • Recent Trend: Last 5 plan durations, trend assessment (improving/stable/degrading)
Update mechanism: After each SUMMARY.md creation Uses:
  • Estimate remaining work: (remaining_plans × avg_duration)
  • Detect problems: “Last 3 plans took 20min each, avg is 6min — investigate”
  • Optimize: “Vertical slices (Phase 2) were faster than horizontal layers (Phase 1)”
Duration measured from plan start timestamp to SUMMARY.md creation. Includes execution + verification.

Accumulated Context

Decisions

Full log: PROJECT.md Key Decisions table STATE.md subset: 3-5 most recent decisions affecting current work Purpose: Quick reference without reading full PROJECT.md Example:
Decisions include:
  • Library choices
  • Architecture patterns
  • Security approaches
  • User preferences from /gsd:discuss-phase

Pending Todos

Full list: .planning/todos/pending/*.md STATE.md reference: Count + link Purpose: Remind what was captured during sessions Example:
When count high (10+):

Blockers/Concerns

Source: SUMMARY.md “Next Phase Readiness” sections, manual /gsd:add-blocker Purpose: Issues that affect future work Format:
Cleared when: Addressed in later phase or deemed non-issue

Session Continuity

Purpose: Enable instant resumption Contents:
  • Last session timestamp
  • What was last completed
  • Resume file path (if exists)
Resume file (.planning/.continue-here-*.md):
  • Created by /gsd:pause-work
  • Contains: Current plan, task in progress, blocker description, next steps
  • Read by /gsd:resume-work
Example:
Workflow:
  1. User runs /gsd:pause-work
  2. Creates resume file with full context
  3. Updates STATE.md session continuity
  4. User closes session
  5. Later: /gsd:resume-work
  6. Loads resume file, restores context
  7. Offers: “Continue 03-03 from Task 2” or “See progress”

Decision Tracking

Where Decisions Live

Decision Flow

Types of Decisions

Strategic (PROJECT.md only):
  • Tech stack choices (“Use Next.js, not Remix”)
  • Architecture patterns (“Monorepo with Turborepo”)
  • Product direction (“v1 is MVP, v2 adds payments”)
Implementation (CONTEXT.md → SUMMARY.md → PROJECT.md):
  • Library choices (“Use Zod for validation”)
  • Component structure (“Card layout, not table”)
  • API design (“REST, not GraphQL for v1”)
Tactical (SUMMARY.md only):
  • File organization (“Put utilities in lib/utils”)
  • Naming conventions (“Use kebab-case for files”)
  • Code patterns (“Use React Server Components”)

Session Continuity

Problem: Context Loss

Without STATE.md:
With STATE.md:

Resume Workflow

Command: /gsd:resume-work Process:
  1. Read STATE.md
  2. Extract current position, last activity
  3. Check for resume file (.planning/.continue-here-*.md)
  4. If resume file exists:
    • Read full context (plan, task, blocker)
    • Offer: “Continue [plan] from [task]” or “See status”
  5. If no resume file:
    • Present position from STATE.md
    • Suggest next action based on status
Example output:

Pause Workflow

Command: /gsd:pause-work When to use: Stopping mid-phase, mid-plan, or mid-task Process:
  1. Detect current state (which plan, which task)
  2. Ask user: “What’s blocking? Why stopping?”
  3. Create .planning/.continue-here-TIMESTAMP.md:
  4. Update STATE.md session continuity
  5. Commit (if commit_docs: true)

CLI Tool Integration

State queries:
State mutations:
CLI tool ensures STATE.md stays consistent. Manual edits can break workflows.

Best Practices

Keep STATE.md Small

Goal: Under 100 lines If growing too large:
  • Keep only 3-5 recent decisions (full log in PROJECT.md)
  • Keep only active blockers (remove resolved ones)
  • Link to full details instead of inlining
Example:

Update After Every Action

Don’t:
Do:
Why? If execution fails at 03-03, STATE.md shows 03-02 complete. Resume from correct position.

Use Resume Files for Mid-Work Pauses

STATE.md is for position. Resume files are for context. STATE.md: “Phase 3, Plan 2 complete” Resume file: “Mid-way through Task 2, blocked on library decision, here’s what I tried…”

Next Steps

Architecture

How STATE.md fits into overall system design

Wave Execution

How STATE.md tracks wave progress