Emendant and the AI SDK codemod compared
You can use both. The codemod rewrites your files by syntax. Emendant reports which of your call sites a supported release changed and checks its patches. On the file we tested, each tool found a site the other missed.
Side by side
@ai-sdk/codemod | Emendant | |
|---|---|---|
| How it finds code | Each transform matches by syntax: a property or key with a given name, anywhere in the file. | Each entry matches a use of a named ai export, followed from its import. |
| What it changes | Edits your files in place. --dry previews. | Writes patches to .emendant/patches/. It does not edit your working tree. |
| Checks after the edit | None. Run your own typecheck and tests. | Runs discovered or configured typecheck and test commands on a patched copy and grades each patch. |
| What it reports | The files it changed, and transform errors. | Each affected place, the release that changed it, its sources, and changes it found but cannot patch. |
| Coverage | Its own transforms for the 4.0, 5.0, 6.0 and 7.0 upgrades. AI SDK only. | The changes in its feed for supported releases, including the AI SDK, openai and langchain. |
One file, both tools
We wrote a file for ai@6.0.312 and, on 7 November 2026, ran three of the codemod's 7.0 transforms on it, from @ai-sdk/codemod@4.0.4. We also ran emendant scan --package ai from emendant@0.12.0.
- The codemod renamed
experimental_contexttocontextin a tool'sexecuteoptions. That is correct. Emendant did not report it. - Emendant reported
experimental_contextingenerateTextand patched it toruntimeContext. The codemod did not change it. - The codemod renamed
fullStreamtostreamon a local object, and renamedonFinishon an unrelated callback. Emendant reported neither, as expected. - The codemod renamed
experimental_contexttocontexton aStepResult, which does not declarecontext.
This is one file and three transforms. It is not a measure of either tool across a codebase. The full file and line-by-line table are in Use Emendant alongside the AI SDK codemod.
Run both
- Commit or stash your work, so each tool's changes show as their own diff.
- Scan first:
npx emendant scan --package ai - Preview then run the codemod:
npx @ai-sdk/codemod v7 --drythennpx @ai-sdk/codemod v7 - Read the codemod diff. Look for renamed properties on objects that are not from
ai. - Scan again and generate patches for what is left:
npx emendant scan --package ai --adoptedthennpx emendant fix --package ai --adopted - Run your typecheck and tests. Then read the AI SDK 7.0 migration guide for steps neither tool covers.
Coverage. Emendant reports the changes in its feed. A clean scan does not show that an upgrade is complete. See supported projects and known limitations.
Sources
Other tools' behaviour was checked against their own documentation on 13 November 2026.