[BUG] Doesn't understand the basic of data processing. Anything successfully processed should be backedup and not overwritten specially when you are spending days and days on it as it consumes lot of compute/money and time.

Resolved 💬 3 comments Opened Apr 9, 2026 by Ranaam21 Closed Apr 13, 2026

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?

Doesn't understand the basic of data processing. Anything successfully processed should be backedup and not overwritten specially when you are spending days and days on it as it consumes lot of compute/money and time. This is basic and stand practice. not sure how it is missing this basic.

What Should Happen?

Always backup successfully processed data and process the remaining one unless explicitly asked to process from scratch due to some requirement change.

Error Messages/Logs

This is bad — only 2 cases intact. The generate_one() step wiped
   the time directories when it regenerated all 80 cases. Let me
  check if generate_case() deletes and recreates the case
  directory:

  Searched for 1 pattern (ctrl+o to expand)

⏺ Found it — shutil.rmtree(out) on line 854. Every time
  generate_case() runs for an existing directory, it deletes
  everything including the solver output. That wiped 77 cases.This is bad — only 2 cases intact. The generate_one() step wiped
   the time directories when it regenerated all 80 cases. Let me
  check if generate_case() deletes and recreates the case
  directory:

  Searched for 1 pattern (ctrl+o to expand)

⏺ Found it — shutil.rmtree(out) on line 854. Every time
  generate_case() runs for an existing directory, it deletes
  everything including the solver output. That wiped 77 cases.

Steps to Reproduce

Steps to reproduce:

  1. Run a long parametric sweep that generates and solves 80

OpenFOAM cases (took ~8 hours)

  1. One case times out. Sweep reports: completed: 79, timeout: 1
  2. Assistant suggests re-running python3 openfoam/param_sweep.py

--out_dir openfoam/cases --n_parallel 1 to retry the 1 failed
case

  1. param_sweep.py calls generate_one() for ALL 80 cases before

running Docker

  1. generate_one() calls generate_case() which contains

shutil.rmtree(out) — unconditionally deletes the entire case
directory including all solved time directories (0.02/, 0.04/,
..., 0.24/)

  1. All 79 completed cases lose their OpenFOAM solver output
  2. Only the 2 cases that Docker re-ran in the new session

survive

Root causes (two separate failures):

  1. Code bug: generate_case() called shutil.rmtree(out) without

checking if solved output existed — should have been guarded
from day one

  1. Assistant error: Suggested re-running the full sweep script

instead of the direct Docker command for just case_0003, without
auditing generate_case() for destructive operations first

Expected behavior: Assistant should have given:
docker run --rm -v "/path/to/case_0003:/case"
opencfd/openfoam-default:latest bash -c "cd /case && bash
run.sh"

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Sonnet 4.6 (model ID: claude-sonnet-4-6)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗