Shape CLI is designed for AI agents. This guide covers setup for Claude Code, Cursor, Windsurf, and MCP server integration.
The fastest way to configure AI integration:
shape agent-setupThis auto-detects existing AI config files and appends Shape instructions to:
CLAUDE.md(Claude Code).cursorrules(Cursor).windsurfrules(Windsurf)AGENTS.md(generic)
shape agent-setup --show # Preview without writing
shape agent-setup --claude # Only CLAUDE.md
shape agent-setup --cursor # Only .cursorrules
shape agent-setup --windsurf # Only .windsurfrulesshape agent-setup --claudeAdd to CLAUDE.md:
## Task Management
This project uses Shape CLI for task management.
### Before starting work
1. Run `shape ready` to see available tasks
2. Run `shape claim <task-id>` to claim a task
3. Run `shape task start <task-id>` to mark it in progress
### While working
- Add notes: `shape note <task-id> "Found edge case..."`
- Link commits: `shape link <task-id> --commit <hash>`
- Check context: `shape context --compact`
### When done
1. Run `shape task done <task-id>` to complete
2. Run `shape ready` to see what's next
### If blocked
- Run `shape block <task-id> "reason"` to mark blocked
- Run `shape handoff <task-id> "reason"` to hand offshape agent-setup --cursorAdd to .cursorrules:
# Task Management
Use Shape CLI for task tracking:
- `shape ready` - see available tasks
- `shape context --compact` - get project state
- `shape task start <id>` - begin work
- `shape task done <id>` - complete work
- `shape next` - get suggested task
Always check `shape ready` before starting new work.
Mark tasks complete with `shape task done` when finished.
shape agent-setup --windsurfAdd to .windsurfrules:
# Task Management
This project uses Shape CLI. Key commands:
- shape ready: Show tasks ready to work on
- shape next: Suggest best next task
- shape task start <id>: Mark task in progress
- shape task done <id>: Mark task complete
- shape context --compact: Export state for AI
Workflow:
1. Check shape ready for available work
2. Claim task with shape claim <id>
3. Work on task
4. Complete with shape task done <id>
Shape includes a Model Context Protocol (MCP) server for native AI integration.
Add to your MCP client configuration:
{
"mcpServers": {
"shape": {
"command": "shape",
"args": ["mcp-server"]
}
}
}The MCP server exposes these tools:
| Tool | Description |
|---|---|
shape_ready |
List unblocked tasks |
shape_next |
Suggest next task |
shape_task_start |
Mark task in progress |
shape_task_done |
Mark task complete |
shape_context |
Get project context |
shape_claim |
Claim a task |
shape_note |
Add note to task |
shape_link |
Link artifact to task |
From an MCP-enabled AI:
Use shape_ready to see what tasks are available.
Use shape_task_done with task_id "b-7f2a3b1.1" to complete the task.
The shape context command exports project state optimized for AI consumption.
shape contextIncludes:
- All briefs with full content
- All tasks with dependencies
- Recent history and notes
shape context --compactMinimized for token efficiency:
- Brief titles and statuses only
- Task titles, statuses, and blocking relationships
- No historical data
Target: < 2000 tokens for typical projects.
# Single brief
shape context --brief b-7f2a3b1
# Include older completed tasks
shape context --days 14
# Combine options
shape context --compact --brief b-7f2a3b1All commands support --format json for machine parsing:
shape ready --format json
shape task list --format json
shape brief show b-7f2a3b1 --format jsonRecommended workflow for AI agents:
# 1. Check what's ready
shape ready
# 2. Claim and start a task
shape claim b-7f2a3b1.1
shape task start b-7f2a3b1.1
# 3. Work on the task...
# 4. Add notes as you go
shape note b-7f2a3b1.1 "Implemented OAuth flow"
# 5. Link artifacts
shape link b-7f2a3b1.1 --commit abc1234
# 6. Complete the task
shape task done b-7f2a3b1.1
# 7. Check what's next
shape readyWhen multiple agents work on the same project:
# Claim with agent name
shape claim b-7f2a3b1.1 --agent claude
# Hand off to another agent
shape handoff b-7f2a3b1.1 "Need frontend expertise" --to cursor
# Force claim if stuck
shape claim b-7f2a3b1.1 --force --reason "Previous agent timed out"See Multi-Agent for details.
For long-running projects, compact old tasks to save context window:
# Compress tasks older than 7 days
shape compact
# Preview first
shape compact --dry-run
# Custom threshold
shape compact --days 30See shape compact --help for options.