The --resume (or -r) option allows you to resume a previous Qwen Code session, continuing where you left off with full conversation history intact. This is useful for long-running projects, multi-day tasks, or picking up interrupted work.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Select Session to Resume━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2h ago › Building REST API with authentication a1b2c3d4-e5f6... | 45 messages | 12.5K tokens 1d ago › Refactoring database layer f1e2d3c4-b5a6... | 23 messages | 8.2K tokens 3d ago › Adding unit tests c1d2e3f4-a5b6... | 31 messages | 15.1K tokensUse ↑↓ to navigate, Enter to select, Esc to cancel━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Day 1qwen --prompt "Start building the user management system"# Session ID: abc123# Day 2qwen --resume abc123 --prompt "Continue with the authentication"# Day 3 qwen --resume abc123 --prompt "Now add authorization"
# Working on a taskqwen> Implementing payment processing# Interrupted by meeting# Later, resumeqwen --continue> Continue implementing payment processing
# Build context over multiple sessionsqwen --session-id feature-auth> Setup authentication# Later, with full contextqwen --resume feature-auth> Add OAuth support# AI remembers previous authentication work
# Project Acd ~/projects/webappqwen# Work on webapp# Project Bcd ~/projects/apiqwen# Work on API# Return to Project A with contextcd ~/projects/webappqwen --continue# Resumes webapp session automatically
# Day 1: AI edits file.tsqwen --session-id task# Day 2: Someone else edits file.ts# Resume: AI doesn't know about external changesqwen --resume task> Continue editing file.ts# AI works from its last known state
#!/bin/bash# Migrate sessions to new machine# On old machinetar -czf qwen-sessions.tar.gz ~/.qwen/sessions/# Transfer to new machinescp qwen-sessions.tar.gz newmachine:# On new machinetar -xzf qwen-sessions.tar.gz -C ~/qwen --resume