← 2.1.4 Test inconclusive · runtime-test

CLAUDE_CODE_DISABLE_BACKGROUND_TASKS — runtime test

Hands-on runtime battle-test of CLAUDE_CODE_DISABLE_BACKGROUND_TASKS. Result: INCONCLUSIVE.

CLAUDE_CODE_DISABLE_BACKGROUND_TASKS is an environment variable that suppresses all background task spawning and Ctrl+B backgrounding in Claude Code, tested in v2.1.4 against runtime 2.1.9 with inconclusive results.

How It Works

When set (e.g., export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1), this flag disables three behaviors: auto-backgrounding of long-running tasks, the Ctrl+B shortcut for manual backgrounding, and all related background task infrastructure. The intended effect is to force all task execution to run synchronously in the foreground.

Test Design and Result

The test suite outlined four manual steps: start Claude without the env var and observe Ctrl+B and auto-backgrounding behavior; then restart with CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 and verify both features are disabled. However, the test was never executed at runtime. Code review confirmed the feature was implemented as designed, but interactive terminal behavior and task-duration-dependent auto-backgrounding could not be verified in an automated setting. Status: CODE REVIEW ONLY (manual verification needed).

Stated Use Cases

The feature targets CI/CD pipelines (background tasks are meaningless non-interactively), scripted usage via claude -p, debugging workflows (forcing synchronous execution), and resource-constrained environments seeking to prevent spawned processes.

Epistemic Status

INCONCLUSIVE. The implementation appears sound, but runtime behavior remains unvalidated. A manual test—comparing behavior with and without the environment variable across multiple task types—would be required to confirm the feature works as specified.

Primary source
⎘ 2.1.4/tests/01-disable-background-tasks/TEST-RESULTS.mdverbatim from the corpus

Test Results: CLAUDE_CODE_DISABLE_BACKGROUND_TASKS

Feature: Added CLAUDE_CODE_DISABLE_BACKGROUND_TASKS environment variable to disable all background task functionality including auto-backgrounding and the Ctrl+B shortcut

Tested: 2026-01-16 Version: 2.1.4 features on 2.1.9

Feature Description

When set, this env var disables:

  1. Auto-backgrounding of long-running tasks
  2. Ctrl+B shortcut to manually background tasks
  3. All background task functionality

Use Cases

  1. CI/CD environments - Background tasks don't make sense in non-interactive pipelines
  2. Scripted usage - When using claude -p in scripts, backgrounding is irrelevant
  3. Debugging - Force all tasks to run foreground for easier debugging
  4. Resource-constrained environments - Prevent spawning background processes

Expected Usage

export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1
claude
# Now: Ctrl+B does nothing, tasks won't auto-background

Or inline:

CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 claude -p "do something"

Test Results

Status: CODE REVIEW ONLY

Cannot runtime-test because:

  1. Ctrl+B requires interactive terminal
  2. Auto-backgrounding depends on task duration and conditions
  3. Would need to compare behavior with/without env var set

Manual Test Steps

  1. Start claude WITHOUT env var
  2. Run a long task, verify Ctrl+B works or auto-backgrounds
  3. Exit, restart WITH CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1
  4. Run same long task, verify Ctrl+B does nothing
  5. Verify no auto-backgrounding occurs

Notes

Simple, focused feature. Provides control over background behavior for environments where it's undesirable.

Status: CODE REVIEW (manual verification needed)

Evidence & receipt
◇ ed25519 receipt
idtest_5754eb545e918147a4a839a5
alged25519
pubkey9b87705613b1e2fd064d57fa75a6b679d2856ceafad6b1daa8f982493871b6dd
sig154196f6675d96520aaa58794367fcbf6566be54eb66011d776456ddc69465aaccbe6be64a55d9b6ff9abbdca29a6b0319a5d5016a782465004b58db507f0803

Signed with an ed25519 key held off the repo. Anyone can verify against the published public key; nobody without the secret key can forge it. Click verify: it recomputes the signature in your browser. The signature proves integrity and authorship of this exact content — not a third-party timestamp or that the underlying claim is objectively true. signedAt is when the @f3/attest pipeline ran, not when the work happened; the evidence refs carry the source dates.

Connected