An advanced workflow for using Claude Code has been shared, offering a glimpse into a powerful, parallelized development process. This article breaks down that workflow, providing a step-by-step guide to help you integrate these techniques into your own setup. We will explore how to manage multiple CLI sessions, integrate the web UI, and automate improvements over time.
Mastering Parallel Sessions in the Terminal
The foundation of this workflow is running multiple Claude CLI sessions in parallel. This allows you to work on different tasks simultaneously without losing context. The recommendation is to run five distinct sessions, each in its own numbered terminal tab, with system notifications enabled to alert you when a session requires input.
Setting Up Your Sessions
- Navigate to Your Project: Before initiating a session, always change to the directory you intend to work in. This is a crucial first step.
cd /path/to/your/project - Initiate Claude: Start a new session by simply running the
claudecommand.claude - Rename Your Tab: For clarity, rename each terminal tab with a number (e.g., “1”, “2”, “3”). This helps in keeping track of your parallel sessions.
Enabling Notifications
Claude Code automatically handles notifications by default, so you don’t have to watch every tab constantly. The AI will alert you when a session finishes or needs attention. You can inspect these settings using the config command.
config
In the configuration panel, you’ll find the notifications setting, which is set to auto. This allows Claude to choose the best notification method for your environment. While other options exist, like forcing a terminal bell, the default setting is typically sufficient for managing multiple sessions.
Conflict Management and Rollbacks
A common concern with parallel agents is managing conflicts and rolling back changes. The suggested approach is to run each Claude session in a separate Git checkout. This isolates the sessions, preventing them from interfering with one another.
If a session goes awry, you can simply cancel it by pressing Escape twice. This will safely roll back any changes made during that session. This built-in isolation and easy rollback mechanism is fundamental to running multiple agents concurrently.
Integrating the Web UI for Persistent Sessions
This workflow isn’t limited to the terminal. It extends to running multiple Claude sessions in the browser simultaneously. A typical setup involves running 5 to 10 sessions on claude.ai/code in parallel with the local CLI sessions.
The key concept here is that the CLI and web interface are not separate workflows but two different interfaces for interacting with the same underlying Claude Code sessions. You can hand off tasks from the terminal to the web, or even “teleport” back and forth between them.
Getting Started with Claude Code Web
- Navigate to
claude.ai/code. - You’ll see options for
Terminal,Extension(for VS Code or Cursor), andWeb. Click on Start Claude Web. - If it’s your first time, you’ll be prompted to create a cloud environment. You can stick with the default settings.
- Choose your network access level:
- None: Blocks all internet access for maximum security.
- Trusted: The recommended setting. It allows package downloads from verified sources.
- Full: Unrestricted internet access for maximum flexibility.
Once created, your workspace is ready. You can select your repository from the sidebar and begin working.
The web UI acts as a powerful session manager. While the terminal is for active, hands-on coding, the web UI is perfect for sessions you want to persist and check on later. This is why you might start a session from your phone and check its progress later in the day. The web interface provides persistence and visibility for long-running or background tasks, complementing the active development happening in the terminal.
The Handoff: Bridging Terminal and Web
For the terminal and web UI to communicate, four prerequisites must be met:
- You must be working inside a Git repository.
- The repository needs a configured GitHub remote.
- The Claude GitHub app must be installed on that repository. You can find this under your repository’s
Settings > Integrations > Applications. - You need the Claude Code web UI open to view and manage sessions.
If you’re new to this setup, you can ask Claude Code to configure it for you. It can initialize the Git repo, set up the remote, and prepare the web environment for handoffs.
Executing a Handoff
To hand off a task from the terminal to a background web session, use the & symbol at the end of your prompt.
For example, once you have a well-defined plan in your terminal, you can delegate the implementation to a web agent:
write a PRD for a task manager app &
This command initiates the task in the background. When you switch to the Claude Code web UI, you will see the new task, “Write product requirements document for task manager,” appear in your sessions list. You can click on it to monitor its progress.
Teleporting Back to the Terminal
The initial prompt response for a background task includes a command to resume the session later: claude -t <session_id>. If you lose this ID, you can easily find it in the URL of the session in the Claude Code web UI. Simply copy the ID and use the command to teleport the session back into your terminal for hands-on work.
This seamless loop—starting locally, handing off to the background, monitoring on the web, and teleporting back—allows for a highly efficient, multiplied throughput.
Creating a Shared Brain with claude.md
To ensure consistency across all parallel sessions, a claude.md file is used. This markdown file lives at the root of the repository and is automatically read by Claude at the start of any session. It serves as a set of persistent instructions, a shared memory for how Claude should behave within the codebase.
This file is used to capture project conventions, team expectations, and lessons learned—especially from past mistakes you don’t want the AI to repeat. Because every session reads this file, it ensures all agents, whether in the terminal or on the web, operate from the same baseline context.
If you’re working in an existing codebase, you can ask Claude to generate an initial draft for you:
review this repo and then create a claude.md file
Treat this as a starting point. Your team should contribute to this file regularly, refining it over time to create a robust guide for the AI.
Automating Improvements with GitHub Actions
The workflow can be further enhanced by using code reviews to improve Claude’s performance over time. This is achieved through the Claude Code GitHub action, which listens for @claude mentions in pull request comments.
Setting Up the GitHub Action
- Create the Workflow File: In your repository, create a new file at
.github/workflows/claude.yml. -
Add the Workflow Content: Paste the following YAML configuration into the file. This sets up an action that triggers when
@claudeis mentioned in a PR comment.name: Claude Code PR Helper on: issue_comment: types: [created] jobs: run_claude: if: $ runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: ref: $ - name: Run Claude uses: claude-ai/claude-code-action@v1 with: anthropic-api-key: $ prompt: $ - Commit the file.
- Add API Key: Go to your repository’s
Settings > Secrets and variables > Actions. UnderRepository secrets, add a new secret namedANTHROPIC_API_KEYwith your Anthropic API key.
Now, when you’re reviewing a pull request, you can leave a comment to instruct Claude to make changes. For example:
@claude update claude.md with a structure for how to write PRDs.
Claude will react with an emoji to acknowledge the task and then get to work, updating the claude.md file and committing the changes directly to the PR branch. This creates a powerful feedback loop where the AI learns and improves from your team’s direct input during code reviews.
The Power of ‘Plan Mode’
A crucial part of this workflow is to almost always start in plan mode. This gives Claude the space to think through a problem and devise a solid plan before writing any code. A good plan often leads to a successful implementation in a single shot.
Claude Code has three distinct modes:
- Standard Mode (Default): Claude proposes file changes and waits for your approval before writing anything. This is the safest option.
- Accept Edits On Mode: Claude creates or modifies files directly without confirmation. This is best used when you are confident in the plan.
- Plan Mode: The focus is solely on thinking through and iterating on a plan. No code is written.
You can cycle through these modes by pressing Shift + Tab. The recommended workflow is to start in plan mode to develop a robust strategy. Once the plan is solid, switch to Accept Edits On mode and let Claude handle the implementation.
This structured approach, combining parallel sessions, web UI management, a shared context file, and automated feedback, represents a sophisticated method for leveraging AI in modern development. While more advanced topics like custom slash commands and sub-agents exist, mastering this initial setup provides a significant boost in development efficiency and output.