| name | saga |
| description | Integration with Saga task management system for agents. Use when working with sagas to track work, check context, log progress, and coordinate with human planning. Triggers on saga-related tasks like reading context, creating sagas, updating status, logging work, searching sagas, and checking dependencies. |
Saga Agent Skill
Integration with Saga task management system.
What is Saga
Saga is a hierarchical task tracker with:
- Sagas - Tasks/projects with titles, descriptions, plans, status, priority
- Plans - Implementation details separate from description (what/why vs how)
- Sub-sagas - Parent/child relationships (parent.1, parent.2)
- Labels - Tags for filtering
- Dependencies - Hard blocking dependencies
- Relationships - Soft informational links
- Claims - Session-based ownership with expiry (identity = user@ppid)
- Config - Local and global configuration for defaults
Quick Reference
Commands
saga context <id>
saga context <id> --format json
saga list
saga list --global
saga list --status active|paused|done|wontdo
saga list --priority high|normal|low
saga list --mine
saga list --unclaimed
saga search "query"
saga status <id>
saga ready
saga ready --take
saga new "title"
saga new "title" --parent <id>
saga new "title" --label bug --priority high --desc "details"
saga new "title" --plan "1. Step one\n2. Step two"
saga new "title" --deadline 20250415
saga done <id> [<id> ...]
saga done <id> --cascade
saga done <id> --reason "why"
saga done <id> --quiet
saga done <id> --force
saga wontdo <id> [--id ...] --reason "why"
saga wontdo <id> --cascade
saga wontdo <id> --quiet
saga reopen <id>
saga reopen <id> --reason "why"
saga claim <id> [<id> ...]
saga claim <id> --duration 4h
saga unclaim <id> [<id> ...]
saga label <id> add|remove <label>
saga depend <id> add|remove <target>
saga relate <id> add|remove <target>
saga edit <id> --title "New title"
saga edit <id> --desc "New description"
saga edit <id> --plan "Implementation plan"
saga edit <id> --plan ""
saga edit <id> --deadline 20250415
saga edit <id> --deadline ""
saga edit <id> --priority high|normal|low
saga plan <id>
saga plan <id> "Implementation steps"
saga plan <id> --file plan.md
saga plan <id> --clear
saga log <id> "progress note"
saga log <id> --file notes.md
saga config
saga config --claim-duration 4h
saga config --scope global --claim-duration 4h
Agent Workflow
Before Starting Work
-
Check if saga exists for this task:
saga search "task name"
-
If saga exists, read context:
saga context <id> --format json
- Check status (if done, can
saga reopen; if wontdo, ask user)
- Check dependencies (wontdo = ⊘ non-blocking, incomplete = ✗ BLOCKING)
- Check parent/child relationships
- Check claim status (yours = [mine], other session = claimed by other)
- Read description for requirements
-
If no saga exists, ask user to create one or create it:
saga new "Implement feature X" --desc "Details from user"
Finding Ready Work
saga ready
saga ready --take
"Ready" means: not claimed by another session, not blocked by incomplete dependencies, no active children. Your own claims show as [mine].
During Work
Claim the saga first:
saga claim <id>
saga claim <id> --duration 4h
Log progress regularly:
saga log <id> "Started implementation"
saga log <id> "Decided on approach Y due to Z"
saga log <id> "Hit blocker: waiting for API"
Check if blocked:
saga context <id>
Create sub-sagas for large work:
saga new "Sub-task 1" --parent <parent-id>
saga new "Sub-task 2" --parent <parent-id>
Note: Cannot create sub-sagas under done or wontdo parents.
Before Marking Complete
-
Check all sub-sagas are done:
saga context <id>
-
Check all dependencies are done:
saga context <id>
-
Mark as done:
saga done <id>
Or mark multiple at once:
saga done abc123 def456
With cascade (completes all sub-sagas first):
saga done <id> --cascade
If blocked but user wants to force:
saga done <id> --force
Abandoning Work
For sagas that are abandoned, rejected, or obsoleted (not "completed"):
saga wontdo <id> --reason "Requirements changed"
saga wontdo <id> --cascade
saga wontdo <id> --quiet
Wontdo is a terminal state (like done) but semantically distinct. It is non-blocking in dependency checks (shown as ⊘ wontdo).
Reopening Completed Work
For sagas that were marked done but need more work:
saga reopen <id>
saga reopen <id> --reason "Bug found in implementation"
Only done sagas can be reopened (not wontdo). The reason is logged in history.
Claim System
Claims are session-based using user@ppid identity:
- Same ppid = same session = "mine"
- Different ppid = different session = "claimed by other"
- Claims have an expiry time (shown in listings)
- Default duration: configured value (see
saga config) or 24h fallback
Config resolution for claim duration:
--duration flag > local config (.saga/config.json) > global config (~/.saga/config.json) > 24h default
saga config
saga config --claim-duration 4h
saga config --scope global --claim-duration 4h
Common Patterns
Pattern: Dependency Chain
saga new "Task A"
saga new "Task B"
saga depend def456 add abc123
saga done abc123
saga done def456
Pattern: Dependency with Abandonment
saga new "Task A"
saga new "Task B"
saga depend def456 add abc123
saga wontdo abc123 --reason "No longer needed"
saga done def456
Pattern: Sub-task Decomposition
saga new "Build auth system"
saga new "OAuth integration" --parent abc123
saga new "Session management" --parent abc123
saga new "Password reset" --parent abc123
saga done abc123.1
saga done abc123.2
saga done abc123.3
saga done abc123
Pattern: Cascade Completion
saga done abc123 --cascade --reason "All work verified"
Pattern: Claim and Ready Queue
saga ready
saga ready --take
saga claim abc123 def456
saga claim abc123 --duration 2h
Pattern: Label-based Filtering
saga label abc123 add urgent
saga label def456 add urgent
saga search "" --label urgent
Plan Field: Description vs Plan
The Plan field stores how you'll implement a task, separate from Description which stores what and why. This separation keeps task context clean while giving agents a natural place to track implementation strategy.
Description: Problem statement, requirements, acceptance criteria, user-facing context
Plan: Implementation steps, technical approach, architecture decisions, execution order
When to set a plan
- On creation for well-scoped tasks where the approach is known:
saga new "Add password reset" --plan "1. Add reset token model\n2. POST /auth/reset endpoint\n3. Email integration\n4. Tests"
- After reading context for tasks where you need to explore first:
saga context abc123
saga plan abc123 "Use existing email service, add token table to auth schema"
- When approach changes — update the plan, don't edit the description:
saga plan abc123 "Switched to OTP approach after discovering email rate limits"
When NOT to set a plan
- Simple/trivial tasks where the approach is obvious (just
saga log progress)
- Tasks where you're still exploring and don't have a clear approach yet (log findings instead)
- When the description already fully captures the implementation (no duplication)
Plan vs log
saga plan — intended approach, persists across sessions, updated when strategy changes
saga log — actual progress and decisions, append-only timeline
Plans can be revised. Logs are history. Use both: set the plan, then log as you execute it.
Reading plans
Plans appear in saga status, saga context, and saga context --format json (as saga.plan). The dedicated saga plan <id> command is the quickest way to view just the plan.
Clearing plans
Once a task is done, plans are kept for reference (part of the saga record). If a plan becomes stale during active work, clear it with saga plan <id> --clear or set a new one.
Key Principles
- Context First - Always read
saga context before working
- Claim Your Work - Use
saga claim so other agents know you're on it
- Log Early and Often - Use
saga log for decisions and progress
- Dependencies Explicit - Add blocking dependencies so completion checks work
- Wontdo for Abandonment - Use
saga wontdo (not saga done) for rejected/obsoleted work
- Sub-sagas for Detail - Break large work into hierarchical sub-tasks
- Human Coordination - Saga is the bridge between human planning and agent execution
- Plan Separately from Description - Description = what & why; Plan = how. Use
saga plan for implementation details so they don't clutter the task description.
Error Handling
Saga Not Found
Error: saga "abc123" not found
To see all sagas:
saga list
Has Active Children
Error: cannot mark "abc123" as done: has active sub-sagas
Complete sub-sagas first, use --cascade, or:
saga done abc123 --force
Incomplete Dependencies
Error: cannot mark "abc123" as done: 1 incomplete dependencie(s): [def456]
Complete these first, use --force, or mark as wontdo:
saga done def456
saga wontdo def456 --reason "No longer needed"
Sub-saga Under Terminal Parent
Error: cannot create sub-saga under "abc123": parent is done
Parent must be active or paused to add sub-sagas.
Reference Files
references/saga-cli.md - Full CLI reference