CCAR-F scenarios › Code Generation with Claude Code · Question 15 of 60

Scenario 2 · Code Generation with Claude Code

Your engineering team relies on Claude Code to generate, refactor, debug, and document code. You're responsible for fitting it into the team's workflow: custom slash commands and skills, a sensible CLAUDE.md setup, and knowing when a task calls for plan mode and when direct execution is enough.

Context Management & Reliability

Two hours into exploring an unfamiliar payments codebase, Claude Code's answers start to drift. It describes "the typical repository pattern" instead of the specific LedgerRepository and SettlementBatcher classes it examined earlier, and it gives an answer that conflicts with one from an hour ago. What practice best counteracts this?

Show answer and explanation

Answer: C — Have Claude maintain a scratchpad file recording key findings, such as class names, responsibilities, and data flows, and consult that file when answering later questions.

Answers that slip into "typical patterns" and contradictions are signs of context degradation in a long session. A scratchpad file of key findings persists them across context boundaries and gives later questions a reliable reference (task 5.4). Restarting and repeating the exploration (a) throws away the work and will degrade the same way. Rereading everything (b) floods context and speeds up the degradation. Extended thinking (d) doesn't bring back details that have degraded in context.