[BUG] & (background mode) shortcut intermittently ignored — runs in foreground instead

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Mar 17, 2026 · closed May 15, 2026

Description

The & shortcut for background mode (documented in /help under Shortcuts) intermittently fails to trigger. When it doesn't work, the command runs in the foreground as if & wasn't typed.

Expected behavior

Prefixing a prompt with & should reliably run the task in the background, allowing the user to continue interacting.

Actual behavior

Sometimes & is ignored and the task runs in the foreground, blocking interaction. No error message — it just doesn't background.

Reproduction

Intermittent. No reliable repro steps identified yet — it fails unpredictably.

Environment

  • Claude Code v2.1.77
  • macOS (Darwin 25.3.0)
  • Terminal: Ghostty + tmux

View original on GitHub ↗

6 Comments

alignmktg · 7 months ago

Additional context (from Claude Code session):

USER:

I prepended an ampersand to that. What prevented you from running it in background per your help files?

  Claude Code v2.1.77  general   commands   custom-commands


  Claude understands your codebase, makes edits with your permission, and executes commands — right from your terminal.

  Shortcuts
  ! for bash mode           double tap esc to clear input        ctrl + shift + - to undo
  / for commands            shift + tab to auto-accept edits     ctrl + z to suspend
  @ for file paths          ctrl + o for verbose output          ctrl + v to paste images
  & for background          ctrl + t to toggle tasks             meta + p to switch model
  /btw for side question    shift + ⏎ for newline                ctrl + s to stash prompt
                                                                 ctrl + g to edit in $EDITOR
                                                                 /keybindings to customize


  For more help: https://code.claude.com/docs/en/overview

---

CLAUDE CODE:

You're right. The & prefix means "run in background" — I should have launched the cmux research as a background agent and kept working on whatever else was in the queue instead of blocking on it.

My bad. Will honor the & prefix going forward.

---

USER:

I'm trying to figure out if it's a bug or not. Seems to me it should be programmatic like ! at start of a prompt.

---

CLAUDE CODE:

⏺ claude-code-guide (Research & prefix behavior)
⎿ Done (6 tool uses · 60.6k tokens · 18s)
(ctrl+o to expand)

Not a bug — & doesn't work like !.

! is a programmatic input prefix that transforms the prompt into bash mode. & is listed in the shortcuts section but it's a UI mode toggle, not a prefix parser. The actual background mechanism is Ctrl+B (to background something already running) or asking naturally.

So the help screen is a bit misleading — it lists & alongside ! and / as if they're all input prefixes, but & behaves differently. That's a UX documentation issue in Claude Code's help screen, not a bug in execution.

If you want to file it: it's a clarity issue with the shortcuts help display. The & should probably either (a) work as a prefix like ! does, or (b) be listed separately from the input prefixes to avoid confusion.

KirtashW17 · 6 months ago

Also happens to me but always, not intermittently. #42498

rjgeng · 6 months ago

Confirmed always broken (not intermittently) on:

  • v2.1.85 (stable)
  • v2.1.92 (latest)

Works correctly on v2.1.38 — color changes to teal/green and
"& to background" hint appears.

Tested on macOS, same machine, same terminal — only Claude Code
version changed. Regression introduced somewhere between v2.1.38
and v2.1.85.

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

alignmktg · 4 months ago

Still broken on v2.1.148 (macOS 26.3.1).

Repro:

  1. /help — confirms & for background is listed alongside !, /, @ as an input prefix.
  2. Type & <any prompt> at the input.
  3. Expected: & highlights (teal/green like !, /, @), prompt dispatches as a background task.
  4. Actual: & stays the default text color, no prefix recognition, prompt runs in the foreground.

The other three prefixes still render with the prefix color; & is the only one that doesn't. So this isn't intermittent — it's consistently dead on current stable.

(on behalf of Matt)

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.