blob: 2183c46c47e5ee80fd77a6645a7d9b9624317006 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001httprr trace v1
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700210862 1877
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
Sean McCullough485afc62025-04-28 14:28:39 -07006Content-Length: 10664
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",
18 "text": "What tools are available to you? Please just list them briefly.",
19 "cache_control": {
20 "type": "ephemeral"
21 }
22 }
23 ]
24 }
25 ],
26 "max_tokens": 8192,
27 "tools": [
28 {
29 "name": "bash",
Philip Zeyligerb60f0f22025-04-23 18:19:32 +000030 "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.\n\nExecutables pre-installed in this environment include:\n- standard unix tools\n- go\n- git\n- rg\n- jq\n- gopls\n- sqlite\n- fzf\n- gh\n- python3",
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 Snyder78520f52025-04-30 06:16:08 -070094 "description": "Sets the conversation title and creates a git branch for tracking work. MANDATORY: You must use this tool before making any git commits.",
Earl Lee2e463fb2025-04-17 11:22:22 -070095 "input_schema": {
96 "type": "object",
97 "properties": {
98 "title": {
99 "type": "string",
Josh Bleecher Snyder250348e2025-04-30 10:31:28 -0700100 "description": "A concise title summarizing what this conversation is about, imperative tense preferred"
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700101 },
102 "branch_name": {
103 "type": "string",
104 "description": "A 2-3 word alphanumeric hyphenated slug for the git branch name"
Earl Lee2e463fb2025-04-17 11:22:22 -0700105 }
106 },
107 "required": [
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700108 "title",
109 "branch_name"
Earl Lee2e463fb2025-04-17 11:22:22 -0700110 ]
111 }
112 },
113 {
114 "name": "done",
115 "description": "Use this tool when you have achieved the user's goal. The parameters form a checklist which you should evaluate.",
116 "input_schema": {
117 "$schema": "http://json-schema.org/draft-07/schema#",
118 "title": "Checklist",
119 "description": "A schema for tracking checklist items with status and comments",
120 "type": "object",
121 "required": [
122 "checklist_items"
123 ],
124 "properties": {
125 "checklist_items": {
126 "type": "object",
127 "description": "Collection of checklist items",
128 "properties": {
129 "wrote_tests": {
130 "$ref": "#/definitions/checklistItem",
131 "description": "If code was changed, tests were written or updated."
132 },
133 "passes_tests": {
134 "$ref": "#/definitions/checklistItem",
135 "description": "If any commits were made, tests pass."
136 },
137 "code_reviewed": {
138 "$ref": "#/definitions/checklistItem",
139 "description": "If any commits were made, the codereview tool was run and its output was addressed."
140 },
141 "git_commit": {
142 "$ref": "#/definitions/checklistItem",
Josh Bleecher Snyder75ec6bb2025-04-24 10:49:16 -0700143 "description": "Create git commits for any code changes you made. Match the style of recent commit messages. Include 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and the original user prompt. Use GIT_AUTHOR_NAME=\"Test Agent\" GIT_AUTHOR_EMAIL=\"totallyhuman@sketch.dev\" (not git config)."
Earl Lee2e463fb2025-04-17 11:22:22 -0700144 }
145 },
146 "additionalProperties": {
147 "$ref": "#/definitions/checklistItem"
148 }
149 }
150 },
151 "definitions": {
152 "checklistItem": {
153 "type": "object",
154 "required": [
155 "status"
156 ],
157 "properties": {
158 "status": {
159 "type": "string",
160 "description": "Current status of the checklist item",
161 "enum": [
162 "yes",
163 "no",
164 "not applicable",
165 "other"
166 ]
167 },
168 "description": {
169 "type": "string",
170 "description": "Description of what this checklist item verifies"
171 },
172 "comments": {
173 "type": "string",
174 "description": "Additional comments or context for this checklist item"
175 }
176 }
177 }
178 }
179 }
180 },
181 {
182 "name": "codereview",
183 "description": "Run an automated code review.",
184 "input_schema": {
Josh Bleecher Snyder2b2090e2025-04-29 16:41:34 -0700185 "type": "object",
186 "properties": {}
Earl Lee2e463fb2025-04-17 11:22:22 -0700187 }
188 },
189 {
Sean McCullough485afc62025-04-28 14:28:39 -0700190 "name": "multiplechoice",
191 "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.",
192 "input_schema": {
193 "type": "object",
194 "description": "The question and a list of answers you would expect the user to choose from.",
195 "properties": {
196 "question": {
197 "type": "string",
198 "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?'"
199 },
200 "responseOptions": {
201 "type": "array",
202 "description": "The set of possible answers to let the user quickly choose from, e.g. ['Basic unit test coverage', 'Error return values', 'Malformed input'].",
203 "items": {
204 "type": "object",
205 "properties": {
206 "caption": {
207 "type": "string",
208 "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'"
209 },
210 "responseText": {
211 "type": "string",
212 "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'"
213 }
214 },
215 "required": [
216 "caption",
217 "responseText"
218 ]
219 }
220 }
221 },
222 "required": [
223 "question",
224 "responseOptions"
225 ]
226 }
227 },
228 {
Earl Lee2e463fb2025-04-17 11:22:22 -0700229 "name": "patch",
230 "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",
231 "input_schema": {
232 "type": "object",
233 "required": [
234 "path",
235 "patches"
236 ],
237 "properties": {
238 "path": {
239 "type": "string",
240 "description": "Absolute path to the file to patch"
241 },
242 "patches": {
243 "type": "array",
244 "description": "List of patch requests to apply",
245 "items": {
246 "type": "object",
247 "required": [
248 "operation",
249 "newText"
250 ],
251 "properties": {
252 "operation": {
253 "type": "string",
254 "enum": [
255 "replace",
256 "append_eof",
257 "prepend_bof",
258 "overwrite"
259 ],
260 "description": "Type of operation to perform"
261 },
262 "oldText": {
263 "type": "string",
264 "description": "Text to locate for the operation (must be unique in file, required for replace)"
265 },
266 "newText": {
267 "type": "string",
268 "description": "The new text to use (empty for deletions)"
269 }
270 }
271 }
272 }
273 }
274 }
275 }
276 ],
277 "system": [
278 {
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700279 "text": "You are an expert coding assistant and architect, with a specialty in Go.\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.\n\nCall the title tool early in the conversation to provide a brief summary of\nwhat the chat is about.\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\nFor renames or refactors, consider invoking gopls (via bash).\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 -0700280 "type": "text",
281 "cache_control": {
282 "type": "ephemeral"
283 }
284 }
285 ]
286}HTTP/2.0 200 OK
287Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
288Anthropic-Ratelimit-Input-Tokens-Limit: 200000
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700289Anthropic-Ratelimit-Input-Tokens-Remaining: 184000
290Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-05T20:19:43Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700291Anthropic-Ratelimit-Output-Tokens-Limit: 80000
292Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700293Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-05T20:19:41Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700294Anthropic-Ratelimit-Requests-Limit: 4000
295Anthropic-Ratelimit-Requests-Remaining: 3999
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700296Anthropic-Ratelimit-Requests-Reset: 2025-05-05T20:19:37Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700297Anthropic-Ratelimit-Tokens-Limit: 280000
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700298Anthropic-Ratelimit-Tokens-Remaining: 264000
299Anthropic-Ratelimit-Tokens-Reset: 2025-05-05T20:19:41Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700300Cf-Cache-Status: DYNAMIC
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700301Cf-Ray: 93b2ef104988d039-SJC
Earl Lee2e463fb2025-04-17 11:22:22 -0700302Content-Type: application/json
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700303Date: Mon, 05 May 2025 20:19:41 GMT
304Request-Id: req_011CNq17iEhcyfkeYYQUZ5tz
Earl Lee2e463fb2025-04-17 11:22:22 -0700305Server: cloudflare
Sean McCullough485afc62025-04-28 14:28:39 -0700306Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Earl Lee2e463fb2025-04-17 11:22:22 -0700307Via: 1.1 google
308X-Robots-Tag: none
309
Josh Bleecher Snyderc6a2c242025-04-22 18:04:16 -0700310{"id":"msg_01KueCuaHxNHNG92tja2yhpo","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"I have access to the following tools:\n\n1. bash - Execute shell commands\n2. keyword_search - Search for files based on keywords\n3. think - Record thoughts and planning\n4. title - Set conversation title and create git branch\n5. done - Mark task as complete with a checklist\n6. codereview - Run automated code review\n7. multiplechoice - Present multiple choice questions to the user\n8. patch - Make precise edits to files\n\nThese tools allow me to help you with coding, research, file manipulation, and other development tasks, particularly with Go programming language."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":2602,"cache_read_input_tokens":0,"output_tokens":130}}