A CLI context hub for agentic work. Granary supercharges your agentic workflows. It seamlessly integrates into your existing AI tools and teaches them how to share and manage context more efficiently.
- Session-centric: Explicit "what's in context" for each agent run
- LLM-first I/O: Every command has
--jsonand--format promptfor machine consumption - Local-first: All state stored locally (SQLite), no network dependency
- Concurrency-tolerant: Task claiming with leases for multi-agent safety
- Context packs: Generate summaries and handoffs optimized for LLM context windows
- Add the granary marketplace
claude plugin marketplace add speakeasy-api/granary- Install the granary plugin from the marketplace
claude plugin install granary@granary- Launch Claude and verify skills are available with
/skills- you should see something like:
granary-orchestrate · ~43 tokens
granary-initiative-planner · ~40 tokens
granary-plan-work · ~38 tokens
granary-setup · ~33 tokens
granary-execute-task · ~28 tokens- Prompt Claude to
set up granary for this project
Claude will install and initialize granary in your project.
Granary works best when used with the Claude Code skills. The skills teach Claude how to use Granary effectively.
Use similar prompts to see Granary in action.
use granary to plan a new audit service- Once the plan is complete, you can review it with
granary summary - Start implementation by telling Claude:
use granary to implement audit service
curl -sSfL https://raw.githubusercontent.com/speakeasy-api/granary/main/scripts/install.sh | shirm https://raw.githubusercontent.com/speakeasy-api/granary/main/scripts/install.ps1 | iexYou can install a specific version (including pre-releases) by setting the GRANARY_VERSION environment variable:
macOS / Linux:
GRANARY_VERSION=0.6.2 curl -sSfL https://raw.githubusercontent.com/speakeasy-api/granary/main/scripts/install.sh | shWindows (PowerShell):
$env:GRANARY_VERSION='0.6.2'; irm https://raw.githubusercontent.com/speakeasy-api/granary/main/scripts/install.ps1 | iexTo update to the latest stable version:
granary updateTo install a specific version (including pre-releases):
granary update --to=0.6.3-pre.1Requires Rust:
cargo install --git https://github.com/speakeasy-api/granary.git# Initialize a workspace
granary init
# Create a project
granary projects create "My Project" --description "Building something great"
# Start a session
granary session start "feature-work" --owner "Claude Code"
# Add tasks
granary project my-project-xxxx tasks create "Implement login" --priority P0
granary project my-project-xxxx tasks create "Add tests" --priority P1
# Get the next actionable task
granary next
# Start working on a task
granary start my-project-xxxx-task-1
# Mark it done
granary task my-project-xxxx-task-1 done
# Get a summary for your LLM
granary summary --format promptGranary is designed for the agentic loop pattern:
- Plan: Create projects and tasks, set dependencies
- Execute: Agents claim tasks, work on them, report progress
- Coordinate: Multiple agents can work safely in parallel with leases
- Handoff: Generate context packs for sub-agents or human review
- Workspace: A directory (typically a repo) containing
.granary/ - Project: Long-lived initiative with tasks and steering references
- Task: Unit of work with status, priority, dependencies, and claiming
- Session: Container for "what's in context" for a run
- Checkpoint: Snapshot of state for pause/resume or rollback
granary init # Initialize workspace
granary projects # List/create projects
granary tasks # List tasks in session scope
granary next # Get next actionable task
granary start <id> # Start working on a task
granary summary # Generate work summary
granary context # Export context pack for LLM
granary handoff # Generate handoff for sub-agent
granary checkpoint # Create/restore checkpoints
granary search # Search projects and tasks by title
granary workers # List all workers
granary worker start # Start a new event-driven worker
granary runs # List all runner executions
Use granary --help or granary <command> --help for detailed usage.
Every command supports multiple output formats:
granary tasks # Human-readable table
granary tasks --json # JSON for parsing
granary tasks --format yaml # YAML
granary tasks --format md # Markdown
granary tasks --format prompt # Optimized for LLM context
granary search "api" # Search in human-readable table
granary search "api" --json # JSON for parsingMonitor changes in real-time with --watch. The output refreshes automatically at a configurable interval:
# Watch tasks with default 2-second refresh
granary tasks --watch
# Watch workers with 5-second refresh
granary workers --watch --interval 5
# Watch runs filtered by status
granary runs --watch --status running
# Watch search results
granary search "api" --watchSupported commands: tasks, projects, workers, runs, sessions, initiatives, search, summary
Press Ctrl+C to exit watch mode.
Granary works seamlessly with Claude Code and other LLM coding assistants:
# Set session for sub-agents
eval $(granary session env)
# Generate context for prompts
granary context --format prompt --token-budget 2000
# Handoff to a review agent
granary handoff --to "Code Review Agent" --tasks task-1,task-2Workers are long-running processes that subscribe to granary events and automatically spawn commands. For example, automatically run Claude Code when tasks become unblocked:
# Configure a runner
granary config runners add claude \
--command "claude" \
--arg "--print" \
--arg "--message" \
--arg "Execute task {task.id}"
# Start a worker
granary worker start --runner claude --on task.unblockedSee docs/workers.md for complete documentation on workers, runners, filters, and template substitution.
MIT