Codemod is a library for large scale refactor of code, and so is jscodeshift. Even though both achieve same goal, lets see the differences between them

Codemod is search-and-replace library, jscodeshift is code transformation tool for javascript

If you have ever used search and replace feature in you editor, then it is easy to understand codemod. You search for some keywords or use regex, and then replace it again with some keyword. This is what codemod does. It has more features like specifying start, end, extensions, but at the core it is a search and replace library.

jscodeshift is more of code refactoring tool. You can do complex code refactoring like replacing bind (this.f = this.f.bind(this)) with arrow functions (f = () => {})

Codemod is python based library, while jscodeshift is javascript based

Codemod is written in python. Its dependency is python2. jscodeshift is javascript based tool. It uses AST (Abstract Syntax Tree) transformation. In simple terms, AST is json based tree representation of the javascript code. You can play around the AST tool in this website http://astexplorer.net/

Codemod uses regex, jscodeshift parses code

Codemod does not parse the code. It is normal search and replace using regex. But because jscodeshift using AST transformation, it parses the entire javascript code. So you can write complex conditions and handle edge cases easily for js files in jscodeshift.

Codemod is useful for all kinds of file, but jscodeshift is useful only for javascript files

Codemod is more generic search and replace library. It can work on many kinds of files. You can restrict codemod to run only on specific files using the --extensions attribute JSCodeshift, as the name suggests, is useful only for javascript files

Pro tip: React using jscodeshift scripts to upgrade users from one react version to another. You can see many jscodeshift scripts in this github repository - https://github.com/reactjs/react-codemod. (It is confusingly named as react-codemod, but those are jscodeshift scripts)