Skip to content

Instantly share code, notes, and snippets.

View andynu's full-sized avatar

Andrew Nutter-Upham andynu

View GitHub Profile
@andynu
andynu / claude-md-tidy.md
Created March 6, 2026 19:48
Claude Code slash command: Deduplicate local CLAUDE.md by removing content covered by global rules
allowed-tools
Glob(path:/home/andy/.claude/**), Read(path:/home/andy/.claude/**), Edit

Deduplicate Local CLAUDE.md

Remove content from the local project CLAUDE.md that duplicates global rules.

Instructions

@andynu
andynu / README.md
Last active March 4, 2026 17:33
tmx-claude & tmx-worktree: Spawn parallel Claude Code sessions in tmux windows and git worktrees

tmx-claude & tmx-worktree

Spawn Claude Code sessions in tmux windows — either in your current repo or in isolated git worktrees. Lets you run multiple Claude agents in parallel without blocking your terminal.

Notes

  • WORKTREE_BASE defaults to ~/work/src/ in tmx-worktree and worktree-clean. Edit the variable at the top of each script to match your layout.
  • tmx-claude --help mentions bd-lite, a lightweight issue tracker I use. You can ignore that or rip it out.

What's included

@andynu
andynu / oracle_enhanced_rowid_lob_fix.rb
Created February 16, 2026 16:29
Experimental: ROWID-based LOB writes for oracle-enhanced (ruby-oci8 only)
# frozen_string_literal: true
# ╔══════════════════════════════════════════════════════════════════════╗
# ║ WARNING: ruby-oci8 ONLY ║
# ║ ║
# ║ This patch uses cursor.rowid, a ruby-oci8 API. It is NOT ║
# ║ compatible with JDBC (JRuby). For a cross-platform fix that ║
# ║ handles composite primary keys only, see: ║
# ║ https://gist.github.com/andynu/508ed5b16f348d474db377ab1e870778 ║
# ║ ║
@andynu
andynu / composite_key_lob_monkey_patch.rb
Created February 16, 2026 16:00
Fix oracle-enhanced LOB writes with composite primary keys
# frozen_string_literal: true
# Monkey patch: Fix LOB writes for tables with composite primary keys
#
# The stock oracle-enhanced adapter's write_lobs method assumes a single
# primary key column. With a composite key, klass.primary_key returns an
# Array, which causes:
# - attributes[[:col_a, :col_b]] → nil (Hash doesn't find Array keys)
# - quote_column_name([:col_a, :col_b]) → garbage column name
# - SELECT FOR UPDATE returns no rows → RecordNotFound / data loss
@andynu
andynu / README.md
Last active February 4, 2026 19:25
Two-context execution pattern with Beads issue tracker for AI-assisted development

Two-Context Execution Pattern with Beads

A workflow pattern for AI-assisted development that separates planning from execution, using context isolation to keep each layer focused.

The Problem

Large tasks overwhelm a single Claude session:

  • Context fills with implementation details
  • Hard to track overall progress
  • Easy to lose sight of the plan while deep in code
@andynu
andynu / README.md
Last active February 4, 2026 19:25
Multi-agent Claude Code workflow using tmux for parallel sessions

Multi-Agent Claude Code Workflow

A lightweight pattern for spawning secondary Claude Code sessions using tmux, enabling parallel work across projects without context collision.

Why Spawn Secondary Sessions?

When working from a "mission control" directory (like ~/work/src/ with 100+ projects), you often need to:

  • Dispatch deep work to a specific project while continuing meta-level coordination
  • Run parallel investigations that would pollute a single session's context
@andynu
andynu / SKILL.md
Last active January 20, 2026 18:57
C4 Diagram skill, using d2 lang
name description
C4 Diagrams
Creating C4 architecture diagrams using D2 diagram language. Use when creating system context diagrams, container diagrams, component diagrams, code diagrams, deployment diagrams, or any software architecture visualization following the C4 model. Also applies when discussing architecture at different zoom levels or explaining system boundaries.

C4 Architecture Diagrams with D2

Create C4 model diagrams using D2's text-to-diagram syntax. Supports both graphical (SVG/PNG) and ASCII output.


---
- name: ruby build dependencies
apt:
pkg:
- git
- build-essential
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libffi-dev
@andynu
andynu / statusline-command.sh
Created January 10, 2026 19:39
Claude Code custom statusline script - shows model, folder, git branch, and token usage with progress bar
#!/bin/bash
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"')
DIR=$(echo "$input" | jq -r '.workspace.current_dir // "~"')
FOLDER="${DIR##*/}"
# Git branch
BRANCH=""
if git -C "$DIR" rev-parse --git-dir > /dev/null 2>&1; then
BRANCH=$(git -C "$DIR" branch --show-current 2>/dev/null)
@andynu
andynu / bdexecissue.md
Created January 9, 2026 00:30
Claude Code slash commands for bd (beads) issue tracking workflow
description argument-hint allowed-tools context
execute a single bd issue
<issue key>
Bash(bd *), Bash(git *), Bash(tea *), Read(.)
fork

Execute Single BD Issue

Overview

Execute a single bd issue with proper status tracking, commenting, and git workflow integration. This command handles one issue in isolation, keeping context clean.