Skip to main content
reopt Handbook
reopt Handbook
Claude Code Command MasterLabels and command selectionHow to read a detail guideComplete command listTerminal CLI Commands and Flags

Task guides

Core command basicsStarting and resuming workSkills and Custom CommandsAutomation and Web CommandsOperations and Safety CommandsCustom commands and skillsMCP connections and commands

Conversation and context

Cmd. /add-dirCmd. /backgroundCmd. /compactCmd. /contextCmd. /copyCmd. /exportCmd. /forkCmd. /importCmd. /initCmd. /memoryCmd. /recapCmd. /renameCmd. /resumeCmd. /rewindCmd. claude project purge

Planning and execution

Cmd. /autofix-prCmd. /batchCmd. /desktopCmd. /goalCmd. /loopCmd. /planCmd. /remote-envCmd. /scheduleCmd. /tasksCmd. /teleportCmd. /workflows

Review and verification

Cmd. /code-reviewCmd. /runCmd. /run-skill-generatorCmd. /security-reviewCmd. /simplifyCmd. /verify

Models and settings

Cmd. /claude-apiCmd. /configCmd. /effortCmd. /fastCmd. /modelCmd. /output-styleCmd. /update-config

Permissions and integrations

Cmd. /agentsCmd. /hooksCmd. /ideCmd. /mcpCmd. /permissionsCmd. /pluginCmd. /reload-pluginsCmd. /reload-skillsCmd. /sandboxCmd. /skillsCmd. /web-setup

Status and diagnostics

Cmd. /debugCmd. /diffCmd. /doctorCmd. /fewer-permission-promptsCmd. /release-notesCmd. /team-onboarding

Display and input

Cmd. /colorCmd. /focusCmd. /keybindingsCmd. /powerupCmd. /statuslineCmd. /terminal-setupCmd. /themeCmd. /tui

Account and usage

Cmd. /upgradeCmd. /usageCmd. /usage-credits

Legacy

Cmd. /costCmd. /pr-commentsCmd. /reviewCmd. /statsCmd. /ultrareviewCmd. /vimCmd. /approved-toolsCmd. /commandsCmd. /extra-usageCmd. /settingsCmd. /tagCmd. /todos

Verification and history

Current verification scopeHandbook updatesRelease coverage historyEarlier verification recordsCommand change history
Handbook›Claude Code Command Master›Automation and Web Commands
한국어English

Automation and Web Commands

Choose the right Claude Code surface for web sessions, PR autofix, schedules, background Agent View work, Desktop handoff, and remote control.

Key takeaways

  • Choose the right Claude Code surface for web sessions, PR autofix, schedules, background Agent View work, Desktop handoff, and remote control.
  • Use this chapter as a first-pass operating checklist before changing systems, data, permissions, or customer-facing workflows.
  • Validate platform-specific details against current official docs or internal policy before rollout.
  • v2.1.251 formalizes top-level attach, logs, stop, respawn, and rm commands and streams foreground subagents in Remote Control.

Choose the Right Surface

CommandBest forRequirements
/autofix-pr [prompt]Spawning a Claude Code on the web session that watches the current branch's PR and pushes fixes when CI fails or reviewers comment.Open PR detected from the checked-out branch, gh CLI, Claude Code on the web access.
/schedule [description]Creating, updating, listing, or running routines that run on Anthropic-managed cloud infrastructure on a schedule, API trigger, or GitHub event. Alias: /routines.Claude Code on the web access; GitHub connected (it prompts for /web-setup if not).
/web-setupConnecting your GitHub account to Claude Code on the web using local gh credentials.Local gh authentication and repository access; v2.1.248+ warns when the token lacks the workflow scope.
/remote-control or /rcMaking this local session available for remote control from claude.ai.Claude.ai login, trusted local workspace.
/background or /bgDetaching the current local conversation to run as a background agent and free the terminal.Agent View available (research preview, v2.1.139+); worktree isolation understood.
claude --bgStarting a background session directly from the shell.Local Claude Code session with the right directory and permissions.
claude --bg --execRunning a shell command as an Agent View background job without invoking a model.Command is safe to run in the target directory.
/goalKeeping Claude working across turns until a concrete completion condition is met.Success condition must be observable.
/workflowsWatching, pausing, resuming, or saving running and completed dynamic workflow runs.A running or completed workflow.
/teleport or /tpPulling a Claude Code on the web session back into the terminal.Claude.ai subscription and web session access.
/desktop or /appContinuing the session in the Claude Code Desktop app.macOS or Windows and a Claude subscription.
/mobileShowing a QR code to download the Claude mobile app. Aliases: /ios, /android.Claude.ai account.

PR Automation Pattern

/autofix-pr detects the open PR from your checked-out branch with gh pr view. To watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it narrower instructions.

  1. Ensure the branch has an open PR.
  2. Run /web-setup if the web GitHub connection is not already configured.
  3. Start with a bounded prompt:
/autofix-pr only fix lint, typecheck, and reviewer comments that do not change architecture
  1. Review the resulting commits and CI status before merging.

/pr-comments was removed in v2.1.91. To view pull request comments inside a session, ask Claude directly to read them instead.

Routine Pattern

Use /schedule when a workflow should run without your laptop staying open. Routines execute on Anthropic-managed cloud infrastructure, and Claude walks you through the setup conversationally:

/schedule every weekday morning triage new issues and post a Slack summary

If GitHub is not yet connected, /schedule prompts you to run /web-setup first.

Use /loop instead when the loop depends on the current local shell, running server, or local filesystem state. /loop [interval] [prompt] runs a prompt repeatedly while the session stays open; omit the interval to let Claude self-pace between iterations (alias: /proactive).

Use /goal when the task is not scheduled but has a concrete stop condition:

/goal tests pass and the migration notes are updated

Clear an active goal early with /goal clear (also stop, off, reset, none, or cancel).

Subagent definitions and /agents

Since v2.1.198, /agents prints guidance to ask Claude to create or edit a subagent file. The Running/Library wizard belongs to v2.1.197 and earlier. Use .claude/agents/ for project definitions or ~/.claude/agents/ for personal definitions; claude agents is the separate background-session view.

Changes in existing project/user agents directories are detected automatically. A newly created agents directory, one loaded through an added directory, or a session launched with --disable-slash-commands still needs a restart. See Subagents.

Remote Work Pattern

Use Remote Control (/remote-control or /rc) when you want the work to keep running on your machine while interacting from a browser or phone. Use Claude Code on the web when the work should run in Anthropic-managed cloud infrastructure. Use /teleport (or /tp) when a web session needs to come back to your terminal.

Use Agent View for local background work you may attach to later. Open it with claude agents, or dispatch a session straight to the background from the shell:

claude --bg --name "flaky-test-fix" "investigate the failing SettingsChangeDetector test"
claude --bg --exec 'pnpm test -- --runInBand'
claude agents

--bg starts a session that goes straight to the background; --name sets its display name in Agent View; --exec runs a shell command as a background job in place of a Claude session, so no model is invoked. After backgrounding, Claude prints the session's short ID. Current top-level management commands are claude attach <id>, claude logs <id>, claude stop <id>, claude respawn <id>, and claude rm <id> (v2.1.251+).

Before editing files, a background session moves into an isolated git worktree under .claude/worktrees/ so parallel sessions can read the same checkout while each writes to its own.

Use /workflows when Claude has generated a dynamic workflow that coordinates many background agents. It opens the workflow progress view to watch, pause, resume, or save runs. It is a control surface, not a replacement for merge review.

Related Commands and Naming Notes

A few commands relevant to automation and review have been renamed or aliased recently:

  • /code-review [low|medium|high|xhigh|max|ultra] reviews the current diff for correctness bugs, with cleanup coverage depending on model and effort; pass --fix to apply findings or --comment to post them as inline GitHub PR comments. /code-review ultra runs a deep cloud-based multi-agent review; this is the preferred invocation, and /ultrareview remains as an alias.
  • /code-review and /verify are user-invoked only since v2.1.215. v2.1.218 introduced background review execution. In v2.1.274+, models without tuned review settings use a leaner inline prompt, so the execution strategy is model-dependent.
  • /fork copies the current conversation into a separate background session; /subtask delegates inherited-context work inside the current conversation (v2.1.212+).
  • /usage shows session cost, plan usage limits, and activity stats. /cost and /stats are aliases (/stats opens on the Stats tab).
  • /usage-credits configures usage credits to keep working when you hit a limit; it was previously named /extra-usage.
  • /config opens the Settings interface; /settings is an alias. The legacy /vim command was removed in v2.1.92 — toggle Vim editing mode through /config → Editor mode.
  • /init initializes a project CLAUDE.md guide. Set CLAUDE_CODE_NEW_INIT=1 for an interactive flow that also walks through skills, hooks, and personal memory files; when a CLAUDE.md already exists, /init suggests improvements rather than overwriting it.
  • /fewer-permission-prompts is the bundled skill that scans your transcripts for common read-only Bash and MCP calls and adds a prioritized allowlist to .claude/settings.json to reduce permission prompts.

Related docs

Cmd. /background

Detach the current session as a background agent (/bg).

Cmd. /web-setup

Connect Claude Code web using local gh credentials.

Multi-session Workflow

Claude Code Complete Guide · Run parallel Claude Code sessions with git worktrees and agent view without losing branch, context, or verification control.

Cmd. /stop

Codex Command Master · Stop all background terminals owned by the current Codex session.

Subagents

Claude Code Complete Guide · Delegate bounded work while keeping the main Claude Code session accountable.

Skills and Custom Commands

How to design reusable Claude Code skills and slash commands for team workflows.

Operations and Safety Commands

Commands for permission control, MCP, plugins, cleanup, sandboxing, and troubleshooting.

On this page

Choose the Right SurfacePR Automation PatternRoutine PatternSubagent definitions and /agentsRemote Work PatternRelated Commands and Naming Notes