blob: a846803b5b756d9a8d985a9a811227f42e3f3683 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001httprr trace v1
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -070029271 1795
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 Snyder78520f52025-04-30 06:16:08 -07006Content-Length: 9074
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",
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 Snyder78520f52025-04-30 06:16:08 -0700100 "description": "A concise, descriptive title summarizing what this conversation is about"
101 },
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 {
190 "name": "patch",
191 "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",
192 "input_schema": {
193 "type": "object",
194 "required": [
195 "path",
196 "patches"
197 ],
198 "properties": {
199 "path": {
200 "type": "string",
201 "description": "Absolute path to the file to patch"
202 },
203 "patches": {
204 "type": "array",
205 "description": "List of patch requests to apply",
206 "items": {
207 "type": "object",
208 "required": [
209 "operation",
210 "newText"
211 ],
212 "properties": {
213 "operation": {
214 "type": "string",
215 "enum": [
216 "replace",
217 "append_eof",
218 "prepend_bof",
219 "overwrite"
220 ],
221 "description": "Type of operation to perform"
222 },
223 "oldText": {
224 "type": "string",
225 "description": "Text to locate for the operation (must be unique in file, required for replace)"
226 },
227 "newText": {
228 "type": "string",
229 "description": "The new text to use (empty for deletions)"
230 }
231 }
232 }
233 }
234 }
235 }
236 }
237 ],
238 "system": [
239 {
Josh Bleecher Snyderdbe02302025-04-29 16:44:23 -0700240 "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 -0700241 "type": "text",
242 "cache_control": {
243 "type": "ephemeral"
244 }
245 }
246 ]
247}HTTP/2.0 200 OK
248Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
249Anthropic-Ratelimit-Input-Tokens-Limit: 200000
250Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700251Anthropic-Ratelimit-Input-Tokens-Reset: 2025-04-30T13:14:12Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700252Anthropic-Ratelimit-Output-Tokens-Limit: 80000
253Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700254Anthropic-Ratelimit-Output-Tokens-Reset: 2025-04-30T13:14:14Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700255Anthropic-Ratelimit-Requests-Limit: 4000
256Anthropic-Ratelimit-Requests-Remaining: 3999
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700257Anthropic-Ratelimit-Requests-Reset: 2025-04-30T13:14:07Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700258Anthropic-Ratelimit-Tokens-Limit: 280000
259Anthropic-Ratelimit-Tokens-Remaining: 280000
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700260Anthropic-Ratelimit-Tokens-Reset: 2025-04-30T13:14:12Z
Earl Lee2e463fb2025-04-17 11:22:22 -0700261Cf-Cache-Status: DYNAMIC
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700262Cf-Ray: 93874ce69ec8ebe4-SJC
Earl Lee2e463fb2025-04-17 11:22:22 -0700263Content-Type: application/json
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700264Date: Wed, 30 Apr 2025 13:14:14 GMT
265Request-Id: req_011CNeydDVsWFfpe8jTmFBYK
Earl Lee2e463fb2025-04-17 11:22:22 -0700266Server: cloudflare
267Via: 1.1 google
268X-Robots-Tag: none
269
Josh Bleecher Snyder78520f52025-04-30 06:16:08 -0700270{"id":"msg_01Ax6kNduzKv6n5goSVxmmiL","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Based on your request, I'll list the tools available to me:\n\n1. bash - Execute shell commands\n2. keyword_search - Search for files and code based on keywords\n3. think - Record thoughts and plans without external effects\n4. title - Set conversation title and create git branch\n5. done - Mark task as complete with checklist verification\n6. codereview - Run automated code review\n7. patch - File modification tool for precise text edits\n\nThese tools help me assist you with coding tasks, particularly in Go development. How would you like me to help you today?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":2241,"cache_read_input_tokens":0,"output_tokens":127}}