Automatically break up large pull requests for easier code reviews.
Why?
Large pull requests are overwhelming and often receive a rubber stamp approval rather than a thorough review. Small pull requests are easier to review and lead to safer deployments.
How?
- Split the pull request locally using your LLM of choice (OpenAI, Anthropic, Google, etc.).
- You approve the split.
pr-splittercreates new smaller PRs in GitHub and closes the original.
npm install -g pr-splitter
Run pr-splitter without arguments to launch the interactive UI that guides you through breaking up a pull request.
To send requests to an LLM, pr-splitter asks for the LLM provider, API key, and optionally a custom LLM endpoint.
To perform git operations, pr-splitter asks for a GitHub personal access token.
These config values are stored in your system keychain, and requests are sent directy to these services.
How does it work under the hood?
pr-splitter collects all git hunks within a pull request, summarizes each, creates an in-memory vector database of these hunks,
and uses an LLM to group similar hunks together. A new commit is created for each group, and a pull request is created for each commit.
For a more detailed understanding, read the types.ts file and its comments. There you'll find every type used in the project and its purpose.
Some ways to contribute include:
- Adding a benchmark. This is how we measure the quality of the
pr-splitter. - Improving the speed of hunk grouping
- Adding support for missing LLM providers
- Allowing custom split instructions
- Modify the split process to run tests in the repo for each commit it suggests
- Include a command to automatically rebase
PR n +1afterPR nis merged

