blob: 350a946b30edb50f7e2b0529e57699a4a0c32cf8 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001httprr trace v1
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -070029067 1738
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 Snyderdbe02302025-04-29 16:44:23 -07006Content-Length: 8870
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",
54 "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- Include extensive but uncommon keywords to ensure comprehensive results\n- Order keywords by importance (most important first) - less important keywords may be dropped if there are too many results\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",
55 "input_schema": {
56 "type": "object",
57 "required": [
58 "query",
59 "keywords"
60 ],
61 "properties": {
62 "query": {
63 "type": "string",
64 "description": "A detailed statement of what you're trying to find or learn."
65 },
66 "keywords": {
67 "type": "array",
68 "items": {
69 "type": "string"
70 },
71 "description": "List of keywords in descending order of importance."
72 }
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",
94 "description": "Use this tool early in the conversation, BEFORE MAKING ANY GIT COMMITS, to summarize what the chat is about briefly.",
95 "input_schema": {
96 "type": "object",
97 "properties": {
98 "title": {
99 "type": "string",
100 "description": "A brief title summarizing what this chat is about"
101 }
102 },
103 "required": [
104 "title"
105 ]
106 }
107 },
108 {
109 "name": "done",
110 "description": "Use this tool when you have achieved the user's goal. The parameters form a checklist which you should evaluate.",
111 "input_schema": {
112 "$schema": "http://json-schema.org/draft-07/schema#",
113 "title": "Checklist",
114 "description": "A schema for tracking checklist items with status and comments",
115 "type": "object",
116 "required": [
117 "checklist_items"
118 ],
119 "properties": {
120 "checklist_items": {
121 "type": "object",
122 "description": "Collection of checklist items",
123 "properties": {
124 "wrote_tests": {
125 "$ref": "#/definitions/checklistItem",
126 "description": "If code was changed, tests were written or updated."
127 },
128 "passes_tests": {
129 "$ref": "#/definitions/checklistItem",
130 "description": "If any commits were made, tests pass."
131 },
132 "code_reviewed": {
133 "$ref": "#/definitions/checklistItem",
134 "description": "If any commits were made, the codereview tool was run and its output was addressed."
135 },
136 "git_commit": {
137 "$ref": "#/definitions/checklistItem",
Josh Bleecher Snyder75ec6bb2025-04-24 10:49:16 -0700138 "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 -0700139 }
140 },
141 "additionalProperties": {
142 "$ref": "#/definitions/checklistItem"
143 }
144 }
145 },
146 "definitions": {
147 "checklistItem": {
148 "type": "object",
149 "required": [
150 "status"
151 ],
152 "properties": {
153 "status": {
154 "type": "string",
155 "description": "Current status of the checklist item",
156 "enum": [
157 "yes",
158 "no",
159 "not applicable",
160 "other"
161 ]
162 },
163 "description": {
164 "type": "string",
165 "description": "Description of what this checklist item verifies"
166 },
167 "comments": {
168 "type": "string",
169 "description": "Additional comments or context for this checklist item"
170 }
171 }
172 }
173 }
174 }
175 },
176 {
177 "name": "codereview",
178 "description": "Run an automated code review.",
179 "input_schema": {
Josh Bleecher Snyder2b2090e2025-04-29 16:41:34 -0700180 "type": "object",
181 "properties": {}
Earl Lee2e463fb2025-04-17 11:22:22 -0700182 }
183 },
184 {
185 "name": "patch",
186 "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",
187 "input_schema": {
188 "type": "object",
189 "required": [
190 "path",
191 "patches"
192 ],
193 "properties": {
194 "path": {
195 "type": "string",
196 "description": "Absolute path to the file to patch"
197 },
198 "patches": {
199 "type": "array",
200 "description": "List of patch requests to apply",
201 "items": {
202 "type": "object",
203 "required": [
204 "operation",
205 "newText"
206 ],
207 "properties": {
208 "operation": {
209 "type": "string",
210 "enum": [
211 "replace",
212 "append_eof",
213 "prepend_bof",
214 "overwrite"
215 ],
216 "description": "Type of operation to perform"
217 },
218 "oldText": {
219 "type": "string",
220 "description": "Text to locate for the operation (must be unique in file, required for replace)"
221 },
222 "newText": {
223 "type": "string",
224 "description": "The new text to use (empty for deletions)"
225 }
226 }
227 }
228 }
229 }
230 }
231 }
232 ],
233 "system": [
234 {
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700235 "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 -0700236 "type": "text",
237 "cache_control": {
238 "type": "ephemeral"
239 }
240 }
241 ]
242}HTTP/2.0 200 OK
243Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
244Anthropic-Ratelimit-Input-Tokens-Limit: 200000
245Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700246Anthropic-Ratelimit-Input-Tokens-Reset: 2025-04-29T23:43:53Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700247Anthropic-Ratelimit-Output-Tokens-Limit: 80000
248Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700249Anthropic-Ratelimit-Output-Tokens-Reset: 2025-04-29T23:43:55Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700250Anthropic-Ratelimit-Requests-Limit: 4000
251Anthropic-Ratelimit-Requests-Remaining: 3999
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700252Anthropic-Ratelimit-Requests-Reset: 2025-04-29T23:43:52Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700253Anthropic-Ratelimit-Tokens-Limit: 280000
254Anthropic-Ratelimit-Tokens-Remaining: 280000
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700255Anthropic-Ratelimit-Tokens-Reset: 2025-04-29T23:43:53Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700256Cf-Cache-Status: DYNAMIC
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700257Cf-Ray: 9382aa02de6915c8-SJC
Earl Lee2e463fb2025-04-17 11:22:22 -0700258Content-Type: application/json
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700259Date: Tue, 29 Apr 2025 23:43:55 GMT
260Request-Id: req_011CNduqbZYKv55MjzE4DZWV
Earl Lee2e463fb2025-04-17 11:22:22 -0700261Server: cloudflare
262Via: 1.1 google
263X-Robots-Tag: none
264
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700265{"id":"msg_0182gYvzvKMzDif56xAt1rT3","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here are the tools available to me:\n\n1. bash - Execute shell commands with optional timeout\n2. keyword_search - Find files in a codebase based on keywords\n3. think - Record thoughts and plans (no external effects)\n4. title - Create a brief title for the chat\n5. done - Signal completion with a checklist evaluation \n6. codereview - Run an automated code review\n7. patch - Make precise file modifications\n\nIs there a specific tool you'd like me to explain in more detail or a task you'd like help with?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":0,"cache_read_input_tokens":2196,"output_tokens":123}}