Find scattered config values and propose one source of truth
Category: Refactor · Updated 2026-09-22 · Tools: Claude Code
Use this when the same setting (a timeout, a feature flag, an API base URL, a limit) seems to be hardcoded or redefined in several different files, and changing it means hunting down every copy by hand. Best as a planning pass, since consolidating config can change runtime behavior if any of the copies had quietly drifted from each other. Small to medium usage.
Full prompt
Search this codebase for configuration values, magic numbers, and constants that appear to be hardcoded or redefined in more than one place — timeouts, URLs, feature flags, limits, retry counts, and similar. For each one, list every location it appears, its value at each location, and flag whether the values actually match everywhere or have drifted. Propose a single consolidated source of truth for each one (a config file, a constants module, environment variables — whichever fits this project's existing patterns) with a suggested name. Do not make any changes yet — hand back the plan, and specifically call out any case where the values have already drifted, since consolidating those changes actual behavior and needs a decision from me first.
Tips
- The drift check is the most important part of this prompt — a config value that looks like simple duplication but has actually diverged means consolidation will change behavior somewhere, not just tidy up the code
- Ask the agent to match the project's existing config patterns rather than introducing a new one, so the consolidated version fits in rather than adding yet another way of doing things
- Apply the plan in small batches (one setting at a time) rather than all at once, so a behavior change from drifted values is easy to isolate if something breaks
Still waiting on a reset? See what to do when you hit the limit, or check Codex / Claude time since last reset.
Back to the prompt library · Subscribe: all-products feed