Skip to content

Instantly share code, notes, and snippets.

View petekp's full-sized avatar

Pete Petrash petekp

View GitHub Profile
@petekp
petekp / gist:4b179c0ae66f54df844b232395e1e663
Created January 7, 2026 19:24
Claude Code audio notification when ready for input (macOS)
# Say Ready Hook for Claude Code (macOS)
Paste this into Claude Code:
---
Set up a "say ready" hook that announces the project name when you're ready for my input. This helps me know which terminal is ready when I have multiple sessions open.
Create ~/.claude/scripts/say-ready.sh with this content:
@petekp
petekp / newskill-gist.sh
Last active January 26, 2026 19:18
newskill - Create Claude Code skills interactively using /skill-creator
#!/usr/bin/env bash
#
# newskill - Create Claude Code skills interactively
#
# Uses Claude Code's /skill-creator to generate production-ready skills
# with proper SKILL.md, asking clarifying questions before generating.
#
# PREREQUISITES:
# - Claude Code CLI (https://claude.ai/code)
# - /skill-creator skill (auto-installed if missing)
@petekp
petekp / skill-audit.mjs
Last active February 26, 2026 16:38
Skill Auditor — finds duplicate SKILL.md files across all locations and interactively prompts for cleanup
#!/usr/bin/env node
/**
* Skill Audit Tool
*
* Auto-discovers ALL SKILL.md files across your system — Claude Code,
* Codex, Copilot, Cursor, Gemini, OpenCode, Goose, Continue, Factory,
* OpenClaw, OpenHands, .agents, project repos, and more.
*
* Identifies duplicates by name and content similarity,
@petekp
petekp / statusline-command.sh
Last active April 2, 2026 03:25
Claude Code statusline — cwd, git branch, changes, context window usage, spawned process count, timestamp
#!/bin/bash
exec 2>/dev/null
# Read JSON input from stdin
input=$(cat)
# Parse needed JSON fields once
parsed=$(printf '%s' "$input" | jq -r '[
(.cwd // ""),
((.context_window.current_usage.input_tokens // 0)
@petekp
petekp / rebuild-session-index.sh
Created April 3, 2026 00:27
Fix claude-code session index desync (--continue/--resume can't find sessions). Workaround for anthropics/claude-code#33912
#!/usr/bin/env python3
"""
Fixes claude-code session index desync (github.com/anthropics/claude-code/issues/33912)
Scans .jsonl session files and rebuilds the per-project sessions-index.json so
--continue and --resume find all sessions.
Run: python3 ~/.claude/scripts/rebuild-session-index.sh [project-dir-name]
No args: rebuilds all projects missing sessions or with orphaned .jsonl files
With arg: rebuilds only that project (e.g. -Users-petepetrash-Code-ever-arc-design-studio)
"""