| name | backlog |
| description | Interact with the Backlog CLI — create and manage tasks, plans, comments, labels, projects, memory, docs, and attachments in a local SQLite workspace |
You have access to the backlog CLI. Use it to manage tasks, plans, comments, labels, projects, memory entries, docs, and attachments. Always pass --as ai:<your-model-name> so writes are attributed to you. Always pass --json when you need to parse output.
Session startup
When starting a work session on a backlog project, load context before anything else:
backlog project list --json --profile default
backlog memory list --project <alias> --json --profile default
backlog doc list --project <alias> --json --profile default
backlog doc show <doc-id> --json --profile default
backlog task list --project <alias> --status todo --json --profile default
backlog task list --project <alias> --status doing --json --profile default
Surface memory entries and doc bodies as context before responding — this prevents re-deriving decisions already recorded.
If memory entries are empty → suggest running /backlog-memory <alias> to load context and bootstrap summaries.
Core workflow
The standard agentic loop for working through a backlog:
1. Pick a task
backlog task list --project <alias> --status todo --json --profile default
Choose the highest-priority task that is actionable. Prefer P1 > P2 > P3.
2. Claim it
backlog task move TASK-N --status doing --as "ai:<model>" --profile default
3. Attach a plan (for non-trivial tasks)
backlog plan add --task TASK-N \
--title "Implementation plan" \
--content "## Steps\n1. ...\n2. ...\n\n## Testing\n- ..." \
--as "ai:<model>" --profile default
4. Do the work
Implement, fix, or research — whatever the task requires.
5. Record outcomes
backlog comment add "Fixed by changing X in file Y. Verified with Z." \
--task TASK-N --as "ai:<model>" --profile default
backlog memory add "Decided to use X because Y" \
--project <alias> --tag "decision" --as "ai:<model>" --profile default
6. Close it
backlog task move TASK-N --status done --as "ai:<model>" --profile default
7. Repeat or stop
Pick the next task or surface a summary of what was completed.
Task triage workflow
When asked to triage or bulk-create tasks from findings (scan output, review notes, etc.):
backlog import-findings findings.json --dry-run --profile default
backlog import-findings findings.json --as "ai:<model>" --profile default
backlog task list --project <alias> --status todo --json --profile default
Findings file format:
{
"version": 1,
"project": "<alias>",
"items": [
{ "title": "...", "type": "bug", "priority": "P2", "source": "review" }
]
}
Memory workflow
/backlog-memory <alias> — one skill that both learns (reads tasks, plans, docs, and memory into context) and stores (persists synthesized summaries). It auto-picks: learn at the start of a session, store after work has been done, and asks if it's ambiguous.
- Force a mode with
/backlog-memory learn <alias> or /backlog-memory store <alias>.
- Run store after significant work to refresh the
open-work and done-work entries.
Conventions
- Always
--profile default unless the user specifies otherwise.
- Always
--as ai:<your-model-name> on writes.
- Always
--json when parsing output.
- Use
TASK-N format in messages to the user.
- Never hardcode actor names — use
ai:<your-model-name> dynamically.
Core concepts
| Concept | Description |
|---|
| Workspace | Directory containing backlog.db + config.toml. Resolved via --db, $BACKLOG_DB, --profile, or the default profile. There is no cwd walk-up. |
| Profile | Named pointer to a workspace, registered in ~/.config/backlog/config.toml. By default workspaces live at ~/.config/backlog/<profile-name>/. |
| Project | Named group of tasks inside a workspace, identified by a short alias (e.g. api, web). |
| Task | Unit of work. Has type, status, priority, actor. Identified by TASK-N, bare N, or full ULID. |
| Plan | Versioned markdown document attached to a task. Every edit creates a new immutable version. |
| Doc | Versioned markdown document attached to a project (not a task). Same versioning model as plans. |
| Memory | Free-form note attached to a project. Body + comma-separated tags. Newest-first list, tag filter. |
| Attachment | Binary file attached to a task or a doc, stored in the SQLite DB. |
| Comment | Actor-attributed note on a task. |
| Label | Per-project tag attachable to tasks. |
| Actor | kind:name — kind is human or ai. Example: ai:claude-code. |
ID formats — all equivalent for tasks
TASK-5 # canonical human-readable ref
5 # bare integer
01KR4JA4754H... # full ULID (returned in JSON)
Use the TASK-N format in messages to users. Use the ULID from JSON output when chaining commands. Plan IDs, doc IDs, attachment IDs, and memory IDs are always full or short ULIDs — there is no PLAN-N form.
Global flags (apply to every command)
--json output machine-readable JSON (always use when parsing)
--as kind:name actor attribution, e.g. --as ai:claude-code
--db <path> explicit path to backlog.db
--profile <n> named workspace profile
--quiet suppress success messages
Environment
BACKLOG_DB=/path/to/backlog.db # overrides profile resolution; use in MCP config
DB resolution order
--db <path> flag
$BACKLOG_DB env var
--profile <name> flag → ~/.config/backlog/<name>/backlog.db
- Default profile from
~/.config/backlog/config.toml
- Error: "no backlog workspace found — run
backlog init to create one"
Init (workspace setup)
backlog init creates a workspace and registers it as a profile. By default it lives at ~/.config/backlog/<profile>/; use --path to put it inside a project directory or a separate git repo.
backlog init
backlog init --profile work
backlog init --profile myapp --path ~/code/myapp/.backlog
backlog init --profile work --set-default
backlog init --profile work --reset
backlog init --profile work --actor human:mazin --priority 2 --type bug --status doing
Flags:
--profile <name> — profile name (default: default)
--path <dir> — workspace directory (default: ~/.config/backlog/<profile>/)
--set-default — make this the active profile
--reset — wipe and reinitialize an existing workspace
--actor, --priority, --status, --type — defaults written into workspace config.toml
If no default profile exists yet, the new workspace becomes the default automatically.
Profiles
backlog profile add work --path ~/projects/work-backlog
backlog profile list
backlog profile show work
backlog profile current
backlog profile use personal
backlog profile set-default personal
backlog profile remove old
backlog task list --profile work --json
Projects
backlog project add "API Service" --alias api
backlog project add "Web Frontend" --alias web --repo-path /code/web
backlog project list --json
backlog project list --include-archived --json
backlog project show api --json
backlog project update api --name "API v2" --description "REST backend"
backlog project archive api
backlog project delete api
JSON shape of a project:
{ "id": "...", "alias": "api", "name": "API Service", "description": "", "repo_path": "", "created_at": 0, "updated_at": 0 }
Tasks
Create
backlog task add \
--project api \
--title "Fix SQL injection in /search" \
--description "Parameterize the query at internal/handlers/search.go:84" \
--type vulnerability \
--priority P1 \
--source "semgrep" \
--external-ref "SEMGREP-042" \
--label security \
--as ai:claude-code
Flags:
-p / --project alias (required)
-t / --title (required)
-d / --description markdown body
--type task · bug · issue · improvement · feature · vulnerability · chore · spike
--priority P1–P5 or 1–5 (P1 = highest, P3 = default)
--status todo · doing · done (default: todo)
--assignee name
--label repeatable: --label auth --label crypto
--source origin tool/review name
--external-ref URL or ticket ID
--from-file <file> — .json is parsed as a full task payload, anything else is loaded as the description
--due-date YYYY-MM-DD or RFC3339
List
backlog task list --json
backlog task list --project api --json
backlog task list --status todo --json
backlog task list --type vulnerability --priority P1 --json
backlog task list --label security --json
backlog task list --actor-kind ai --json
backlog task list --actor-name claude-code --json
backlog task list --source semgrep --json
backlog task list --search "injection" --json
backlog task list --search "sql*" --json
backlog task list --include-archived --json
backlog task list --limit 20 --offset 0 --json
backlog task list --sort seq --json
backlog task list --sort created --json
backlog task list --sort updated --json
backlog task list --sort title --json
JSON response shape (CLI):
{
"tasks": [
{
"id": "01KR...",
"seq": 1,
"project_id": "...",
"project": { "alias": "api", "name": "API Service" },
"title": "Fix SQL injection",
"type": "vulnerability",
"status": "todo",
"priority": 1,
"actor": { "kind": "ai", "name": "claude-code" },
"source": "semgrep",
"external_ref": "SEMGREP-042",
"labels": [{ "name": "security", "color": "" }],
"created_at": 1746724800000000000,
"updated_at": 1746724800000000000
}
],
"page": { "total": 12, "count": 12 }
}
Show
backlog task show TASK-1 --json
backlog task show TASK-1 --with-plans=false --with-comments=false --json
--with-plans and --with-comments are both true by default.
Update
Only provided flags are changed:
backlog task update TASK-1 --title "New title" --priority P2 --as ai:claude-code
backlog task update TASK-1 --assignee alice --source pentest-report
backlog task update TASK-1 --due-date 2026-06-01
Move status
backlog task move TASK-1 --status doing --as ai:claude-code
backlog task move TASK-1 --status done --as ai:claude-code
backlog task move TASK-1 --status todo --as ai:claude-code
Archive / Delete
backlog task archive TASK-1
backlog task delete TASK-1
Plans
Plans are versioned. Every plan update creates a new immutable version. The current version is always returned by default.
Add plan (creates v1)
backlog plan add \
--task TASK-1 \
--title "Remediation plan" \
--content "## Steps\n1. Replace string interpolation with parameterized queries\n2. Add regression test" \
--as ai:claude-code --json
To load body from a file:
backlog plan add --task TASK-1 --title "Plan" --from-file plan.md --as ai:claude-code
JSON response:
{
"id": "01KR...",
"task_id": "...",
"current_version": 1,
"version": {
"id": "...", "version": 1,
"title": "Remediation plan", "body": "## Steps\n...",
"actor": { "kind": "ai", "name": "claude-code" },
"created_at": 0
}
}
Update plan (creates v2, v3, …)
backlog plan update <plan-id> \
--title "Revised plan" \
--content "## Steps\n1. Parameterize queries\n2. Rotate credentials\n3. Add regression test" \
--change-note "added credential rotation" \
--as human:alice --json
--title is required on update; --from-file works the same as on add.
Show, history, list, delete
backlog plan show <plan-id> --json
backlog plan show <plan-id> --version 1 --json
backlog plan history <plan-id> --json
backlog plan list --task TASK-1 --json
backlog plan delete <plan-id>
Comments
backlog comment add "Verified fix in PR #142." --task TASK-1 --as ai:claude-code
backlog comment list --task TASK-1 --json
backlog comment delete <comment-id>
The body is a positional argument; --task is a required flag.
Labels
backlog label create "security" --project api --color "#ff0000"
backlog label list --project api
backlog label attach security --task TASK-1
backlog label detach security --task TASK-1
Memory (project-scoped notes)
Free-form text + optional comma-separated tags. Use this for decisions, context, design notes that aren't a task.
backlog memory add "Decided to use SQLite — single file, no server" \
--project api --tag "decision,arch" --as ai:claude-code
backlog memory append <memory-id> "Confirmed at 2026-05-09 review meeting"
backlog memory list --project api --json
backlog memory list --project api --tag arch --json
backlog memory delete <memory-id>
JSON entry shape:
{
"id": "01KR...",
"project_id": "...",
"body": "Decided to use SQLite — single file, no server",
"tags": "decision,arch",
"actor": { "kind": "ai", "name": "claude-code" },
"created_at": 1746724800000000000
}
Docs (project-scoped versioned documents)
Like plans, but attached to a project and used for longer-form documentation (architecture overviews, runbooks, design docs).
backlog doc add --project api --title "Architecture Overview" \
--content "## Stack\n- Go 1.25\n- SQLite" --as ai:claude-code --json
backlog doc add --project api --title "Runbook" --from-file runbook.md
backlog doc list --project api --json
backlog doc show <doc-id> --json
backlog doc update <doc-id> --title "Architecture v2" \
--content "..." --change-note "added queue layer" --as ai:claude-code
backlog doc append <doc-id> --content "## New section\n..." \
--change-note "extended troubleshooting"
backlog doc history <doc-id> --json
backlog doc delete <doc-id>
--from-file is supported on both add, update, and append.
Attachments
Binary files attached to a task or a doc, stored inside the SQLite DB. The attachment command also has the alias attach.
backlog attachment add ./report.pdf --task TASK-1 --as ai:claude-code
backlog attachment add ./diagram.png --doc <doc-id>
backlog attachment list --task TASK-1 --json
backlog attachment list --doc <doc-id>
backlog attachment fetch <attachment-id>
backlog attachment fetch <attachment-id> --out /tmp/report.pdf
backlog attachment fetch <attachment-id> --out -
backlog attachment delete <attachment-id>
Import findings (bulk task creation)
Write a findings JSON file, then import it. This is the primary agentic intake path.
File format
{
"version": 1,
"project": "api",
"items": [
{
"title": "SQL injection in /search",
"type": "vulnerability",
"priority": "P1",
"source": "semgrep",
"external_ref": "SEMGREP-001",
"plans": [
{ "title": "Remediation", "body": "Use parameterized queries." }
]
},
{
"title": "Outdated dependency: lodash 4.17.20",
"type": "vulnerability",
"priority": "P3",
"source": "dependency-scan"
}
]
}
priority accepts "P1"–"P5" or integers 1–5.
Run
backlog import-findings findings.json --dry-run
backlog import-findings findings.json --as ai:scanner
backlog import-findings findings.json --project web --as ai:scanner
Cross-workspace import
backlog import /path/to/other/backlog.db --dry-run
backlog import /path/to/other/backlog.db --as ai:importer
backlog import /path/to/other/backlog.db --project api
Export
backlog export --format json
backlog export --format csv
backlog export --format md
backlog export --format json --project api --out tasks.json
Sync (manifest → DB)
backlog sync
Activity log
backlog activity
backlog activity --limit 20
backlog activity --json
Web UI
backlog web
backlog web --port 3000
backlog web --no-browser
The web UI provides task list/detail, doc browser, memory browser, and project list. It reads/writes the same workspace as the CLI.
Schema (JSON Schema for payloads)
backlog schema --json
Useful when an agent needs a machine-readable contract for --from-file payloads.
Shell completion
backlog completion bash > /etc/bash_completion.d/backlog
backlog completion zsh > ~/.zsh/completions/_backlog
backlog completion fish > ~/.config/fish/completions/backlog.fish
backlog completion powershell
Doctor / maintenance
backlog doctor check
backlog doctor backup --to /safe/backlog.backup.db
If --to is omitted, backup is written to <workspace>/backlog.backup.db.
MCP server
When running as an MCP server, the same operations are available as tools. Start the server:
backlog mcp serve --as ai:claude-code --db /path/to/backlog.db
Available MCP tools
| Tool | Required | Optional |
|---|
project_list | — | — |
task_create | project, title | description, type, status, priority, source, external_ref, due_date |
task_list | — | project, status, type, priority, search |
task_show | id | — |
task_update | id | title, description, status, priority, due_date |
task_move | id, status | — |
plan_add | task_id, title, body | source |
plan_update | plan_id, title, body | change_note |
plan_history | plan_id | — |
comment_add | task_id, body | — |
memory_add | project, body | tags |
memory_list | project | tag |
doc_add | project, title, body | — |
doc_list | project | — |
doc_show | id | — |
doc_update | id, body | title, change_note |
Note: id / task_id accept any of the three task ref forms (TASK-N, bare integer, ULID). plan_id and doc id are full ULIDs returned by the matching list/create response.
Common agent workflows
Triage findings from a scan
backlog import-findings findings.json --dry-run
backlog import-findings findings.json --as ai:scanner
backlog task list --actor-name scanner --json
Pick up a task and attach a plan
backlog task move TASK-5 --status doing --as ai:claude-code
backlog plan add --task TASK-5 --title "Implementation plan" \
--content "..." --as ai:claude-code --json
Revise a plan after human feedback
backlog plan update <plan-id> \
--title "Revised plan" \
--content "..." \
--change-note "incorporated Alice's review" \
--as ai:claude-code --json
Capture a design decision as memory
backlog memory add "Chose Cobra over urfave/cli — better completion + posix flag handling" \
--project api --tag "decision,deps" --as ai:claude-code
Maintain a versioned runbook
backlog doc add --project api --title "Incident Runbook" \
--from-file runbook.md --as ai:claude-code
backlog doc append <doc-id> --content "## 2026-05 outage RCA\n..." \
--change-note "post-mortem section" --as ai:claude-code
backlog doc history <doc-id> --json
Scripting with JSON output
backlog task list --type vulnerability --priority P1 --status todo --json \
| jq -r '.tasks[].id'
TASK_ID=$(backlog task add -p api -t "Fix XSS" --type vulnerability --priority P2 \
--as ai:claude-code --json | jq -r '.id')
backlog plan add --task "$TASK_ID" --title "Plan" --content "..." --as ai:claude-code
Enum reference
type: task · bug · issue · improvement · feature · vulnerability · chore · spike
status: todo · doing · done
priority: 1/P1 (critical) · 2/P2 (high) · 3/P3 (normal, default) · 4/P4 (low) · 5/P5 (backlog)
actor.kind: human · ai
sort (task list): priority (default) · created · updated · seq · title