Exam CCAR-F Topic 1 Question 97 Discussion
Actual exam question for Anthropic's CCAR-F exam
Question #: 97
Topic #: 1
Question #: 97
Topic #: 1
You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system runs automated code reviews, generates test cases, and provides feedback on pull requests. You need to design prompts that provide actionable feedback and minimize false positives.
Your automated review calls the Claude API for each pull request, using tool_use with a report_findings tool that returns a JSON array of finding objects. Each object contains file_path, line_number, severity, category, and description. During testing on a large pull request touching more than 30 files, the response reaches the max_tokens limit and is truncated in the middle of the JSON, causing your pipeline's parser to fail.
What is the most effective way to handle this?
Your automated review calls the Claude API for each pull request, using tool_use with a report_findings tool that returns a JSON array of finding objects. Each object contains file_path, line_number, severity, category, and description. During testing on a large pull request touching more than 30 files, the response reaches the max_tokens limit and is truncated in the middle of the JSON, causing your pipeline's parser to fail.
What is the most effective way to handle this?
Suggested Answer: A Vote an answer
Option A is correct because the failure results from excessive output volume, not from JSON or tool use. Anthropic documents that max_tokens is a hard output ceiling and that a response stopped at this limit reports stop_reason: "max_tokens". Its tool-streaming guidance also warns that generation can stop midway through a tool parameter, leaving partial JSON that must not be treated as complete. Splitting the pull request into bounded file groups limits the number of findings produced by each call, preserves the report_findings schema, and allows the pipeline to validate every response independently before merging and deduplicating the arrays. Shared dependency context can still be included when cross-file analysis is required.
by August at Sep 09, 2026, 03:11 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).