chapter two

2 Chat: Paste code, get answers

 

This chapter covers

  • Follow-ups over "explain this code"
  • Serializing a repo into one pasteable file
  • Interrogating LLMs with constraints
  • The forgetting curve and learning notes
  • Chat, workflow, and agent: when to use which

Most developers' first AI interaction with code looks the same: paste a file, type "what does this do?", get a wall of generic text that could describe any codebase on earth. They try again. Same wall. They conclude the tool is overhyped and go back to reading code manually. The problem was never the model. It was the question.

One good follow-up question will teach you more than ten "explain this code" prompts. This chapter is your first real rep: you'll paste a file into a chat window, ask a bad question, watch it fail, then ask a good one and get a genuine design insight the code alone couldn't tell you. By the end, you'll have a one-page map of how a real codebase works. No installation required. Chat is free, works on any model, and it's the best tool for exploring a few files at a time. It breaks down past a handful of files, and it depends on you knowing what to ask. When you don't know what to ask, or the codebase is too big to paste, that's where workflow and agent take over (Chapters 3 and 4).

Figure 2.1 Paste code and get a generic wall of text, follow up on the one line that surprises you, constrain the output with numbers instead of adjectives, then write a learning note that fights forgetting.

2.1 Paste a file and start chatting

2.1.1 Which model should I pick?

2.2 From one file to the whole repo

2.2.1 What you cut matters as much as what you keep

2.3 How to ask good questions

2.3.1 Ask for a story, not a category

2.3.2 Constrain by numbers, not adjectives

2.3.3 Ask for toy examples, not prose

2.4 You'll forget two-thirds by tomorrow

2.4.1 Start with a skeleton

2.4.2 Follow up on the line you think you understand

2.4.3 Rewrite it yourself

2.4.4 Quiz yourself on the gaps

2.5 When chat isn't enough: Workflow and agent

2.5.1 What's a workflow?

2.5.2 What's an agent?

2.5.3 How the three connect

2.6 Summary