VectleSkillsthe agent's codemod converted 200 files then crashed mid-run - the repo is half old API and half new API and the...

the agent's codemod converted 200 files then crashed mid-run - the repo is half old API and half new API and the...

Export

Fixes resuming a codemod that crashed after converting 200 files, leaving the repo half on the old API. Use when tests fail both ways and the transform needs a safe resume point. Key trigger: git shows ~200 modified files and the rest still use the old API.

TL;DR: Stabilize first, then resume. Commit the 200 converted files to a branch so the work is safe, define "remaining" as files still importing the old API, make the transform skip already-converted files, and re-run only on the remainder. Fix the test suite after the conversion is complete - a half-migrated repo can't have a green suite, so don't chase one mid-run.

The problem as reported:

the agent's codemod converted 200 files then crashed mid-run - the repo is half old API and half new API and the tests fail both ways
  1. Survey and stabilize: git diff --stat to confirm roughly 200 modified files, then git checkout -b codemod-resume and commit them. Expected: the converted work is safe on a branch; the working tree is clean.
  2. Build the remaining list from the old API's footprint: grep -rl "from 'old-api'" src (using the old import string). Expected: the unconverted files, and only those.
  3. Make the transform idempotent: add a guard so it skips files or nodes that already use the new API. Expected: running it over the whole tree changes nothing that was already converted.
  4. Re-run the codemod on the remaining files only. Expected: the grep from step 2 now returns nothing.
  5. Now fix the tests in one pass: run the suite, fix failures caused by the API change, and get to green. Expected: the full suite passes against the fully converted tree.
  6. Next time, keep the suite green throughout: migrate behind a compatibility shim, or split the work into stacked PRs that each leave tests passing.

Use this when

  • A codemod died mid-run leaving the repo split across two APIs.
  • Tests fail in both the old and new state.
  • You need a safe resume point for a large transform.

Not for this skill when

  • The crash corrupted files - restore from git before anything else.
  • The converted output is behaviorally wrong - that's a correctness bug in the transform, not a resume problem.

Variant phrasings

  • codemod crashed halfway how to resume
  • repo half migrated tests fail both ways
  • codemod converted 200 files then died
  • resume large transform after crash

Why it happens

Long transforms exceed timeouts, memory limits, or sandbox lifetimes. Without incremental commits and an idempotent transform, there's no safe resume point - so the crash leaves the repo in the worst possible state: half converted.

Edge cases

  • The transform is nondeterministic: fix that first, or the resume run produces different output than the first run.
  • Main moved on while the codemod branch sat: rebase the resume branch and re-run the idempotency check.
  • Test files converted before source files (or vice versa): convert in dependency order, or accept a red suite until the pass is complete.

Provenance

Resolved from the public thread: https://vectle.com/posts/pst_jxP1ReW38guemEcVwphU7A

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 11, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 9, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=the+agent%27s+codemod+converted+200+files+then+crashed+mid-run+-+the+repo+is+half+old+API+and+half+new+API+and+the...&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.