Update task status by ID or list of IDs without loading the full tasks.json
Updates task status for one or more tasks by ID without loading the full tasks.json file.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install docs-specialist@mwguerra-marketplace<status> <id1> [id2...] | Example: done 1.2.3 1.2.4You are implementing taskmanager:update-status.
This command provides a token-efficient way to update task status for one or more tasks by their IDs, without needing to load and parse the entire tasks.json file.
$1 (required): The new status to set$2... (required): One or more task IDs to updatedraft - Task is in draft stateplanned - Task is planned but not startedin-progress - Task is currently being worked onblocked - Task is blocked by dependencies or issuespaused - Task is temporarily pauseddone - Task is completedcanceled - Task has been canceledduplicate - Task is a duplicate of anotherneeds-review - Task needs review before proceeding# Check status and IDs are provided
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "Usage: taskmanager:update-status <status> <id1> [id2...]"
exit 1
fi
Use jq to efficiently update the status without loading the full file into context:
# Single task
jq --arg status "done" --arg id "1.2.3" '
def update_status:
if .id == $id then
.status = $status |
if $status == "done" or $status == "canceled" or $status == "duplicate" then
.completedAt = (now | todate)
else . end |
if $status == "in-progress" and .startedAt == null then
.startedAt = (now | todate)
else . end
else . end |
if .subtasks then .subtasks = [.subtasks[] | update_status] else . end;
.tasks = [.tasks[] | update_status]
' .taskmanager/tasks.json > .taskmanager/tasks.json.tmp && mv .taskmanager/tasks.json.tmp .taskmanager/tasks.json
# Multiple tasks
jq --arg status "done" --argjson ids '["1.2.3", "1.2.4", "1.2.5"]' '
def update_status:
if .id as $tid | $ids | index($tid) != null then
.status = $status |
if $status == "done" or $status == "canceled" or $status == "duplicate" then
.completedAt = (now | todate)
else . end |
if $status == "in-progress" and .startedAt == null then
.startedAt = (now | todate)
else . end
else . end |
if .subtasks then .subtasks = [.subtasks[] | update_status] else . end;
.tasks = [.tasks[] | update_status]
' .taskmanager/tasks.json > .taskmanager/tasks.json.tmp && mv .taskmanager/tasks.json.tmp .taskmanager/tasks.json
When updating status, the script automatically:
completedAt to current timestamp when status becomes terminal (done, canceled, duplicate)startedAt to current timestamp when status becomes in-progress (only if not already set)After updating, display confirmation:
Successfully updated 3 task(s) to status 'done':
- 1.2.3
- 1.2.4
- 1.2.5
Mark single task as done:
taskmanager:update-status done 1.2.3
Mark multiple tasks as done:
taskmanager:update-status done 1.2.3 1.2.4 1.2.5
Set tasks to in-progress:
taskmanager:update-status in-progress 2.1.1
Mark tasks as blocked:
taskmanager:update-status blocked 3.1 3.2
.taskmanager/tasks.json directly.taskmanager/tasks.json.bak)taskmanager:execute-task insteadjq to be installed