Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/claude-quickstarts
/ functions
Functions
710 in github.com/anthropics/claude-quickstarts
⨍
Functions
710
◇
Types & classes
123
↳
Endpoints
40
↓ 36 callers
Function
cn
(...inputs: ClassValue[])
financial-data-analyst/lib/utils.ts:4
↓ 27 callers
Function
cn
(...inputs: ClassValue[])
customer-support-agent/lib/utils.ts:4
↓ 26 callers
Method
execute
(self, *, a: str, **_: Any)
computer-use-best-practices/tests/test_base.py:20
↓ 26 callers
Method
render
Render a message in the chat interface. Args: sender: The sender type (USER, BOT, or TOOL) message: The message conte
browser-use-demo/browser_use_demo/message_renderer.py:79
↓ 19 callers
Method
render_conversation_history
Render all messages in conversation history. This method processes a list of messages and renders each one according to its role and
browser-use-demo/browser_use_demo/message_renderer.py:213
↓ 18 callers
Method
_print
Print message if verbose mode is on.
agents/test_message_params.py:30
↓ 18 callers
Function
edit_tool
()
computer-use-demo/tests/tools/edit_test.py:11
↓ 17 callers
Method
run
Run agent synchronously
agents/agent.py:171
↓ 14 callers
Function
_coerce
Best-effort coercion of string values (from env/toml/--set) to the declared field type. Non-string values (e.g. from TOML) pass through.
computer-use-best-practices/constants.py:232
↓ 14 callers
Method
replace
Returns a new ToolResult with the given fields replaced.
computer-use-demo/computer_use_demo/tools/base.py:52
↓ 14 callers
Method
scale_coordinates
Scale coordinates to a target maximum resolution.
computer-use-demo/computer_use_demo/tools/computer.py:268
↓ 13 callers
Function
setup_state
Initialize session state variables.
browser-use-demo/browser_use_demo/streamlit.py:60
↓ 12 callers
Method
_rel
(self, p: Path)
computer-use-best-practices/computer_use/tools/editor.py:167
↓ 12 callers
Method
shell
Run a shell command and return the output, error, and optionally a screenshot.
computer-use-demo/computer_use_demo/tools/computer.py:256
↓ 12 callers
Method
with_overrides
(self, **overrides: Any)
computer-use-best-practices/constants.py:224
↓ 11 callers
Function
bash_tool
(request)
computer-use-demo/tests/tools/bash_test.py:7
↓ 11 callers
Method
screenshot
Take a screenshot of the current screen and return the base64 encoded image.
computer-use-demo/computer_use_demo/tools/computer.py:228
↓ 10 callers
Function
get_or_create_event_loop
Get existing event loop or create a new one if needed. This function ensures we have a valid event loop for async operations, reusing existin
browser-use-demo/browser_use_demo/streamlit.py:426
↓ 9 callers
Function
_msgs
(n: int)
computer-use-best-practices/tests/test_formatters.py:16
↓ 9 callers
Function
_translate_key
(k: str)
computer-use-best-practices/computer_use/tools/computer.py:91
↓ 9 callers
Method
run
Execute a command in the bash shell.
computer-use-demo/computer_use_demo/tools/bash.py:47
↓ 9 callers
Function
target_image_size
Largest (w, h) preserving aspect ratio with long-edge <= max_edge_px and tile-count <= max_tokens. Returns the input unchanged if already val
computer-use-best-practices/computer_use/image.py:38
↓ 9 callers
Method
to_api_content
Render as a list of tool_result content blocks.
computer-use-best-practices/computer_use/tools/result.py:49
↓ 8 callers
Function
_to_playwright_chord
Normalize a model-emitted chord like 'ctrl+shift+a' to Playwright's 'Control+Shift+a'. Unknown segments pass through unchanged.
computer-use-best-practices/computer_use/tools/browser.py:63
↓ 8 callers
Function
logDuration
(label: string, duration: number)
customer-support-agent/components/ChatArea.tsx:398
↓ 8 callers
Method
replace
Returns a new ToolResult with the given fields replaced.
browser-use-demo/browser_use_demo/tools/base.py:52
↓ 8 callers
Function
resize_and_encode
Resize `img` to its target size (no-op if already within budget), encode as JPEG, and return (base64_string, (sent_width, sent_height)).
computer-use-best-practices/computer_use/image.py:78
↓ 7 callers
Method
_at
Format a coordinate for tool output. Echoes the *image-space* values the model sent (not the scaled screen pixels) so the model sees its own
computer-use-best-practices/computer_use/tools/computer.py:222
↓ 7 callers
Function
_effort_kwargs
Translate an effort level into messages.stream() kwargs. Raises if the model does not support output_config.effort and effort is not "off".
computer-use-best-practices/computer_use/loop.py:201
↓ 7 callers
Method
_execute_js_from_file
Load and execute JavaScript from a file.
browser-use-demo/browser_use_demo/tools/browser.py:323
↓ 7 callers
Function
_unmapped_keys
Return any keys that pyautogui's macOS backend has no keycode for.
computer-use-best-practices/computer_use/tools/computer.py:84
↓ 7 callers
Function
measureTime
(label: string)
customer-support-agent/app/api/chat/route.ts:66
↓ 7 callers
Method
run
(self, name: str, tool_input: object)
computer-use-best-practices/computer_use/tools/base.py:99
↓ 7 callers
Method
validate_path
Check that the path/command combination is valid.
computer-use-demo/computer_use_demo/tools/edit.py:87
↓ 6 callers
Method
_normalize_content
Convert content to list for uniform processing. This eliminates duplicate code for handling list vs non-list content. Args:
browser-use-demo/browser_use_demo/message_renderer.py:287
↓ 6 callers
Method
_scale_coordinates
Apply auto-scaling to coordinates using the CoordinateScaler. Claude's vision model interprets images at a different resolution than
browser-use-demo/browser_use_demo/tools/browser.py:416
↓ 6 callers
Method
_scale_to_screen
(self, coord: list[int])
computer-use-best-practices/computer_use/tools/computer.py:207
↓ 6 callers
Function
_surviving
(msgs: list[MessageParam])
computer-use-best-practices/tests/test_formatters.py:41
↓ 6 callers
Method
_take_screenshot
Take a visual screenshot of the current page. NOTE: This only returns an image, not text content. Use read_page or get_page_t
browser-use-demo/browser_use_demo/tools/browser.py:352
↓ 6 callers
Function
computer_tool
(request)
computer-use-demo/tests/tools/computer_test.py:15
↓ 6 callers
Function
toast
({ ...props }: Toast)
financial-data-analyst/hooks/use-toast.ts:145
↓ 5 callers
Function
_render_message
Convert input from the user or output from the agent to a streamlit message.
computer-use-demo/computer_use_demo/streamlit.py:599
↓ 5 callers
Function
_set_trailing_cache_control
Put cache breakpoints on the last few cacheable blocks (`tool_result` in a user turn, or `compaction` in an assistant turn). Clears any breakpoint
computer-use-best-practices/computer_use/loop.py:66
↓ 5 callers
Function
_truncate_to_last_compaction
Drop everything before the most recent assistant message that contains a `compaction` block. The server does this drop anyway when it sees the
computer-use-best-practices/computer_use/loop.py:137
↓ 5 callers
Method
_zoom
(self, region: list[int] | None)
computer-use-best-practices/computer_use/tools/computer.py:364
↓ 5 callers
Function
api_response_callback
Handle API responses.
browser-use-demo/browser_use_demo/streamlit.py:482
↓ 5 callers
Function
authenticate
Handle API key authentication.
browser-use-demo/browser_use_demo/streamlit.py:417
↓ 5 callers
Method
close
Release any resources held by tools (e.g. the Playwright browser). Safe to call multiple times; individual tool failures are swallowed so
computer-use-best-practices/computer_use/tools/base.py:89
↓ 5 callers
Function
dispatch
(action: Action)
financial-data-analyst/hooks/use-toast.ts:136
↓ 5 callers
Method
load
Build a Config from defaults -> toml -> CU_* env vars -> overrides.
computer-use-best-practices/constants.py:182
↓ 5 callers
Method
record
(self, role: str, content: Any)
computer-use-best-practices/computer_use/trajectory.py:57
↓ 5 callers
Function
sampling_loop
Sampling loop for browser automation. Args: browser_tool: Optional persistent browser tool instance. If not provided, creates a new
browser-use-demo/browser_use_demo/loop.py:66
↓ 5 callers
Method
start
(self)
computer-use-demo/computer_use_demo/tools/bash.py:23
↓ 5 callers
Method
stop
Terminate the bash shell.
computer-use-demo/computer_use_demo/tools/bash.py:39
↓ 5 callers
Method
validate_and_get_coordinates
(self, coordinate: tuple[int, int] | None = None)
computer-use-demo/computer_use_demo/tools/computer.py:220
↓ 4 callers
Function
_format_usage
(usage: Any, elapsed: float)
computer-use-best-practices/computer_use/loop.py:116
↓ 4 callers
Function
_image_slots
Return (container, index) for every image block inside tool_result content, in document order, so callers can replace them in place.
computer-use-best-practices/computer_use/formatters.py:23
↓ 4 callers
Function
_img
()
computer-use-best-practices/tests/test_loop.py:17
↓ 4 callers
Function
_inner_contents
Return each tool_result's inner content list, in document order.
computer-use-best-practices/tests/test_formatters.py:26
↓ 4 callers
Function
_is_empty_response
(content: list[Any])
computer-use-best-practices/computer_use/loop.py:195
↓ 4 callers
Function
_is_recoverable
(e: Exception)
computer-use-best-practices/computer_use/loop.py:92
↓ 4 callers
Function
_override
Patch cfg to pure dataclass defaults plus the given overrides, ignoring whatever the local .env / CU_* environment may have set.
computer-use-best-practices/tests/test_build_tools.py:11
↓ 4 callers
Method
_prepare_message_params
Prepare parameters for client.messages.create() call. Returns a dict with base parameters from config, with any message_param
agents/agent.py:80
↓ 4 callers
Function
_truncate
(s: str, n: int = _TRUNCATE_AT)
computer-use-best-practices/computer_use/render.py:23
↓ 4 callers
Method
_type_text
Type text into the focused element.
browser-use-demo/browser_use_demo/tools/browser.py:558
↓ 4 callers
Function
_valid
(w: int, h: int)
computer-use-best-practices/tests/test_image.py:15
↓ 4 callers
Method
ensure_message_integrity
Validate that messages maintain proper structure. Args: messages: The message list to validate Returns:
browser-use-demo/browser_use_demo/message_handler.py:233
↓ 4 callers
Method
execute
(self, *, action: str, **_: Any)
computer-use-best-practices/tests/test_batch.py:18
↓ 4 callers
Method
insert
Implement the insert command, which inserts new_str at the specified line in the file content.
computer-use-demo/computer_use_demo/tools/edit.py:208
↓ 4 callers
Method
process_response
Process an API response into a structured format. Args: response: The API response from Anthropic Returns:
browser-use-demo/browser_use_demo/message_handler.py:42
↓ 4 callers
Method
to_params
(self, *, hosted_computer: bool = False)
computer-use-best-practices/computer_use/tools/base.py:79
↓ 3 callers
Method
__init__
(self, inner: Tool)
computer-use-best-practices/computer_use/tools/batch.py:66
↓ 3 callers
Function
_batch_description
(inner_name: str)
computer-use-best-practices/computer_use/tools/batch.py:44
↓ 3 callers
Function
_batch_schema
(inner_schema: dict[str, Any])
computer-use-best-practices/computer_use/tools/batch.py:53
↓ 3 callers
Method
_build_tool_result
Build a tool result block from a ToolResult. Args: result: The tool execution result tool_use_id: The ID of
browser-use-demo/browser_use_demo/message_handler.py:134
↓ 3 callers
Function
_call_with_retry
Exponential-backoff retry for recoverable API errors.
computer-use-best-practices/computer_use/loop.py:102
↓ 3 callers
Function
_clean_text_extraction_markers
Remove text extraction markers and return a summary.
browser-use-demo/browser_use_demo/streamlit.py:98
↓ 3 callers
Method
_make_output
Generate output for the CLI based on the content of a file.
computer-use-demo/computer_use_demo/tools/edit.py:261
↓ 3 callers
Function
_msgs
()
computer-use-best-practices/tests/test_compaction.py:9
↓ 3 callers
Function
_names
()
computer-use-best-practices/tests/test_build_tools.py:7
↓ 3 callers
Function
_probe
Load a system framework and call a zero-arg bool-returning C function. Returns True on any load/call failure so an unknown environment doesn't blo
computer-use-best-practices/computer_use/preflight.py:49
↓ 3 callers
Function
_run_loop_and_get_request_kwargs
Drive sampling_loop through a single no-tool-use turn and return the kwargs passed to messages.create.
computer-use-demo/tests/loop_test.py:71
↓ 3 callers
Method
add_assistant_message
Add a complete assistant message with all content blocks. Args: messages: The message list to append to cont
browser-use-demo/browser_use_demo/message_handler.py:197
↓ 3 callers
Method
add_message
Add a message to the history and track token usage.
agents/utils/history_util.py:44
↓ 3 callers
Method
add_tool_results
Add tool results as a user message. Args: messages: The message list to append to tool_results: The tool res
browser-use-demo/browser_use_demo/message_handler.py:215
↓ 3 callers
Function
applyTheme
(newColorTheme: ThemeName, isDark: boolean)
customer-support-agent/components/TopNavBar.tsx:60
↓ 3 callers
Method
execute_tools
Execute tools and collect results. Args: tool_uses: List of tool use blocks to execute tool_collection: The
browser-use-demo/browser_use_demo/message_handler.py:82
↓ 3 callers
Function
extract_commands
Extract command names from a shell command string. Handles pipes, command chaining (&&, ||, ;), and subshells. Returns the base command
autonomous-coding/security.py:77
↓ 3 callers
Method
extract_text_from_message
Extract text content from a message. Args: message: The message to extract text from Returns: The e
browser-use-demo/browser_use_demo/message_handler.py:263
↓ 3 callers
Function
getCleanName
(element)
browser-use-demo/browser_use_demo/browser_tool_utils/browser_dom_script.js:71
↓ 3 callers
Function
getPayloadConfigFromPayload
( config: ChartConfig, payload: unknown, key: string )
financial-data-analyst/components/ui/chart.tsx:325
↓ 3 callers
Function
handleModeChange
(mode: "light" | "dark" | "system")
customer-support-agent/components/TopNavBar.tsx:77
↓ 3 callers
Function
maybe_truncate
Truncate content and append a notice if content exceeds the specified length.
computer-use-demo/computer_use_demo/tools/run.py:9
↓ 3 callers
Function
n_tokens_for_img
(w: int, h: int, px_per_token: int = cfg.px_per_token)
computer-use-best-practices/computer_use/image.py:34
↓ 3 callers
Function
print_progress_summary
Print a summary of current progress.
autonomous-coding/progress.py:49
↓ 3 callers
Method
read_file
Read the content of a file from a given path; raise a ToolError if an error occurs.
computer-use-demo/computer_use_demo/tools/edit.py:247
↓ 3 callers
Function
run
Run a shell command asynchronously with a timeout.
computer-use-demo/computer_use_demo/tools/run.py:18
↓ 3 callers
Function
sampling_loop
Agentic sampling loop for the assistant/tool interaction of computer use.
computer-use-demo/computer_use_demo/loop.py:81
↓ 3 callers
Function
sanitizeHeaderValue
(value: string)
customer-support-agent/app/api/chat/route.ts:50
↓ 3 callers
Function
save_to_storage
Save data to a file in the storage directory.
computer-use-demo/computer_use_demo/streamlit.py:523
next →
1–100 of 710, ranked by callers