---
description: Check status of background operations
argument-hint: "[job-id]"
allowed-tools: ["mcp__bluera-knowledge__execute"]
---

# Check Background Job Status

Check the status of a background operation: **$ARGUMENTS**

## Steps

1. Parse $ARGUMENTS:
   - If a job ID is provided, use it for specific job status
   - If no arguments, show all active jobs

2. If job ID provided:
   - Use mcp__bluera-knowledge__execute tool with command "job:status":
     - args.jobId: The job ID from $ARGUMENTS
   - Display current status, progress, and details

3. If no job ID provided:
   - Use mcp__bluera-knowledge__execute tool with command "jobs":
     - args.activeOnly: true
   - Display a table of running/pending jobs

## Display Format

For a specific job:

```
Job Status: job_abc123def456
───────────────────────────────────────
Store:    react-query
Phase:    indexing (2/2)
Progress: █████░░░ 45% (562/1,247 files)
Started:  2 minutes ago
```

For all active jobs, format as a rich table with progress bars:

```
Active Background Jobs
────────────────────────────────────────────────────────────────────────────────────────────
| Job ID             | Store            | Phase           | Progress     | Files          |
|--------------------|------------------|-----------------|--------------|----------------|
| job_3abaf9639770   | claude-agent-sdk | indexing (2/2)  | ██████░░ 59% | 32/77 files    |
| job_4f0315fdcff9   | zustand          | cloning (1/2)   | █░░░░░░░ 15% | -              |
| job_1d1d93fd254f   | uvicorn          | indexing (1/1)  | ████░░░░ 44% | 20/100 files   |
| job_ac7584576f18   | tanstack-query   | crawling (1/2)  | ███░░░░░ 31% | 24 pages       |
| job_8113ea07cf53   | framer-motion    | indexing (2/2)  | ███░░░░░ 30% | 8/1378 files   |
| job_288c24b6724c   | monaco-editor    | indexing (1/1)  | ███░░░░░ 31% | 12/924 files   |

✓ tiktoken: Completed

6 jobs still running. The smaller repos (claude-agent-sdk, zustand, uvicorn) are progressing
faster. The larger ones (tanstack-query: 1741 files, framer-motion: 1378 files,
monaco-editor: 924 files) will take longer.
```

**Phase column:**
- Read from `job.details.phase`, `job.details.phaseStep`, `job.details.phaseTotalSteps`
- Format as: `{phase} ({step}/{total})` e.g., `indexing (2/2)`, `cloning (1/2)`
- Phases: `cloning`, `crawling`, `indexing`
- Clone jobs: cloning (1/2) → indexing (2/2)
- Index jobs: indexing (1/1)
- Crawl jobs: crawling (1/2) → indexing (2/2)

**Progress bar rendering (8 chars wide):**

Build the bar using these characters: `█` (filled) and `░` (empty)

```
Algorithm:
  filled = Math.round(progress / 100 * 8)
  bar = '█'.repeat(filled) + '░'.repeat(8 - filled) + ' ' + progress + '%'
```

Examples:
```
  0% → ░░░░░░░░ 0%
 15% → █░░░░░░░ 15%
 25% → ██░░░░░░ 25%
 31% → ███░░░░░ 31%
 44% → ████░░░░ 44%
 59% → █████░░░ 59%
 75% → ██████░░ 75%
 88% → ███████░ 88%
100% → ████████ 100%
```

**Files column:**
- For indexing: Show `{filesProcessed}/{totalFiles} files` from job.details
- For crawling: Show `{pagesCrawled} pages` from job.details
- For cloning (phase 1): Show `-` (no file count yet)

**Summary section:**
- After the table, add a brief summary noting:
  - How many jobs are still running
  - Which repos are progressing faster (smaller file counts)
  - Which repos will take longer (larger file counts)
- If any jobs recently completed, note them with ✓ prefix

If no active jobs:

```
No active background jobs.

Recent completed jobs:
────────────────────────────────────────────────────────────────────────────────────────────
| Job ID             | Store            | Phase           | Files          | Completed    |
|--------------------|------------------|-----------------|----------------|--------------|
| job_old123abc456   | react-query      | indexing (2/2)  | 245/245 files  | 5m ago       |
| job_xyz789ghi012   | zustand          | indexing (1/1)  | 67/67 files    | 12m ago      |

All jobs completed successfully.
```

## Error Handling

If job not found:

```
✗ Job not found: job_abc123def456

Common issues:
- Check the job ID is correct
- Job may have expired (stale pending jobs are marked failed after 2 hours)
- Use /bluera-knowledge:check-status to see all active jobs
```
