/stack

Stack Mode Universal Production medium usage

/stack

Overview

/stack is a production command in the Stack Mode category of the Prismatic Platform. It displays the complete conversation stack showing all frames, their summaries, key decisions, assumptions, and checkpoint markers. The stack is the fundamental data structure for conversation state management on the Prismatic Platform, and this command provides the primary interface for inspecting that state. Every Claude interaction creates an immutable frame, and /stack reveals the full history of the current conversation branch.

This command operates under the Universal authority level and is executed by the stack-conversation-manager agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The Universal authority level means every operator, regardless of privilege level, can inspect the conversation stack. Transparency of conversation state is a foundational principle of the stack-based conversation mode.

Stack-based conversation mode is a P0 absolute enforcement requirement for all Claude interactions on the Prismatic Platform. The stack paradigm replaces traditional linear conversation history with a structured, branching, checkpointed model. Each frame captures the user input summary, assistant output summary, key assumptions, and key decisions. This structure enables precise state management: operators can pop frames to undo decisions, fork branches to explore alternatives, and checkpoint important milestones for later restoration. /stack is the window into this system.

Architecture

The stack display system reads from the StackConversation GenServer and formats the current stack state for human consumption.

Stack Architecture

             /stack
                |
        Stack Renderer
                |
          +-----+-----+
          |     |     |
       Frame  Branch  Checkpoint
       List   Info    Markers
          |     |     |
    +-----+-+ +-+-+ +-+-----+
    |   |   | | | | |   |   |
   ID  Sum  Dec Cur Act Name Mark
       mary ision rent ive  Map  Time
    |   |   | | | | |   |   |
    +---+---+-+-+-+-+---+---+
                |
        Formatted Output
                |
          +-----+-----+
          |     |     |
       Compact Detailed JSON
       View    View    Export

Stack Data Model

ElementTypeMutabilityDescription
FrameStructImmutableSingle conversation turn with metadata
Frame IDIntegerAssigned onceSequential identifier, never reused
User SummaryStringImmutable1-2 line summary of user input
Assistant SummaryStringImmutable1-3 line summary of assistant response
Key AssumptionsListImmutableAssumptions made during the response
Key DecisionsListImmutableDecisions made during the response
CheckpointNamed markerPersistentOptional named bookmark on a frame
BranchTree nodeAppend-onlyFork point creating conversation branch

Stack Operations Model

OperationCommandEffectReversibility
View/stackRead-only displayN/A (read-only)
Inspect/frame NShow frame detailsN/A (read-only)
Remove/pop NRemove last N framesDESTRUCTIVE -- frames lost
Branch/fork NCreate branch from frame NDESTRUCTIVE -- new branch
Bookmark/checkpoint nameMark current framePersistent
Restore/goto nameReturn to checkpointState change

Usage

# Display full conversation stack
/stack

# Display stack with detailed frame contents
/stack --verbose

# Display stack in compact format (frame IDs and summaries only)
/stack --compact

# Display stack with checkpoint markers highlighted
/stack --checkpoints

# Display stack with branch information
/stack --branches

# Export stack as JSON
/stack --format json

# Display last N frames only
/stack --last 5

# Display stack with decision trail
/stack --decisions

# Display stack with assumption chain
/stack --assumptions

Practical Examples

# Quick status check of conversation state
/stack --compact

# Full stack review before making a destructive operation
/stack --verbose --checkpoints

# Review decision chain for the current session
/stack --decisions --verbose

# Export stack for external review or documentation
/stack --format json > ./conversation-stack.json

# Check how deep the current conversation is
/stack --last 3 --verbose

# Display stack with branch tree for complex conversations
/stack --branches --verbose

Options

OptionTypeDefaultDescription
--verboseflagfalseShow full frame details (summaries, assumptions, decisions)
--compactflagfalseMinimal display: frame IDs and one-line summaries
--checkpointsflagfalseHighlight checkpoint markers in the stack
--branchesflagfalseShow branch information and fork points
--decisionsflagfalseShow decision trail across all frames
--assumptionsflagfalseShow assumption chain across all frames
--formatenumtextOutput format: text, json, markdown
--lastintegerallShow only the last N frames
--frominteger0Display frames starting from frame ID
--tointegercurrentDisplay frames up to frame ID

Execution Flow

Phase 1: State Retrieval

The command calls StackConversation.get_stack/0 on the GenServer to retrieve the current stack state. This is a read-only operation that does not modify any state. The GenServer returns the complete frame list, active branch identifier, and checkpoint map.

Phase 2: Branch Resolution

If the conversation has branches (created by /fork), the current active branch is resolved. Only frames on the active branch are included in the default display. With --branches, fork points and alternative branches are annotated.

Phase 3: Checkpoint Annotation

Frames that have associated checkpoints are annotated with their checkpoint names. With --checkpoints, these annotations are visually highlighted in the output.

Phase 4: Content Filtering

Based on display options (--compact, --verbose, --decisions, --assumptions), the appropriate content is extracted from each frame. Compact mode shows only frame IDs and user input summaries. Verbose mode shows all frame fields. Decision and assumption modes extract those specific fields into consolidated trails.

Phase 5: Rendering

The filtered content is rendered in the requested format. Text format uses structured indentation with visual separators between frames. JSON format produces a machine-readable array of frame objects. Markdown format generates a document suitable for external sharing.

Integration Points

ComponentIntegration TypeDescription
/frameDrill-downFrame inspection for detailed view of single frame
/popState modificationRemove frames from stack (DESTRUCTIVE)
/forkState modificationCreate conversation branch (DESTRUCTIVE)
/checkpointState annotationMark frames as named checkpoints
/gotoState restorationRestore to named checkpoint
/stack-utilsAdministrationAdvanced maintenance and debugging
StackConversation GenServerRuntimeOTP GenServer providing stack infrastructure
TelemetryMonitoringStack display operations tracked

Best Practices

Frequent Stack Inspection

Run /stack --compact regularly during complex sessions to maintain awareness of conversation state. Deep stacks without checkpoints risk context confusion, and frequent inspection helps identify when a checkpoint is overdue.

Pre-Destructive Operation Review

Always run /stack --verbose --checkpoints before any /pop or /fork operation. Understanding the full stack state prevents accidental loss of important frames. Export the stack with /stack --format json as a backup before destructive operations.

Decision Trail Review

Use /stack --decisions at session milestones to review the chain of decisions made. This provides a structured audit trail that is useful for documenting architectural choices, debugging unexpected outcomes, and communicating session progress to stakeholders.

Checkpoint Discipline

When /stack shows more than 10 frames without a checkpoint, create one immediately with /checkpoint. Long uncheckpointed sequences are fragile: any accidental /pop loses all intermediate work without a restoration point.

Error Handling

Error CodeDescriptionResolution
STACK_EMPTYNo frames in the current stackCreate first frame through interaction
GENSERVER_DOWNStackConversation GenServer not runningStart application; stack mode requires running GenServer
BRANCH_NOT_FOUNDRequested branch does not existCheck available branches with /stack --branches
FRAME_RANGE_INVALID--from/--to range contains no framesAdjust range to valid frame IDs
FORMAT_ERRORCannot serialize stack to requested formatCheck for non-serializable frame content

Advanced Usage

Stack Diffing

Compare current stack against a checkpoint to see what changed:

/stack --diff-from "checkpoint-name"

Search frame contents for specific keywords:

/stack --search "refactor" --verbose

Stack Metrics

Display quantitative metrics about the conversation:

/stack --metrics
# Output: Depth: 47 frames, Branches: 3, Checkpoints: 5, Decisions: 23, Duration: 2h 15m

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. Stack display is always accurate and complete; no frames are hidden or summarized without explicit request.
  • NO DOUBTS: Full investigation before action, evidence-based results. Stack state is read directly from the authoritative GenServer, never from stale caches or approximations.
  • /frame - Inspect specific conversation frame by ID
  • /pop - Remove last N frames from conversation stack (DESTRUCTIVE)
  • /fork - Branch conversation from specific frame (DESTRUCTIVE)
  • /checkpoint - Mark current frame as named checkpoint
  • /goto - Restore conversation to named checkpoint
  • /stack-utils - Advanced Stack Mode utility commands for maintenance and debugging
  • /ramon-mode - Ramon mode guardian for specialized help and assistance

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL