Claude Code always forget setMeta() in TipTap appendTransaction history
I keep asking Claude to build custom TipTap plugins. Works great until I test undo, then the history gets weird with duplicate entries, loops, and other changes
I found that the issue is that Claude forgets to set setMeta():
appendTransaction(tr, oldState, newState) {
// Auto-format on keystroke
newState.doc.descendants(node => {
if (shouldFormat(node)) tr.insertText('x', pos);
});
return tr; // Missing: tr.setMeta('plugin', true)
}
Without it, every keystroke that triggers your plugin adds to the undo stack. Press Ctrl+Z and you're stuck in duplicate entries. Same thing happens with every custom node I ask Claude to write. Works perfectly in the editor, broken undo history.