blob: 512e5d1c3bfc83f6c4096d42ec5f5d361f882a62 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001httprr trace v1
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700214628 2230
Earl Lee2e463fb2025-04-17 11:22:22 -07003POST https://api.anthropic.com/v1/messages HTTP/1.1
4Host: api.anthropic.com
5User-Agent: Go-http-client/1.1
Philip Zeyliger72252cb2025-05-10 17:00:08 -07006Content-Length: 14430
Earl Lee2e463fb2025-04-17 11:22:22 -07007Anthropic-Version: 2023-06-01
8Content-Type: application/json
9
10{
11 "model": "claude-3-7-sonnet-20250219",
12 "messages": [
13 {
14 "role": "user",
15 "content": [
16 {
17 "type": "text",
Josh Bleecher Snyderd2f54c22025-05-07 18:38:07 -070018 "text": "What tools are available to you? Please just list them briefly. (Do not call the title tool.)",
Earl Lee2e463fb2025-04-17 11:22:22 -070019 "cache_control": {
20 "type": "ephemeral"
21 }
22 }
23 ]
24 }
25 ],
26 "max_tokens": 8192,
27 "tools": [
28 {
29 "name": "bash",
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -070030 "description": "Executes a shell command using bash -c with an optional timeout, returning combined stdout and stderr.\nWhen run with background flag, the process may keep running after the tool call returns, and\nthe agent can inspect the output by reading the output files. Use the background task when, for example,\nstarting a server to test something. Be sure to kill the process group when done.",
Earl Lee2e463fb2025-04-17 11:22:22 -070031 "input_schema": {
32 "type": "object",
33 "required": [
34 "command"
35 ],
36 "properties": {
37 "command": {
38 "type": "string",
39 "description": "Shell script to execute"
40 },
41 "timeout": {
42 "type": "string",
Philip Zeyligerb60f0f22025-04-23 18:19:32 +000043 "description": "Timeout as a Go duration string, defaults to 1m if background is false; 10m if background is true"
44 },
45 "background": {
46 "type": "boolean",
47 "description": "If true, executes the command in the background without waiting for completion"
Earl Lee2e463fb2025-04-17 11:22:22 -070048 }
49 }
50 }
51 },
52 {
53 "name": "keyword_search",
Josh Bleecher Snyderdce8d842025-05-09 12:27:19 -070054 "description": "\nkeyword_search locates files with a search-and-filter approach.\nUse when navigating unfamiliar codebases with only conceptual understanding or vague user questions.\n\nEffective use:\n- Provide a detailed query for accurate relevance ranking\n- Prefer MANY SPECIFIC terms over FEW GENERAL ones (high precision beats high recall)\n- Order search terms by importance (most important first)\n- Supports regex search terms for flexible matching\n\nIMPORTANT: Do NOT use this tool if you have precise information like log lines, error messages, stack traces, filenames, or symbols. Use direct approaches (rg, cat, etc.) instead.\n",
Earl Lee2e463fb2025-04-17 11:22:22 -070055 "input_schema": {
56 "type": "object",
57 "required": [
58 "query",
Josh Bleecher Snyder250348e2025-04-30 10:31:28 -070059 "search_terms"
Earl Lee2e463fb2025-04-17 11:22:22 -070060 ],
61 "properties": {
62 "query": {
63 "type": "string",
64 "description": "A detailed statement of what you're trying to find or learn."
65 },
Josh Bleecher Snyder250348e2025-04-30 10:31:28 -070066 "search_terms": {
Earl Lee2e463fb2025-04-17 11:22:22 -070067 "type": "array",
68 "items": {
69 "type": "string"
70 },
Josh Bleecher Snyder250348e2025-04-30 10:31:28 -070071 "description": "List of search terms in descending order of importance."
Earl Lee2e463fb2025-04-17 11:22:22 -070072 }
73 }
74 }
75 },
76 {
77 "name": "think",
78 "description": "Think out loud, take notes, form plans. Has no external effects.",
79 "input_schema": {
80 "type": "object",
81 "required": [
82 "thoughts"
83 ],
84 "properties": {
85 "thoughts": {
86 "type": "string",
87 "description": "The thoughts, notes, or plans to record"
88 }
89 }
90 }
91 },
92 {
93 "name": "title",
Josh Bleecher Snydera2a31502025-05-07 12:37:18 +000094 "description": "Sets the conversation title.",
Earl Lee2e463fb2025-04-17 11:22:22 -070095 "input_schema": {
96 "type": "object",
97 "properties": {
98 "title": {
99 "type": "string",
Josh Bleecher Snydera2a31502025-05-07 12:37:18 +0000100 "description": "Brief title (3-6 words) in imperative tense. Focus on core action/component."
101 }
102 },
103 "required": [
104 "title"
105 ]
106 }
107 },
108 {
109 "name": "precommit",
Josh Bleecher Snyder6aaf6af2025-05-07 20:47:13 +0000110 "description": "Creates a git branch for tracking work and provides git commit message style guidance. MANDATORY: You must use this tool before making any git commits.",
Josh Bleecher Snydera2a31502025-05-07 12:37:18 +0000111 "input_schema": {
112 "type": "object",
113 "properties": {
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700114 "branch_name": {
115 "type": "string",
116 "description": "A 2-3 word alphanumeric hyphenated slug for the git branch name"
Earl Lee2e463fb2025-04-17 11:22:22 -0700117 }
118 },
119 "required": [
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700120 "branch_name"
Earl Lee2e463fb2025-04-17 11:22:22 -0700121 ]
122 }
123 },
124 {
125 "name": "done",
126 "description": "Use this tool when you have achieved the user's goal. The parameters form a checklist which you should evaluate.",
127 "input_schema": {
128 "$schema": "http://json-schema.org/draft-07/schema#",
129 "title": "Checklist",
130 "description": "A schema for tracking checklist items with status and comments",
131 "type": "object",
132 "required": [
133 "checklist_items"
134 ],
135 "properties": {
136 "checklist_items": {
137 "type": "object",
138 "description": "Collection of checklist items",
139 "properties": {
140 "wrote_tests": {
141 "$ref": "#/definitions/checklistItem",
142 "description": "If code was changed, tests were written or updated."
143 },
144 "passes_tests": {
145 "$ref": "#/definitions/checklistItem",
146 "description": "If any commits were made, tests pass."
147 },
148 "code_reviewed": {
149 "$ref": "#/definitions/checklistItem",
150 "description": "If any commits were made, the codereview tool was run and its output was addressed."
151 },
152 "git_commit": {
153 "$ref": "#/definitions/checklistItem",
Josh Bleecher Snyder93202652025-05-08 02:05:57 +0000154 "description": "Create git commits for any code changes you made, adding --trailer 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and --trailer 'Change-ID: s$(openssl rand -hex 8)k'. The git user is already configured correctly."
Earl Lee2e463fb2025-04-17 11:22:22 -0700155 }
156 },
157 "additionalProperties": {
158 "$ref": "#/definitions/checklistItem"
159 }
160 }
161 },
162 "definitions": {
163 "checklistItem": {
164 "type": "object",
165 "required": [
166 "status"
167 ],
168 "properties": {
169 "status": {
170 "type": "string",
171 "description": "Current status of the checklist item",
172 "enum": [
173 "yes",
174 "no",
175 "not applicable",
176 "other"
177 ]
178 },
179 "description": {
180 "type": "string",
181 "description": "Description of what this checklist item verifies"
182 },
183 "comments": {
184 "type": "string",
185 "description": "Additional comments or context for this checklist item"
186 }
187 }
188 }
189 }
190 }
191 },
192 {
193 "name": "codereview",
194 "description": "Run an automated code review.",
195 "input_schema": {
Josh Bleecher Snyder2b2090e2025-04-29 16:41:34 -0700196 "type": "object",
197 "properties": {}
Earl Lee2e463fb2025-04-17 11:22:22 -0700198 }
199 },
200 {
Sean McCullough485afc62025-04-28 14:28:39 -0700201 "name": "multiplechoice",
202 "description": "Present the user with an quick way to answer to your question using one of a short list of possible answers you would expect from the user.",
203 "input_schema": {
204 "type": "object",
205 "description": "The question and a list of answers you would expect the user to choose from.",
206 "properties": {
207 "question": {
208 "type": "string",
209 "description": "The text of the multiple-choice question you would like the user, e.g. 'What kinds of test cases would you like me to add?'"
210 },
211 "responseOptions": {
212 "type": "array",
213 "description": "The set of possible answers to let the user quickly choose from, e.g. ['Basic unit test coverage', 'Error return values', 'Malformed input'].",
214 "items": {
215 "type": "object",
216 "properties": {
217 "caption": {
218 "type": "string",
219 "description": "The caption, e.g. 'Basic coverage', 'Error return values', or 'Malformed input' for the response button. Do NOT include options for responses that would end the conversation like 'Ok', 'No thank you', 'This looks good'"
220 },
221 "responseText": {
222 "type": "string",
223 "description": "The full text of the response, e.g. 'Add unit tests for basic test coverage', 'Add unit tests for error return values', or 'Add unit tests for malformed input'"
224 }
225 },
226 "required": [
227 "caption",
228 "responseText"
229 ]
230 }
231 }
232 },
233 "required": [
234 "question",
235 "responseOptions"
236 ]
237 }
238 },
239 {
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000240 "name": "browser_navigate",
241 "description": "Navigate the browser to a specific URL and wait for page to load",
242 "input_schema": {
243 "type": "object",
244 "properties": {
245 "url": {
246 "type": "string",
247 "description": "The URL to navigate to"
248 }
249 },
250 "required": [
251 "url"
252 ]
253 }
254 },
255 {
256 "name": "browser_click",
257 "description": "Click the first element matching a CSS selector",
258 "input_schema": {
259 "type": "object",
260 "properties": {
261 "selector": {
262 "type": "string",
263 "description": "CSS selector for the element to click"
264 },
265 "wait_visible": {
266 "type": "boolean",
267 "description": "Wait for the element to be visible before clicking"
268 }
269 },
270 "required": [
271 "selector"
272 ]
273 }
274 },
275 {
276 "name": "browser_type",
277 "description": "Type text into an input or textarea element",
278 "input_schema": {
279 "type": "object",
280 "properties": {
281 "selector": {
282 "type": "string",
283 "description": "CSS selector for the input element"
284 },
285 "text": {
286 "type": "string",
287 "description": "Text to type into the element"
288 },
289 "clear": {
290 "type": "boolean",
291 "description": "Clear the input field before typing"
292 }
293 },
294 "required": [
295 "selector",
296 "text"
297 ]
298 }
299 },
300 {
301 "name": "browser_wait_for",
302 "description": "Wait for an element to be present in the DOM",
303 "input_schema": {
304 "type": "object",
305 "properties": {
306 "selector": {
307 "type": "string",
308 "description": "CSS selector for the element to wait for"
309 },
310 "timeout_ms": {
311 "type": "integer",
312 "description": "Maximum time to wait in milliseconds (default: 30000)"
313 }
314 },
315 "required": [
316 "selector"
317 ]
318 }
319 },
320 {
321 "name": "browser_get_text",
322 "description": "Get the innerText of an element",
323 "input_schema": {
324 "type": "object",
325 "properties": {
326 "selector": {
327 "type": "string",
328 "description": "CSS selector for the element to get text from"
329 }
330 },
331 "required": [
332 "selector"
333 ]
334 }
335 },
336 {
337 "name": "browser_eval",
338 "description": "Evaluate JavaScript in the browser context",
339 "input_schema": {
340 "type": "object",
341 "properties": {
342 "expression": {
343 "type": "string",
344 "description": "JavaScript expression to evaluate"
345 }
346 },
347 "required": [
348 "expression"
349 ]
350 }
351 },
352 {
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700353 "name": "browser_scroll_into_view",
354 "description": "Scroll an element into view if it's not visible",
355 "input_schema": {
356 "type": "object",
357 "properties": {
358 "selector": {
359 "type": "string",
360 "description": "CSS selector for the element to scroll into view"
361 }
362 },
363 "required": [
364 "selector"
365 ]
366 }
367 },
368 {
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000369 "name": "browser_screenshot",
370 "description": "Take a screenshot of the page or a specific element",
371 "input_schema": {
372 "type": "object",
373 "properties": {
374 "selector": {
375 "type": "string",
376 "description": "CSS selector for the element to screenshot (optional)"
377 },
378 "format": {
379 "type": "string",
380 "description": "Output format ('base64' or 'png'), defaults to 'base64'",
381 "enum": [
382 "base64",
383 "png"
384 ]
385 }
386 }
387 }
388 },
389 {
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700390 "name": "browser_read_image",
391 "description": "Read an image file (such as a screenshot) and encode it for sending to the LLM",
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000392 "input_schema": {
393 "type": "object",
394 "properties": {
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700395 "path": {
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000396 "type": "string",
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700397 "description": "Path to the image file to read"
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000398 }
399 },
400 "required": [
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700401 "path"
Philip Zeyliger33d282f2025-05-03 04:01:54 +0000402 ]
403 }
404 },
405 {
Earl Lee2e463fb2025-04-17 11:22:22 -0700406 "name": "patch",
407 "description": "File modification tool for precise text edits.\n\nOperations:\n- replace: Substitute text with new content\n- append_eof: Append new text at the end of the file\n- prepend_bof: Insert new text at the beginning of the file\n- overwrite: Replace the entire file with new content (automatically creates the file)\n\nUsage notes:\n- All inputs are interpreted literally (no automatic newline or whitespace handling)\n- For replace operations, oldText must appear EXACTLY ONCE in the file",
408 "input_schema": {
409 "type": "object",
410 "required": [
411 "path",
412 "patches"
413 ],
414 "properties": {
415 "path": {
416 "type": "string",
417 "description": "Absolute path to the file to patch"
418 },
419 "patches": {
420 "type": "array",
421 "description": "List of patch requests to apply",
422 "items": {
423 "type": "object",
424 "required": [
425 "operation",
426 "newText"
427 ],
428 "properties": {
429 "operation": {
430 "type": "string",
431 "enum": [
432 "replace",
433 "append_eof",
434 "prepend_bof",
435 "overwrite"
436 ],
437 "description": "Type of operation to perform"
438 },
439 "oldText": {
440 "type": "string",
441 "description": "Text to locate for the operation (must be unique in file, required for replace)"
442 },
443 "newText": {
444 "type": "string",
445 "description": "The new text to use (empty for deletions)"
446 }
447 }
448 }
449 }
450 }
451 }
452 }
453 ],
454 "system": [
455 {
Josh Bleecher Snydera997be62025-05-07 22:52:46 +0000456 "text": "You are an expert coding assistant and architect.\nYou are assisting the user to achieve their goals.\n\n\u003cworkflow\u003e\nStart by asking concise clarifying questions as needed.\nOnce the intent is clear, work autonomously.\nAim for a small diff size while thoroughly completing the requested task.\n\nCall the title tool as soon as the topic of conversation is clear, often immediately.\n\nBreak down the overall goal into a series of smaller steps.\n(The first step is often: \"Make a plan.\")\nThen execute each step using tools.\nUpdate the plan if you have encountered problems or learned new information.\n\nWhen in doubt about a step, follow this broad workflow:\n\n- Think about how the current step fits into the overall plan.\n- Do research. Good tool choices: bash, think, keyword_search\n- Make edits.\n- Repeat.\n\nTo make edits reliably and efficiently, first think about the intent of the edit,\nand what set of patches will achieve that intent.\nThen use the patch tool to make those edits. Combine all edits to any given file into a single patch tool call.\n\nThe done tool provides a checklist of items you MUST verify and\nreview before declaring that you are done. Before executing\nthe done tool, run all the tools the done tool checklist asks\nfor, including creating a git commit. Do not forget to run tests.\n\u003c/workflow\u003e\n\n\u003csystem_info\u003e\n\u003cplatform\u003e\nlinux/amd64\n\u003c/platform\u003e\n\u003cpwd\u003e\n/\n\u003c/pwd\u003e\n\u003c/system_info\u003e\n\n\u003cgit_info\u003e\n\u003cgit_root\u003e\n\n\u003c/git_root\u003e\n\u003cHEAD\u003e\n\n\u003c/HEAD\u003e\n\u003c/git_info\u003e\n\n",
Earl Lee2e463fb2025-04-17 11:22:22 -0700457 "type": "text",
458 "cache_control": {
459 "type": "ephemeral"
460 }
461 }
462 ]
463}HTTP/2.0 200 OK
464Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
465Anthropic-Ratelimit-Input-Tokens-Limit: 200000
Josh Bleecher Snydera997be62025-05-07 22:52:46 +0000466Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700467Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-10T13:34:48Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700468Anthropic-Ratelimit-Output-Tokens-Limit: 80000
469Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700470Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-10T13:34:52Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700471Anthropic-Ratelimit-Requests-Limit: 4000
472Anthropic-Ratelimit-Requests-Remaining: 3999
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700473Anthropic-Ratelimit-Requests-Reset: 2025-05-10T13:34:47Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700474Anthropic-Ratelimit-Tokens-Limit: 280000
Josh Bleecher Snydera997be62025-05-07 22:52:46 +0000475Anthropic-Ratelimit-Tokens-Remaining: 280000
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700476Anthropic-Ratelimit-Tokens-Reset: 2025-05-10T13:34:48Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700477Cf-Cache-Status: DYNAMIC
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700478Cf-Ray: 93d9d0e80caa67fe-SJC
Earl Lee2e463fb2025-04-17 11:22:22 -0700479Content-Type: application/json
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700480Date: Sat, 10 May 2025 13:34:52 GMT
481Request-Id: req_011CNywHj3Qrj3hEz9qFRVgK
Earl Lee2e463fb2025-04-17 11:22:22 -0700482Server: cloudflare
Sean McCullough485afc62025-04-28 14:28:39 -0700483Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Earl Lee2e463fb2025-04-17 11:22:22 -0700484Via: 1.1 google
485X-Robots-Tag: none
486
Philip Zeyliger72252cb2025-05-10 17:00:08 -0700487{"id":"msg_014KGRNEmFdTUGqDQN7sRmzc","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here are the tools available to me:\n\n1. bash - Executes shell commands\n2. keyword_search - Searches files with given keywords\n3. think - For recording thoughts, notes, and plans\n4. title - Sets conversation title\n5. precommit - Creates git branches and provides commit message guidance\n6. done - Marks task completion with a checklist\n7. codereview - Runs automated code review\n8. multiplechoice - Presents multiple choice options to the user\n9. Browser tools:\n - browser_navigate - Opens a URL\n - browser_click - Clicks elements\n - browser_type - Types text into elements\n - browser_wait_for - Waits for elements\n - browser_get_text - Gets text from elements\n - browser_eval - Runs JavaScript in browser\n - browser_scroll_into_view - Scrolls to elements\n - browser_screenshot - Takes screenshots\n - browser_read_image - Reads image files\n10. patch - Makes precise text modifications to files"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3376,"cache_read_input_tokens":0,"output_tokens":236}}