A Claude Code session often holds the reasoning behind a change: what was tried, what failed and why the final fix looks the way it does. That’s worth keeping next to the pull request, and there’s a built-in command for it.
/export session-notes.txt
According to the Claude Code commands reference, /export exports the current conversation as plain text. With a filename it writes straight to that file. Without one, it opens a dialog where you choose between copying to the clipboard and saving to a file.
Where I think it helps most: paste the relevant part into a PR description or an issue, so a reviewer sees why a change was made right next to the diff. Or save it before you run /clear and start fresh, so the old context isn’t lost for good.
Caveat: it’s the whole conversation, including anything you pasted in. Check the file for tokens, internal hostnames and other things that shouldn’t land in a repository before you share it. And on version 2.1.327 or later, /export with a filename refuses to overwrite a file that already exists, so pick a new name each time.
Further reading: Claude Code docs: Commands