Back to library
AI
best practice

Parallelize Your Workflow with /fork Background Agents

Spawning background agents allows you to explore multiple code paths simultaneously.

Use the /fork and /branch commands to trigger background agents that work on parallel coding explorations without interrupting your main session.

Qwen

The Scenario

You are working on a primary feature but want to explore an alternative implementation or run a long-running diagnostic task without stopping your current flow.

Before & after

The old way

Developers usually open multiple terminal tabs or manually create temporary git branches to test different implementations, taking roughly 15–20 minutes to manage the context.

With AI

By running /fork, Qwen Code spawns background agents to explore different solutions or run separate tasks in parallel while you keep working. This takes about 1 minute to setup.

The Prompt

/fork [TASK_FOR_PARALLEL_AGENT_E.G._TRY_IMPLEMENTING_THIS_WITH_REDIS_INSTEAD_OF_MEMCACHED]

Qwen Code v0.18.0 introduced /fork background agents and /branch for parallel exploration. You can monitor these via a visual parallel agent panel which supports keyboard navigation for easy switching.

Source

Qwen Code Blog: AI Coding Updates and Guides | Qwen Code Docs
"parallel agents now have a visual panel with keyboard navigation, and /fork background agents."