Skip to content

Getting a codebase in front of ChatGPT

How to share code that spans several files, what to leave out, and why sending less usually produces a better review.

The situation

The bug spans four files and a schema. Pasting them one at a time loses the connection between them, and uploading the whole repository buries the answer in dependency directories.

What people use it for

  • Review a module for bugs rather than style opinions
  • Explain an unfamiliar codebase before you change it
  • Draft tests against code that has none
  • Work out why a stack trace points where it does

Worth knowing first

Check for secrets before you upload. Environment files, keys in config, and connection strings in fixtures all go to OpenAI along with everything else, and on consumer plans content may be used to improve models unless you have turned that off.

Related guides