QuestionQ89

Context Management & Reliability

You are creating developer-productivity tools with the Claude Agent SDK. The agent assists engineers with exploring unfamiliar codebases, understanding legacy systems, generating boilerplate code, and automating repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.

An engineer asks the agent to add comprehensive tests to a legacy codebase containing 200 files and very little existing test coverage. The engineer has not indicated which modules should be prioritized.

How should the agent break down this open-ended task?

Explanation

For a large legacy codebase with no stated priorities, the agent should explore the repository to understand its structure and dependencies, identify highly coupled or high-impact modules, and create an incremental testing plan that can be updated as it learns more. Glob and Grep support efficient repository discovery, while a revisable plan avoids arbitrary or equal-weight allocation that ignores technical risk and business impact.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!