claude-code - 💡(How to fix) Fix [Critical] Claude가 기존 파일을 사용자 동의 없이 덮어쓰기 직전까지 진행 — 사용자 ESC 반응 속도에 데이터 보존이 의존 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47048Fetched 2026-04-13 05:42:51
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Code Example

● 파일이 이미 있습니다. 덮어쓰겠습니다.
  Interrupted · What should Claude do instead?
RAW_BUFFERClick to expand / collapse

문제 상황

사용자가 파일명만 지정해서 작성 요청을 했고, 해당 경로에 이미 다른 내용의 파일이 존재하는 상황. Claude가 파일 존재를 인지한 직후 다음과 같이 반응:

● 파일이 이미 있습니다. 덮어쓰겠습니다.
⎿  Interrupted · What should Claude do instead?

사용자가 ESC로 중간에 끊어서 간신히 참사를 막음. 만약 사용자가 잠깐 한눈을 팔았거나 ESC 타이밍을 놓쳤다면 다른 세션에서 작성한 파일 내용이 그대로 덮여 씌워졌을 상황.

재현 방법

  1. 사용자가 파일명 지정하여 내용 생성 요청
  2. 해당 경로에 이미 다른 내용의 파일 존재
  3. Claude가 파일 존재 인지 후 "파일이 이미 있습니다. 덮어쓰겠습니다." 출력
  4. 바로 다음 턴에 Write 실행 시도
  5. 사용자가 ESC로 끊지 않으면 기존 파일 내용 소실

예상 동작

파일이 이미 존재함을 인지한 순간, 실행을 멈추고 사용자에게 확인:

  • 기존 파일에 어떤 내용이 있는지 확인
  • "이 파일에 이미 다른 내용이 있습니다. 덮어쓸까요?" 질문
  • 사용자 승인 이후에만 Write 실행

실제 동작

"덮어쓰겠습니다"라고 통보만 하고 바로 실행으로 넘어감. 사용자 승인 단계 자체가 없음. 사용자가 능동적으로 ESC를 눌러야만 참사를 막을 수 있음.

영향

  • CLAUDE.md의 "코드 직접 수정 전에 바뀔 코드 먼저 보여주고 사용자 허락 대기" 규칙 위반
  • 사용자의 ESC 반응 속도에 데이터 보존이 달려 있음 → 구조적 결함
  • 다른 세션에서 작업한 결과물이 실수 한 번으로 영구 소실 가능

extent analysis

TL;DR

To prevent accidental overwriting of existing files, Claude should prompt the user for confirmation before proceeding with the write operation.

Guidance

  • When Claude detects that a file already exists, it should immediately stop and prompt the user to confirm whether to overwrite the file.
  • The prompt should include information about the existing file's contents to ensure the user is aware of what will be overwritten.
  • The write operation should only proceed after the user has explicitly confirmed that they want to overwrite the file.
  • Consider adding a timeout or a default action (e.g., canceling the write operation) if the user does not respond within a reasonable time frame.

Example

A possible implementation could involve displaying a message like "이 파일에 이미 다른 내용이 있습니다. 덮어쓸까요?" and waiting for the user's response before proceeding.

Notes

The current implementation's reliance on the user's ability to quickly press ESC to prevent data loss is a structural flaw that can lead to accidental data deletion. A more robust solution would involve obtaining explicit user confirmation before overwriting existing files.

Recommendation

Apply a workaround that prompts the user for confirmation before overwriting existing files, as this will prevent accidental data loss and ensure that the user is aware of the potential consequences of their actions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Critical] Claude가 기존 파일을 사용자 동의 없이 덮어쓰기 직전까지 진행 — 사용자 ESC 반응 속도에 데이터 보존이 의존 [1 comments, 2 participants]