Logo Vincent
Back to all posts

Claude Code /tasks Command Explained: Master Your Background Tasks

Claude
Claude Code /tasks Command Explained: Master Your Background Tasks

Why You Need /tasks

When developing with Claude Code, you’ll inevitably run into this scenario:

You ask Claude to run tests in the background, start a dev server, or dispatch a sub-agent for research — then you keep coding. A few minutes later, you’ve lost track of what’s running in the background.

Which task is still running? Which one has finished? Did that agent you kicked off five minutes ago produce any results?

That’s when you need /tasks.

What Is /tasks

/tasks is a built-in slash command in Claude Code for viewing the status of all background tasks and agents.

In interactive mode, type:

/tasks

It lists all background processes, including:

  • Task ID: A unique identifier for each background task
  • Status: Running, completed, or errored
  • Task type: Background shell command, sub-agent, or remote session

In short, /tasks answers one question: What’s going on in the background?

Background Task Basics

Before diving into how to use /tasks, let’s understand how background tasks work in Claude Code.

What Are Background Tasks

Background tasks are commands or agents that Claude Code executes asynchronously. When a task is sent to the background, Claude Code immediately returns a task ID, and you can continue your conversation with Claude without waiting.

How to Create Background Tasks

There are two ways to send tasks to the background:

Method 1: Tell Claude Directly

Use natural language to ask Claude to run something in the background:

Run the tests in the background

Claude will execute the test command in the background while you continue with other work.

Method 2: The Ctrl+B Shortcut

When Claude is executing a Bash command, press Ctrl+B to move the currently running command to the background. Note: press it while the command is running, not after it completes.

Key Characteristics

  • Output is preserved: Background task output is written to a file that Claude can read at any time
  • Automatic cleanup: Background tasks are cleaned up when Claude Code exits
  • Output limit: Tasks are automatically terminated if output exceeds 5GB
  • Completion notifications: Sub-agents automatically notify the main agent when done — no manual polling needed

Practical Use Cases

Case 1: Run Tests and Develop in Parallel

The most classic use case — have Claude run tests in the background while you keep coding:

Run npm run test -- --watch in the background, I want to keep working on code

Check the status anytime:

/tasks

When tests finish, Claude will automatically tell you the results. If tests fail, you’ll know right away.

Case 2: Multiple Agents Working in Parallel

Claude Code can dispatch multiple sub-agents to work simultaneously. For example, if you’re building a feature that spans frontend and backend:

Do two things at once: one agent to research frontend best practices, another to write the backend API

Here, /tasks becomes your “management dashboard” — check each agent’s progress at a glance.

Case 3: Long-Running Processes

Starting a dev server, running a database migration, or executing a time-consuming build — all of these can be sent to the background:

Start the dev server in the background

Then use /tasks to confirm it started successfully and check for errors.

Case 4: Recover “Lost” Tasks

With multiple background tasks, it’s easy to forget a task ID. /tasks acts like an inventory, capturing all background processes in one view:

/tasks

Once you find the task ID, you can ask Claude to retrieve its output.

Several Claude Code commands can be easily confused — let’s clarify:

CommandPurposeFocus
/tasksView status of all background tasks and agentsProcess management
/statsView usage patterns and statisticsUsage analytics
/usageView quota progress and remaining allowanceQuota management
/contextView current context window usageContext management
  • /tasks: What’s happening in the background? (process dimension)
  • /stats: What are my usage patterns? (analytics dimension)
  • /usage: How much quota do I have left? (quota dimension)
  • /context: How much context window space remains? (context dimension)

Practical Tips

Tip 1: Leverage Parallelism for Efficiency

When tasks are independent of each other, have Claude process them in parallel. For example, “run lint and tests simultaneously” is twice as fast as running them sequentially. Use /tasks to monitor both.

Tip 2: Ctrl+B Anytime to Background

A command is taking longer than expected? Don’t just sit there — press Ctrl+B to send it to the background and move on.

Tip 3: Start Long Processes in the Background

Dev servers, databases, watch-mode tests — these long-running processes should run in the background from the start. Don’t let them block your foreground.

Tip 4: Check Background Status Regularly

Build a habit: after working for a while, run /tasks to see if any background tasks have failed or completed and need attention. Don’t let results sit unnoticed in the background.

Final Thoughts

/tasks solves a simple problem: keeping you informed about your background tasks.

When developing with Claude Code, background tasks are your “clones.” You can dispatch several clones to work simultaneously, but if you don’t know what they’re doing or how far along they are, it’s no different from not having them at all.

Build the habit: check /tasks after dispatching background tasks, check /tasks during work breaks, check /tasks when you’ve lost a task ID. Three words: stay in control.

One command to manage all your background processes.

© 2026 vincentqiao.com . All rights reserved.