| name | gza-task-info |
| description | Gather comprehensive info about a specific gza task including status, branch, commits, and logs |
| allowed-tools | Read, Bash(uv run python -c:*), Bash(git:*) |
| version | 1.0.0 |
| public | true |
Gza Task Info
Gather comprehensive information about a specific gza task, including database details, git branch status, commits, and execution logs.
Process
Step 1: Get task ID
The user should provide a full prefixed task ID (for example, gza-1234). Extract it from the input.
Step 2: Query task from database
Run a Python one-liner to get all task details as JSON:
uv run python -c "from gza.db import get_task; import json; print(json.dumps(get_task(<ID>), indent=2, default=str))"
This will show:
- id, prompt, status, task_type, task_id (slug)
- branch, log_file, report_file
- has_commits, duration_seconds, num_turns_reported, num_turns_computed, cost_usd
- created_at, started_at, completed_at
- tags, depends_on, based_on, spec
- create_review, same_branch, task_type_hint
- output_content, session_id
Step 3: Check branch status (if task has a branch)
If the task has a branch field set, gather git information.
First, determine the base branch by running git rev-parse --abbrev-ref @{upstream} 2>/dev/null | sed 's|.*/||'. If that fails (no upstream set), fall back to main. Store this as BASE_BRANCH.
-
Check if branch exists:
git branch -a | grep <branch-name>
-
Show recent commits on the branch:
git log <branch-name> --oneline -10
-
Check if branch is merged to base branch:
git branch --merged $BASE_BRANCH | grep <branch-name> || echo "Not merged to $BASE_BRANCH"
-
Check for uncommitted changes (if on this branch):
git diff <branch-name> --stat
-
Show branch comparison with base branch:
git log $BASE_BRANCH..<branch-name> --oneline
Step 4: Show log file (if exists)
If the task has a log_file field:
-
Check if log file exists:
ls -lh <log_file>
-
Show the tail of the log (last 50-100 lines) to see how it ended:
tail -100 <log_file>
Or if you want to focus on the end:
tail -50 <log_file>
Step 5: Show report file (if exists)
If the task has a report_file field:
-
Read the entire report:
cat <report_file>
Or if it's very long, show the first part:
head -200 <report_file>
Step 6: Show output_content (if exists)
If the task has output_content in the database (stored directly), display it.
Step 7: Summarize the task state
Create a clear, concise summary of the task state. Examples:
Completed task with commits:
Task gza-i: completed
Type: implement
Branch: 20260115-add-authentication (3 commits, not yet merged)
Duration: 245.3s (4:05)
Cost: $0.42
Prompt: "Add JWT authentication to API endpoints"
Failed task:
Task gza-n: failed
Type: implement
Duration: 89.2s (1:29)
Cost: $0.15
Prompt: "Fix database migration script"
Log shows: verify_command failed — mypy found 3 type errors in src/gza/db.py
Pending task with dependency:
Task gza-v: pending
Type: implement
Depends on: Task gza-u (still in_progress)
Tags: metrics-v2
Prompt: "Implement CSV export for metrics data"
Completed task with report:
Task gza-f: completed (exploration)
Duration: 156.7s (2:37)
Cost: $0.28
Report: Found 3 authentication patterns in codebase (see below)
Important notes
- Database path: The Python API auto-discovers
.gza/gza.db relative to cwd (in project root)
- Handle missing fields: Not all fields will be populated (e.g., branch might be NULL for failed/pending tasks)
- Format durations: Show seconds and human-readable format (e.g., "245.3s (4:05)")
- Format costs: Show USD with 2 decimal places (e.g., "$0.42")
- Log context: The tail of the log is most important - it shows how the task ended (success, error, timeout, etc.)
- Branch status: If branch exists but isn't merged, mention it clearly
- Dependencies: If task has depends_on or based_on, show what it's related to
Tips
- For completed tasks, focus on outcomes (commits, reports, branch status)
- For failed tasks, focus on error details from the log tail
- For pending tasks, focus on dependencies and blocking status
- For in_progress tasks, show the log tail to see current status
- If a task has both report_file and output_content, prefer the file (it might be more recent)