blob: 922c12babd0c7813be7eb7a54b1bfd77849481b3 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001httprr trace v1
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700214141 2113
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
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -07006Content-Length: 13943
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 Snyder250348e2025-04-30 10:31:28 -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, filenames, symbols, or package names. Use direct approaches (grep, cat, go doc, 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 {
353 "name": "browser_screenshot",
354 "description": "Take a screenshot of the page or a specific element",
355 "input_schema": {
356 "type": "object",
357 "properties": {
358 "selector": {
359 "type": "string",
360 "description": "CSS selector for the element to screenshot (optional)"
361 },
362 "format": {
363 "type": "string",
364 "description": "Output format ('base64' or 'png'), defaults to 'base64'",
365 "enum": [
366 "base64",
367 "png"
368 ]
369 }
370 }
371 }
372 },
373 {
374 "name": "browser_scroll_into_view",
375 "description": "Scroll an element into view if it's not visible",
376 "input_schema": {
377 "type": "object",
378 "properties": {
379 "selector": {
380 "type": "string",
381 "description": "CSS selector for the element to scroll into view"
382 }
383 },
384 "required": [
385 "selector"
386 ]
387 }
388 },
389 {
Earl Lee2e463fb2025-04-17 11:22:22 -0700390 "name": "patch",
391 "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",
392 "input_schema": {
393 "type": "object",
394 "required": [
395 "path",
396 "patches"
397 ],
398 "properties": {
399 "path": {
400 "type": "string",
401 "description": "Absolute path to the file to patch"
402 },
403 "patches": {
404 "type": "array",
405 "description": "List of patch requests to apply",
406 "items": {
407 "type": "object",
408 "required": [
409 "operation",
410 "newText"
411 ],
412 "properties": {
413 "operation": {
414 "type": "string",
415 "enum": [
416 "replace",
417 "append_eof",
418 "prepend_bof",
419 "overwrite"
420 ],
421 "description": "Type of operation to perform"
422 },
423 "oldText": {
424 "type": "string",
425 "description": "Text to locate for the operation (must be unique in file, required for replace)"
426 },
427 "newText": {
428 "type": "string",
429 "description": "The new text to use (empty for deletions)"
430 }
431 }
432 }
433 }
434 }
435 }
436 }
437 ],
438 "system": [
439 {
Josh Bleecher Snyderb9e62fd2025-05-07 18:34:53 -0700440 "text": "You are an expert coding assistant and architect.\nYou are assisting the user to achieve their goals.\n\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\n\u003cplatform\u003e\nlinux/amd64\n\u003c/platform\u003e\n\u003cpwd\u003e\n/\n\u003c/pwd\u003e\n\u003cgit_root\u003e\n\n\u003c/git_root\u003e\n\u003cHEAD\u003e\n\n\u003c/HEAD\u003e\n",
Earl Lee2e463fb2025-04-17 11:22:22 -0700441 "type": "text",
442 "cache_control": {
443 "type": "ephemeral"
444 }
445 }
446 ]
447}HTTP/2.0 200 OK
448Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
449Anthropic-Ratelimit-Input-Tokens-Limit: 200000
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700450Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
451Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-09T22:31:39Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700452Anthropic-Ratelimit-Output-Tokens-Limit: 80000
453Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700454Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-09T22:31:43Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700455Anthropic-Ratelimit-Requests-Limit: 4000
456Anthropic-Ratelimit-Requests-Remaining: 3999
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700457Anthropic-Ratelimit-Requests-Reset: 2025-05-09T22:31:38Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700458Anthropic-Ratelimit-Tokens-Limit: 280000
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700459Anthropic-Ratelimit-Tokens-Remaining: 280000
460Anthropic-Ratelimit-Tokens-Reset: 2025-05-09T22:31:39Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700461Cf-Cache-Status: DYNAMIC
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700462Cf-Ray: 93d4a5f30d59eb25-SJC
Earl Lee2e463fb2025-04-17 11:22:22 -0700463Content-Type: application/json
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700464Date: Fri, 09 May 2025 22:31:43 GMT
465Request-Id: req_011CNxkRGmJA1oV5QHGCsb33
Earl Lee2e463fb2025-04-17 11:22:22 -0700466Server: cloudflare
Sean McCullough485afc62025-04-28 14:28:39 -0700467Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Earl Lee2e463fb2025-04-17 11:22:22 -0700468Via: 1.1 google
469X-Robots-Tag: none
470
Josh Bleecher Snyderf59df722025-05-09 12:24:03 -0700471{"id":"msg_01Ducpx7QCP6dYEALWPCWx6b","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here's a brief list of the tools available to me:\n\n1. bash - Execute shell commands\n2. keyword_search - Search files for specific terms\n3. think - Record thoughts and plans\n4. title - Set conversation title\n5. precommit - Create a git branch for tracking work\n6. done - Mark task as complete with checklist\n7. codereview - Run automated code review\n8. multiplechoice - Present quick answer options to user\n9. Browser tools:\n - browser_navigate - Navigate to URL\n - browser_click - Click element\n - browser_type - Type text\n - browser_wait_for - Wait for element\n - browser_get_text - Get element text\n - browser_eval - Evaluate JavaScript\n - browser_screenshot - Take screenshot\n - browser_scroll_into_view - Scroll element into view\n10. patch - Make precise text edits to files"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3264,"cache_read_input_tokens":0,"output_tokens":208}}