You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution.
Your team wants Claude to follow a detailed code review checklist (8 items covering API changes, test coverage, documentation, security, etc.) when reviewing pull requests. The team also uses Claude extensively for other tasks: writing new features, debugging production issues, and generating documentation. Currently, developers paste the checklist at the start of each review session.
Which approach best addresses this workflow need?
The checklist is a reusable, task-specific procedure that should load only when a pull-request review is being performed. A /review command provides an explicit invocation mechanism, prevents repeated copy-and-paste, and keeps the checklist out of unrelated coding, debugging, and documentation sessions.
In current Claude Code terminology, custom commands have been consolidated into skills. A .claude/skills/review/SKILL.md file creates a /review command, while the legacy .claude/commands/review.md format remains supported. Anthropic recommends skills when users repeatedly supply the same checklist or multi-step procedure; unlike CLAUDE.md content, the skill body is loaded only when invoked or determined relevant. (https://code.claude.com/docs/en/skills)
Option B introduces an isolated agent context when the requirement is primarily to inject a repeatable review procedure. A subagent could be useful for independent verification, but it is not necessary merely to avoid repasting the checklist. Option C bloats every session with instructions that apply only to code review. Option D controls editing permissions and planning behavior; it does not encode review criteria.
The review skill can also pre-authorize read-only tools and accept a pull-request identifier or branch as an argument.
Official references/topics: Claude Code Skills; Custom Slash Commands; On-Demand Instructions; Reusable Review Workflows.
You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution.
Your team has three requirements for Claude Code's behavior in your project:
Claude must never modify files in the db/migrations/ directory.
Claude should prefer your custom logging module over console.log.
All TypeScript files must be auto-formatted with Prettier after every edit.
All three are currently written as instructions in your project's CLAUDE.md. During a complex refactoring session, a developer discovers that Claude edited a migration file, violating requirement #1.
How should you restructure these requirements across Claude Code's configuration mechanisms?
Each requirement belongs in the mechanism matching its enforcement semantics. The migration restriction is a hard safety boundary, so it should be implemented through permissions.deny, not merely expressed as contextual guidance. Anthropic explicitly states that CLAUDE.md content is treated as context rather than enforced configuration. Permission rules use the Tool(specifier) form, evaluate deny rules before ask or allow rules, and support path-based Edit(...) restrictions. (https://code.claude.com/docs/en/memory)
The custom logging convention is a persistent project preference, making CLAUDE.md the appropriate location. It should guide Claude's code-generation decisions but does not require deterministic interception. Prettier formatting, by contrast, is deterministic automation. Anthropic documents the exact pattern of using a PostToolUse hook with an Edit|Write matcher to run Prettier automatically after file modifications. (https://code.claude.com/docs/en/hooks-guide)
Option A incorrectly treats path-scoped rules as a security control; rules remain instructions. Option B overuses hooks for a semantic coding preference that belongs in CLAUDE.md. Option C relies entirely on stronger prompting, which cannot guarantee that protected files remain untouched. Option D correctly separates prohibition, preference, and automatic enforcement.
Official references/topics: Permission rules, CLAUDE.md semantics, PostToolUse formatting hooks.
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
An engineer asks your agent to add comprehensive tests to a legacy codebase with 200 files and minimal existing test coverage. The engineer hasn't specified which modules to prioritize.
How should the agent decompose this open-ended task?
The task is open-ended because neither the critical modules nor the required testing sequence is known in advance. The agent should first use lightweight discovery tools to map the repository, locate existing tests, identify central modules, and determine which components have high fan-in, business significance, complex branching, or extensive external dependencies. It can then produce an initial risk-based testing plan and refine it as new dependency information appears.
Anthropic distinguishes predefined workflows from agents that dynamically control their processes and tool usage. Agents are appropriate when the required steps cannot be reliably hardcoded and must adapt to environmental evidence. During execution, they should obtain ground truth through tool results and use that feedback to determine subsequent actions. (https://www.anthropic.com/research/building-effective-agents) Anthropic also identifies orchestrator-worker designs as suitable for complex coding and search tasks where the necessary subtasks depend on what the investigation reveals. (https://www.anthropic.com/research/building-effective-agents)
Option A assigns effort using directory boundaries rather than risk. Option C exhausts context before delivering value. Option D uses alphabetical order, which has no relationship to impact or coverage priority.
Option B establishes an evidence-driven decomposition: discover, prioritize, test high-impact paths, measure results, and revise the plan as dependencies and uncovered risks emerge.
Official references/topics: Dynamic Task Decomposition; Adaptive Agent Loops; Orchestrator-Workers; Risk-Based Test Planning.
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
After the web-search and document-analysis subagents complete their tasks, the coordinator needs to spawn the synthesis subagent to synthesize the findings.
What is the correct approach for providing the synthesis subagent with the information it needs?
Option B follows the Claude Agent SDK's subagent context model. A normal subagent begins with a fresh context window and does not inherit the parent agent's conversation history or prior tool results. Anthropic's Subagents in the SDK documentation states that the information passed from parent to subagent is the spawning tool's prompt string; required file paths, decisions, errors, or findings must therefore be included in that prompt. In this scenario, the coordinator should supply both agents' relevant findings, source metadata, and explicit synthesis instructions. ''Complete findings'' means the full required result artifacts, not every intermediate search trace. Option C incorrectly assumes automatic context inheritance. Option A introduces callbacks that are neither necessary nor the standard handoff mechanism. Option D can be a valid custom architecture when a shared store has deliberately been implemented, but the question does not establish such infrastructure, and identifiers alone do not give the subagent information. The prompt should use clear sections or structured objects to distinguish web findings, document findings, sources, unresolved conflicts, and expected output. This preserves context isolation while providing everything the synthesis task actually requires.
================
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
After integrating a local MCP server providing code analysis tools (analyze_dependencies, find_dead_code, calculate_complexity), you verify the server is healthy and tools appear in the tools/list response. However, you observe that the agent consistently uses Grep to search for import statements instead of calling analyze_dependencies---even when users explicitly ask about ''code dependencies.'' Examining tool definitions reveals:
MCP analyze_dependencies -- ''Analyzes dependency graph''
Built-in Grep -- ''Search file contents for a pattern using regular expressions. Returns matching lines with line numbers and surrounding context.''
What's the most effective approach to improve the agent's selection of MCP tools?
Claude selects tools principally from their names, descriptions, parameter schemas, and the task context. The current description---''Analyzes dependency graph''---does not explain why the MCP tool is superior to a familiar text search. It omits the tool's scope, the circumstances in which it should be selected, and the structured information it returns.
Anthropic identifies detailed descriptions as the most important factor in tool-use performance. A strong description should state what the tool does, when it should and should not be used, what its parameters mean, and any limitations. Anthropic recommends several sentences for complex tools rather than a short generic label. (https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/implement-tool-use) The MCP connector guidance likewise states that Claude selects among available tools using their names and descriptions and that clear, specific descriptions improve selection accuracy. (https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector)
Option B makes the functional distinction explicit: Grep locates textual import statements, whereas analyze_dependencies constructs a semantic graph containing direct and transitive dependencies, cycles, and potentially unresolved references. Option A is a brittle global override. Option C removes a generally useful tool. Option D increases the number of tools and selection ambiguity, contrary to Anthropic's recommendation to consolidate related operations where practical.
Official references/topics: MCP Tool Discovery; Tool Descriptions; Tool Selection Accuracy; Tool-Surface Design.
Valentina Fedorov
19 days agoJohn Carter
30 days agoGeeta Reddy
2 months agoHarsh Mishra
2 months agoDivya Tiwari
3 months ago