Files
Claude-Code-Workflow/.claude/commands/workflow/session/list.md
catlog22 a667b7548c refactor(commands): replace bash/jq operations with ccw session commands
- session/start.md: Replace find/mkdir/echo with ccw session list/init
- session/list.md: Replace find/jq with ccw session list/stats/read
- session/resume.md: Replace jq status updates with ccw session status
- session/complete.md: Replace jq/mv with ccw session archive
- execute.md: Replace session discovery with ccw session list/status
- code-developer.md: Replace jq context-package read with ccw session read

Benefits:
- Atomic operations (no temp files)
- Auto workspace detection (works from subdirectories)
- Auto session location detection (active/archived/lite)
- Status history auto-tracking for tasks
- Consistent error handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 23:31:51 +08:00

3.0 KiB

name, description, examples
name description examples
list List all workflow sessions with status filtering, shows session metadata and progress information
/workflow:session:list

List Workflow Sessions (/workflow:session:list)

Overview

Display all workflow sessions with their current status, progress, and metadata.

Usage

/workflow:session:list       # Show all sessions with status

Implementation Flow

Step 1: List All Sessions

ccw session list --location both

Step 2: Get Session Statistics

ccw session stats WFS-session
# Returns: tasks count by status, summaries count, has_plan

Step 3: Read Session Metadata

ccw session read WFS-session --type session
# Returns: session_id, status, project, created_at, etc.

Simple Commands

Basic Operations

  • List all sessions: ccw session list
  • List active only: ccw session list --location active
  • Read session data: ccw session read WFS-xxx --type session
  • Get task stats: ccw session stats WFS-xxx

Simple Output Format

Session List Display

Workflow Sessions:

[ACTIVE] WFS-oauth-integration
   Project: OAuth2 authentication system
   Status: active
   Progress: 3/8 tasks completed
   Created: 2025-09-15T10:30:00Z

[PAUSED] WFS-user-profile
   Project: User profile management
   Status: paused
   Progress: 1/5 tasks completed
   Created: 2025-09-14T14:15:00Z

[COMPLETED] WFS-database-migration
   Project: Database schema migration
   Status: completed
   Progress: 4/4 tasks completed
   Created: 2025-09-13T09:00:00Z

Total: 3 sessions (1 active, 1 paused, 1 completed)

Status Indicators

  • [ACTIVE]: Active session
  • [PAUSED]: Paused session
  • [COMPLETED]: Completed session
  • [ERROR]: Error/corrupted session

Quick Commands

# Count all sessions
ls .workflow/active/WFS-* | wc -l

# Show recent sessions
ls -t .workflow/active/WFS-*/workflow-session.json | head -3

session_manager Tool Alternative

Use ccw tool exec session_manager for simplified session listing:

List All Sessions (Active + Archived)

ccw tool exec session_manager '{"operation":"list","location":"both","include_metadata":true}'

# Response:
# {
#   "success": true,
#   "result": {
#     "active": [{"session_id":"WFS-xxx","metadata":{...}}],
#     "archived": [{"session_id":"WFS-yyy","metadata":{...}}],
#     "total": 2
#   }
# }

List Active Sessions Only

ccw tool exec session_manager '{"operation":"list","location":"active","include_metadata":true}'

Read Specific Session

ccw tool exec session_manager '{"operation":"read","session_id":"WFS-xxx","content_type":"session"}'

Operation Reference

Old Pattern session_manager
ls .workflow/active/WFS-* {"operation":"list","location":"active"}
find ... -type d {"operation":"list"} returns session_id list
jq -r '.status' session.json {"operation":"read","content_type":"session"}
cat workflow-session.json {"operation":"read","content_type":"session"}