claude-code - 💡(How to fix) Fix Claude regenerates entire files instead of surgical edits for metadata-only changes

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…

When a generated file (e.g., PPTX presentation) needs a small metadata change (date, time, author), Claude proposes to regenerate the entire file from scratch instead of performing a surgical edit on just the affected field.

This was observed when generating PowerPoint presentations: after discovering the timestamp in the file metadata was incorrect, Claude proposed to re-run the full generation script (rebuilding all 13+ slides with text, formatting, cards, etc.) instead of simply opening the file and updating the single metadata field.

Root Cause

When a generated file (e.g., PPTX presentation) needs a small metadata change (date, time, author), Claude proposes to regenerate the entire file from scratch instead of performing a surgical edit on just the affected field.

This was observed when generating PowerPoint presentations: after discovering the timestamp in the file metadata was incorrect, Claude proposed to re-run the full generation script (rebuilding all 13+ slides with text, formatting, cards, etc.) instead of simply opening the file and updating the single metadata field.

Code Example

from pptx import Presentation
from datetime import datetime
prs = Presentation("file.pptx")
prs.core_properties.created = datetime(2026, 5, 26, 10, 0)
prs.save("file.pptx")
RAW_BUFFERClick to expand / collapse

Bug Report

Category: waste (unnecessary token/resource consumption) Severity: Major Claude Code Version: 2.1.84 OS: Windows 11 Pro

Description

When a generated file (e.g., PPTX presentation) needs a small metadata change (date, time, author), Claude proposes to regenerate the entire file from scratch instead of performing a surgical edit on just the affected field.

This was observed when generating PowerPoint presentations: after discovering the timestamp in the file metadata was incorrect, Claude proposed to re-run the full generation script (rebuilding all 13+ slides with text, formatting, cards, etc.) instead of simply opening the file and updating the single metadata field.

Expected Behavior

For metadata-only changes, Claude should:

  1. Open the file with the appropriate library (e.g., python-pptx)
  2. Modify ONLY the specific field (e.g., prs.core_properties.created = datetime(...))
  3. Save
  4. Done - ~5 lines of code, <1 second execution

Actual Behavior

Claude regenerates the entire file:

  • Re-runs the full generation script
  • Recreates all slides, text boxes, formatting, colors
  • Wastes hundreds/thousands of tokens
  • Takes 30-60 seconds instead of <1 second
  • Risks losing manual edits the user may have made

Steps to Reproduce

  1. Ask Claude to generate a PPTX file with multiple slides
  2. Notice the metadata (date/time) is incorrect
  3. Ask Claude to fix the date
  4. Observe: Claude proposes to regenerate the entire PPTX instead of editing metadata

Impact

  • Tokens wasted: Hundreds to thousands per occurrence (full script regeneration vs ~50 tokens for surgical fix)
  • Time wasted: 30-60s vs <1s
  • Risk: Regeneration can overwrite manual user edits made between generation and fix
  • Cost: Tokens = real money on API usage
  • Observed on: 13 PPTX files that all needed the same metadata fix - Claude initially tried to regenerate each one

Suggested Fix

The model should apply a "surgical edit" principle: before regenerating any file, evaluate whether the change can be done with a minimal edit (open file, change field, save). This applies to:

  • File metadata (PPTX, DOCX properties - created/modified dates, author, title)
  • Single fields in structured files
  • One slide in a presentation
  • One section in a document
  • One line in a config file

Analogy: don't rebuild a house to change a lightbulb.

Correct approach (5 lines Python):

from pptx import Presentation
from datetime import datetime
prs = Presentation("file.pptx")
prs.core_properties.created = datetime(2026, 5, 26, 10, 0)
prs.save("file.pptx")

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