Back to library
AI
tutorial

Automate Coding Cycles with /loop Autonomous Mode

Use the /loop command to automate repetitive multi-step coding and testing tasks.

Enable autonomous agentic workflows by using the /loop command in Qwen Code to let the AI iteratively write, test, and fix code without manual intervention.

Qwen

The Scenario

You have a complex feature to implement or a bug that requires multiple changes across several files and subsequent testing to verify the fix.

Before & after

The old way

Developers manually write a chunk of code, run a test, fix errors, and repeat this cycle until the feature works. This process typically takes 60–120 minutes of high-concentration effort.

With AI

Using Qwen Code's /loop mode, you can delegate the entire sequence of edits and tests to the agent, which handles the execution autonomously while you focus on other work. This reduces active effort to 5–10 minutes of initial guidance and periodic review.

The Prompt

/loop [DESCRIBE_THE_FEATURE_OR_BUG_FIX_YOU_WANT_TO_IMPLEMENT] --test "[COMMAND_TO_RUN_TESTS]"

The /loop autonomous mode introduced in v0.19.4 allows the AI to perform multi-step tasks without requiring user confirmation for every intermediate action, effectively acting as an autonomous junior engineer.

Source

Qwen Code Blog: AI Coding Updates and Guides | Qwen Code Docs
"introducing /loop autonomous mode, desktop voice dictation, tabbed settings view, and more."