Claude regenerates entire files instead of surgical edits for metadata-only changes

Resolved 💬 1 comment Opened May 26, 2026 by StefanSuditu Closed Jun 27, 2026

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")

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗