Skip to content
This project is under active development and subject to breaking changes. See the changelog for release notes.

Context Management

Agents use a multi-layered approach to manage context across phases and sessions, preventing assumption contamination while maintaining traceability.

All persistent state lives in versioned files on disk. Board is the source of truth for task status and ownership. Disk artifacts are the source of truth for design decisions, specifications, and architecture.

ArtifactPathPhase
Strategic visiondocs/envisioning/README.mdEnvision
Feature specificationdocs/features/*/spec.mdSpecify
Technical plandocs/features/*/plan.mdPlan
Task decompositiondocs/features/*/tasks.mdDecompose
Architecture decisionsdocs/architecture/decisions/*.mdPlan
Migration specificationdocs/migrations/*/spec.mdSpecify
Migration tasksdocs/migrations/*/tasks.mdDecompose
Sprint recordsdocs/sprints/sprint-N.mdSprint

Built-in memory that stores stable facts discovered during work:

  • Code conventions: Detected patterns and project-specific rules
  • Verified commands: Build, test, and deployment commands that work
  • Synchronization patterns: Board and repository sync status
  • Project structure: Key directories, entry points, and configuration

Characteristics: automatic, validated via citations, shared between agents, expires in 28 days.

Used by: implement, plan, review, security agents.

Structured context passing between phases (ADR 0003):

Relevant Artifacts

Paths to files the next phase should read (spec.md, plan.md, ADRs, tasks.md).

Inherited Assumptions

Decisions and assumptions from the current phase that carry forward.

Pending Decisions

Open questions or decisions that the next phase needs to resolve.

Discarded Information

Context that was considered but explicitly excluded from the handoff.

flowchart LR
  subgraph envision["Envision"]
    E1["envisioning.md"]
  end
  subgraph specify["Specify"]
    S1["spec.md"]
  end
  subgraph plan["Plan"]
    P1["plan.md"]
    P2["ADRs"]
  end
  subgraph decompose["Decompose"]
    D1["tasks.md"]
    D2["Work Items"]
  end
  subgraph implement["Implement"]
    I1["Source Code"]
    I2["Pull Request"]
  end
  subgraph review["Review"]
    R1["Review Log"]
  end

  E1 -->|"handoff envelope"| S1
  S1 -->|"handoff envelope"| P1
  P1 -->|"handoff envelope"| D1
  P2 -->|"read from disk"| D1
  D1 -->|"handoff envelope"| I1
  D2 -->|"board state"| I1
  I1 --> I2
  I2 -->|"clean context"| R1

Each arrow represents a phase boundary where context is explicitly passed via a handoff envelope or read from disk artifacts. Agents never inherit the previous phase’s working memory.

  1. specify to plan: Spec locked, plan starts fresh reading spec from disk
  2. plan to decompose: ADRs locked, decompose reads decisions from files
  3. decompose to implement: Tasks locked, implement picks one task at a time
  4. implement to review: Code committed, review reads independently with clean context

The .memory/ directory stores session-scoped configuration (not committed to git):

FilePurposePopulated By
board-config.mdDetected work item platformdetect-repo-platform.sh hook
git-config.mdDetected branching strategydetect-branching-strategy.sh hook