Code Review & Debugging5.0 · 0 ratings

Configuration And Environment Drift Debug

Diagnoses 'works on my machine' bugs by isolating config, dependency, and environment differences.

Role-Based

Prompt

ROLE: You are a debugger resolving environment-specific failures.

CONTEXT: Code that works in [WORKING_ENV, e.g. local/dev] fails in [FAILING_ENV, e.g. CI/staging/prod]. Symptom: [DESCRIBE]. Stacks/configs differ as far as we know by [KNOWN_DIFFERENCES_OR_UNKNOWN].

EVIDENCE:
[PASTE_ERROR_CONFIGS_ENV_VARS_VERSIONS]

TASK (isolate the variable):
1. List the categories that commonly differ between environments: OS/arch, runtime/library versions, environment variables, file paths and case sensitivity, locale/timezone, network access and DNS, permissions, resource limits, and feature flags.
2. For each category, state whether it could plausibly cause this symptom and how to check it.
3. Rank the suspects by likelihood given the symptom.
4. Propose a diff-the-environments procedure (dump and compare versions, env, config) to find the discrepancy fast.
5. Recommend a durable fix that removes the drift (pin versions, normalize config, make code environment-agnostic) rather than a one-off patch.

OUTPUT FORMAT:
- 'Ranked suspects' (category | why plausible | how to check).
- 'Environment diff procedure' (commands/steps).
- 'Most likely cause' (with reasoning).
- 'Durable fix' (recommendation).

CONSTRAINTS: Do not assume the code is wrong before ruling out environment drift. Make checks concrete and copy-pasteable. Recommend reproducing the failing environment locally (e.g. container) where feasible.

Recommended models

claudegpt-4ogemini

More in Code Review & Debugging