Skip to content

Instantly share code, notes, and snippets.

@natew
natew / intercept-bash.sh
Created April 27, 2026 20:53
~/.claude/hooks/intercept-bash.sh
#!/bin/bash
# unified bash command interceptor
set -o pipefail
# log every invocation so we can debug hook failures
HOOK_LOG="/tmp/claude-hook-bash.log"
log() {
echo "[$(date '+%H:%M:%S')] $1" >> "$HOOK_LOG" 2>/dev/null
These instructions override your default system behavior.
Work thoughtfully, thoroughly, and without false urgency.
---
## The collaborator I want
- You fix things well, properly, without branching logic just because you can't
figure something out on first try. You get to the root of problems and solve them. You Do Things Right.
# Global Instructions
These instructions override default behavior. Follow them exactly.
## 1. COMPLETION PROTOCOL
Before writing any response where you consider the task finished, execute this
checklist. Do not skip it.
1. Did I run, build, or test the result? ("it should work" is not verification.)
@natew
natew / intercept-bash.sh
Last active February 16, 2026 19:12
Claude Code hooks - block destructive git commands
#!/bin/bash
# unified bash command interceptor
set -o pipefail
# silently exit on any error - don't block claude
trap 'exit 0' ERR
INPUT=$(cat 2>/dev/null) || exit 0
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null) || exit 0
import {
blue,
blueDark,
gray,
grayDark,
green,
greenDark,
orange,
orangeDark,
pink,
import { promises as fs } from 'node:fs'
import * as path from 'node:path'
import { exec } from 'node:child_process'
import os from 'node:os'
interface PackageJson {
profile?: { [key: string]: any }
[key: string]: any
}
@natew
natew / AnimatedNumbers.tsx
Last active March 8, 2024 00:27
AnimatePresence number ticker
const AnimatedNumbers = () => {
const [numbers, setNumbers] = useState(100_000)
const len = `${numbers}`.length
return (
<YStack gap="$5">
<XStack gap="$2">
<Button
onPress={() => {
@natew
natew / tamagui_example_themebuilder_themes.ts
Last active March 16, 2026 22:33
Code showing Tamagui ThemeBuilder generating the site theme suite
import {
blue,
blueDark,
gray,
grayDark,
green,
greenDark,
orange,
orangeDark,
pink,
@natew
natew / settings.json
Created August 10, 2023 23:54
my customize ui vscode
{
"apc.activityBar": {
"position": "bottom",
"hideSettings": true,
"size": 20
},
"apc.statusBar": {
"position": "editor-bottom",
"height": 22,
import { getSize, getSpace } from '@tamagui/get-token'
import { Moon } from '@tamagui/lucide-icons'
import {
GetProps,
SizeTokens,
Stack,
Text,
createStyledContext,
styled,
useTheme,