Channels session crashes in headless/background mode with stdin error

Resolved 💬 3 comments Opened Mar 29, 2026 by keevaspeyer10x Closed Apr 2, 2026

Environment

  • Claude Code v2.1.87
  • Ubuntu Linux (VPS)
  • Discord plugin v0.0.4 (discord@claude-plugins-official)
  • Running as a systemd user service (no interactive terminal)

Bug

Running claude --channels plugin:discord@claude-plugins-official in a background/headless context (no interactive terminal) crashes after ~15-20 seconds with:

Error: Input must be provided either through stdin or as a prompt argument when using --print

Reproduction

# Method 1: background process
claude --channels plugin:discord@claude-plugins-official --dangerously-skip-permissions &
# Dies after ~15-20s with stdin error

# Method 2: with output redirection (how a systemd service would run it)
claude --channels plugin:discord@claude-plugins-official > >(cat) 2>&1 &
# Same result

# Method 3: with fifo stdin
mkfifo /tmp/test-stdin
cat /tmp/test-stdin | claude --channels plugin:discord@claude-plugins-official &
# Prints "Warning: no stdin data received in 3s", then dies same way

Expected behaviour

--channels should run as a long-lived daemon process without requiring an interactive terminal or stdin. The Discord plugin provides the input channel (messages from Discord), so stdin shouldn't be needed.

Context

We're running Claude Code as an always-on agent via a systemd service with a supervisor script. The supervisor starts claude --channels plugin:discord@claude-plugins-official, monitors the process, and handles restarts. The Discord bot connects successfully (we can see it online), but the Claude process itself dies before it can process any messages.

The flag isn't listed in claude --help output, but the process does start and connect the Discord bot before crashing — so the flag is partially working.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗