Skip to content

Instantly share code, notes, and snippets.

@wong2
wong2 / claude-code-tools.md
Last active October 24, 2025 16:34
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
@transitive-bullshit
transitive-bullshit / claude-code-prompts.js
Last active October 27, 2025 09:07
Unminified prompts and tool definitions for Claude Code
// Claude Code is a Beta product per Anthropic's Commercial Terms of Service.
// By using Claude Code, you agree that all code acceptance or rejection decisions you make,
// and the associated conversations in context, constitute Feedback under Anthropic's Commercial Terms,
// and may be used to improve Anthropic's products, including training models.
// You are responsible for reviewing any code suggestions before use.
// (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms).
// Version: 0.2.9
@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active September 5, 2025 19:01
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@motin
motin / commit-using-commitizen-in-new-iterm-window.scpt
Last active January 10, 2023 18:57
Add as SourceTree custom action: Open in Seperate Window (checked), Script to run `/path/to/commit-using-commitizen-in-new-iterm-window.sh` (this path MUST NOT contain spaces due to long-standing SourceTree bug https://jira.atlassian.com/browse/SRCTREE-2150), Parameters: `$REPO`
on run argv
set repoPath to (item 1 of argv)
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd " & quoted form of repoPath & " && npx git-cz"
end tell
end tell
end run
@ebidel
ebidel / smoothscroll.js
Last active January 17, 2019 02:22
Smooth scroll page
(function() {
const scroller = document.scrollingElement || document.body;
// Smooth scrolls to the bottom of the page.
window.smoothScrollPage = (y = scroller.scrollHeight) => {
scroller.style.scrollBehavior = 'smooth';
scroller.scrollTop = y;
scroller.style.scrollBehavior = '';
};
@mariotacke
mariotacke / README.md
Created March 7, 2017 04:36
Default nginx log format (combined) and grok pattern
@dengjonathan
dengjonathan / index.js
Last active February 20, 2017 10:26
minimal express.js server
var express = require('express');
var app = express();
var path = require('path');
app.use(express.static(path.join(__dirname)));
app.use("/styles", express.static(__dirname));
app.use("/images", express.static(__dirname + '/images'));
app.use("/scripts", express.static(__dirname + '/scripts'));
// viewed at based directory http://localhost:8080/
@victusfate
victusfate / rawBatchJob.js
Last active December 16, 2016 08:35
graceful queue and worker shutdown take 1
'use strict';
const kue = require('kue');
const url = require('url');
const redis = require('redis');
var getRedis = () => {
var redisUrl = url.parse(process.env.LOCAL_REDIS_URL || config.Redis.RedisUrl)
, client = redis.createClient(redisUrl.port, redisUrl.hostname);
// console.log({ action: 'app', redisUrl: redisUrl });
if (redisUrl.auth) {
@remarkablemark
remarkablemark / README.md
Last active September 3, 2025 21:17
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@dominikwilkowski
dominikwilkowski / README.md
Last active October 19, 2020 03:52
Ubuntu setup with NGINX http/2 and letsencrypt

Intro

This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.

Basics

After creating the server (droplet on DigitalOcean) log in with