[BUG] CC 2.1.1 Remote/Background Sessions Failing Intermittently

Open 💬 2 comments Opened Jan 8, 2026 by emssik

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Background sessions (& command) fail with multiple different errors even after proper setup. The session may appear to start on the web interface but doesn't execute properly.

What Should Happen?

  • After installing GitHub app, background sessions should work immediately from CLI
  • After successful /login, background sessions should work consistently

Error Messages/Logs

Steps to Reproduce

  1. Install Claude GitHub app on the repository
  2. Run a background task: & test
  3. Receive error:

Cannot launch remote Claude Code session.
The Claude GitHub app must be installed on this repository first.
https://github.com/apps/claude/installations/new

  1. Note: This error appears even though the GitHub app IS already installed.
  2. The only way to proceed is to first execute ANY action from the Claude Code web interface on this repository.
  3. After that, retry: & test
  4. Receive new error: Failed to create background session: Failed to create remote session
  5. Run /login - login succeeds
  6. Try another background task
  7. Receive yet another error: Failed to create background session: Failed to upload session history (message 1/12)

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.1

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Actual Behavior

  1. Initial block: "GitHub app must be installed" error appears despite app being installed
  2. Workaround required: Must first use web interface on the repo to "initialize" something
  3. After workaround: Still fails with "Failed to create remote session"
  4. After /login: Fails with different error "Failed to upload session history"
  5. Web UI behavior: Shows "Starting Claude Code..." but agent doesn't actually execute

Root Cause Hypothesis

There appears to be a missing initialization/registration step that only gets triggered when using the web client first. The CLI alone cannot properly initialize a repository for remote sessions, even with all prerequisites met.

Workaround

Execute any action from Claude Code web interface first on the target repository before attempting to use & background commands from CLI.

Additional Notes

  • Login state doesn't persist between background session attempts
  • Three distinct failure modes observed in sequence:

a. GitHub app not detected (false positive)
b. Remote session creation failure
c. Session history upload failure

View original on GitHub ↗

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