[BUG] Claude Code repeatedly violates SSOT — creates duplicate constants/paths across files
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?
Claude Code tends to define the same constants, paths, and logic in multiple files instead of referencing a single source. Each session adds new code without checking if equivalent logic already exists, resulting in fragmented and inconsistent codebases. This compounds over multiple sessions as each new session also fails to recognize the duplication.
What Should Happen?
Before adding any new constant, path, configuration value, or utility function, Claude Code should search the codebase for existing definitions of the same thing. If a single source already exists, it should reference that instead of creating a duplicate. When a new source of truth needs to be established, it should refactor all existing duplicates to point to it — not add yet another copy.
Error Messages/Logs
Steps to Reproduce
Start a multi-session project with Claude Code where multiple files share related configuration (e.g., a settings file path, a base URL, a directory constant).
In session 1, ask Claude to implement a feature that requires a config value. Claude defines it inline or in a new location.
In session 2, ask Claude to implement a related feature. Without checking session 1's code, Claude defines the same value again in a different file.
Repeat across sessions. Each session compounds the duplication.
A bug in the shared value now requires fixing it in multiple places — and Claude may only fix one of them.
Minimal example: Ask Claude to save a file path like settings.json in one session, then in a new session ask it to read from the same settings file. Claude will likely hardcode the path again rather than finding and reusing the existing definition.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.45 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗