There is no check for whether the config file changed on disk since BCC loaded it (e.g. Claude itself rewrote it, or a second BCC window is open, or claude mcp add ran in a terminal) before write_config() overwrites it. This is the same class of bug as the "config got clobbered" complaints — silent loss of concurrent changes.
Proposed solution
In load_config(), record the file's mtime and content hash at load time (store in the returned structure or via a parallel _file_stamps dict keyed by path).
In write_config(), re-stat the file before writing. If mtime or hash changed, do not overwrite — instead raise a StaleFileError (or return a sentinel) with a diff of what changed externally.
In bcc.py, catch this and show a dialog: "File changed externally — reload and reapply your edits, or overwrite anyway."
Acceptance criteria
Editing in two BCC windows simultaneously and saving from both no longer silently loses one set of changes.
claude mcp add running between a BCC load and save is caught.
The overwrite-anyway escape hatch works.
Core stamp logic has unit tests (no real file races needed — test with a temp file modified between load and write).
Relevant code
bcc_core.py::load_config (line 135)
bcc_core.py::write_config (line 226)
## Problem
There is no check for whether the config file changed on disk since BCC loaded it (e.g. Claude itself rewrote it, or a second BCC window is open, or `claude mcp add` ran in a terminal) before `write_config()` overwrites it. This is the same class of bug as the "config got clobbered" complaints — silent loss of concurrent changes.
## Proposed solution
1. In `load_config()`, record the file's `mtime` and content hash at load time (store in the returned structure or via a parallel `_file_stamps` dict keyed by path).
2. In `write_config()`, re-stat the file before writing. If `mtime` or hash changed, do not overwrite — instead raise a `StaleFileError` (or return a sentinel) with a diff of what changed externally.
3. In `bcc.py`, catch this and show a dialog: "File changed externally — reload and reapply your edits, or overwrite anyway."
## Acceptance criteria
- Editing in two BCC windows simultaneously and saving from both no longer silently loses one set of changes.
- `claude mcp add` running between a BCC load and save is caught.
- The overwrite-anyway escape hatch works.
- Core stamp logic has unit tests (no real file races needed — test with a temp file modified between load and write).
## Relevant code
- `bcc_core.py::load_config` (line 135)
- `bcc_core.py::write_config` (line 226)
the_og
added the P0 label 2026-07-02 00:49:42 -04:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
There is no check for whether the config file changed on disk since BCC loaded it (e.g. Claude itself rewrote it, or a second BCC window is open, or
claude mcp addran in a terminal) beforewrite_config()overwrites it. This is the same class of bug as the "config got clobbered" complaints — silent loss of concurrent changes.Proposed solution
load_config(), record the file'smtimeand content hash at load time (store in the returned structure or via a parallel_file_stampsdict keyed by path).write_config(), re-stat the file before writing. Ifmtimeor hash changed, do not overwrite — instead raise aStaleFileError(or return a sentinel) with a diff of what changed externally.bcc.py, catch this and show a dialog: "File changed externally — reload and reapply your edits, or overwrite anyway."Acceptance criteria
claude mcp addrunning between a BCC load and save is caught.Relevant code
bcc_core.py::load_config(line 135)bcc_core.py::write_config(line 226)