Skip to content

Instantly share code, notes, and snippets.

@wong2
wong2 / claude-code-tools.md
Last active May 18, 2026 04:08
Tools and system prompt of Claude Code

Task

Launch a new agent that has access to the following tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use the Agent tool to perform the search for you.

When to use the Agent tool:

  • If you are searching for a keyword like "config" or "logger", or for questions like "which file does X?", the Agent tool is strongly recommended

When NOT to use the Agent tool:

  • If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
  • If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
  • If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
@wong2
wong2 / README.md
Last active May 11, 2026 17:58
How to run Claude computer use demo on macOS

Note

It is necessary to give Terminal (or iTerm or whatever you use) the permission to control the computer. This can be done in System Settings ➔ Privacy & Security ➔ Accessibility.

Guide

  • Install cliclick for mouse & keyboard emulation
    • brew install cliclick
  • Clone Anthropic quickstart repo
    • git clone https://github.com/anthropics/anthropic-quickstarts.git
  • cd computer-use-demo
  • Replace computer-use-demo/computer_use_demo/tools/computer.py with the modified version below
@wong2
wong2 / SKILL.md
Created May 9, 2026 12:57
Codex Chrome use skill
name Chrome
description Browser automation for the user's Chrome browser. Use for browser tasks that require the user's cookies, logged-in sessions, existing tabs, extensions, or remote authenticated sites.

Chrome

Use this skill when the user mentions @chrome.

Chrome is the routing touchpoint for the Codex Chrome Extension:

@wong2
wong2 / downlist.py
Created March 18, 2015 06:51
下载网易云音乐歌单
#-*-coding:utf-8-*-
import os
import re
import sys
import requests
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
@wong2
wong2 / cmds.txt
Last active August 14, 2025 07:28
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
```
vscode:mcp/install?encodeURIComponent(JSON.stringify({
"name": "fetch",
"command": "npx",
"args": [],
}))
``
```
cherrystudio://mcp/install?servers={base64Encode(JSON.stringify({
@wong2
wong2 / node-canvas-fill-text-max-width.js
Created August 21, 2019 06:12
node canvas auto wrap text by max width
function fillText(ctx, text, x, y, maxWidth, spacing = 0){
const lines = text.split('\n')
let lineHeight = 0
for (const line of lines) {
if (!line) {
y += lineHeight
continue
}
let s = ''
for (const char of line) {
from io import BytesIO
import torch
from fastapi.responses import StreamingResponse
from leptonai.photon import Photon
from loguru import logger
class JPEGResponse(StreamingResponse):
media_type = "image/jpeg"
async function* streamAsyncIterable<T = unknown>(stream: ReadableStream<T>) {
const reader = stream.getReader()
try {
while (true) {
const { done, value } = await reader.read()
if (done) {
return
}
yield value
}
import HDWalletProvider from "@truffle/hdwallet-provider";
import { OpenSeaPort, Network } from "opensea-js";
import { PRIVATE_KEY } from "./consts.mjs";
const provider = new HDWalletProvider({
privateKeys: [PRIVATE_KEY],
providerOrUrl: "https://rpc.ankr.com/eth",
});
provider.engine.on("error", (err) => {