CCAR-F scenarios › Code Generation with Claude Code · Question 18 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
Before a large refactor, Claude Code must survey around 300 files to catalog every place a deprecated configuration API is used. In previous attempts, the discovery output filled the context window before the refactor even began, and the implementation phase suffered. How should you structure the work?
Show answer and explanation
Answer: D — Delegate the discovery to the Explore subagent, which isolates the verbose search output and returns a concise summary of usages for the main session to act on.
The Explore subagent isolates verbose discovery output and returns a summary, which prevents context exhaustion during multi-phase tasks while the main session keeps the high-level coordination (tasks 3.4 and 5.4). Printing only file names (a) loses the usage details the refactor needs and still accumulates in the main context. An output token limit (b) doesn't change how much discovery output piles up in context. Reading all files upfront (c) is exactly what exhausts the context, instead of building understanding incrementally.
More from this scenario
- During a long debugging session, the context has filled with verbose test-runner output…
- You're adding comprehensive tests to a legacy service in phases. In phase one, a…
- A new engineer joins and finds that Claude Code ignores the team's error-handling and…
- Your monorepo has a shared standards folder with files for API design, PCI handling…
- The root CLAUDE.md has a long section on database migration conventions. Migration files…