Skip to content

Instantly share code, notes, and snippets.

View sgbaird's full-sized avatar

Sterling G. Baird sgbaird

View GitHub Profile
@sgbaird
sgbaird / raspberry-pi-tailnet-setup-prompt.md
Last active September 17, 2026 21:51
Reusable Claude Code prompt: bring a new Raspberry Pi onto the lab tailnet (flash with RPi Connect, Tailscale SSH, admin console tags/policy/OAuth client via browser hand-off, settings.local.json + GitHub secrets/variables + claude.yml + CLAUDE.md). Derived from vertical-cloud-lab/byu-vcl, powder-doser, tensegrity-optimization.

Bring a new Raspberry Pi onto the lab tailnet

A reusable Claude Code prompt. Start a session in the repo the Pi belongs to, fill in the Inputs block, and paste everything from the horizontal rule down.

Distilled from how the vertical-cloud-lab Pis were actually brought up: byu-vcl (CLAUDE.md, its Tailscale → Raspberry Pi connection section, and .github/workflows/claude.yml), powder-doser, tensegrity-optimization,

@sgbaird
sgbaird / refresh_github_app_token.py
Created September 8, 2026 23:17
Running claude code github actions beyond 1 hour: companion to custom instructions at https://gist.github.com/sgbaird/972529991768c5dce469f013f490567e
#!/usr/bin/env python3
"""Re-mint the GitHub App token an agent session runs on, mid-session.
Why this exists: claude-code-action mints a GitHub App installation token once,
at the start of the Run Claude Code step, and installation tokens live exactly
one hour. A session that outlives the hour keeps running, but git push, gh, and
the MCP comment tool all start failing with 401. The action deliberately strips
ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN from the
session's environment (base-action/src/parse-sdk-options.ts), so the session
cannot re-run the exchange from its own env. Those two values are still
@sgbaird
sgbaird / pin-repo-to-claude-account.md
Last active August 26, 2026 21:39
Pin a repo to a specific Claude Code account via CLAUDE_CONFIG_DIR (derived from local Claude Code session for https://github.com/vertical-cloud-lab/byu-vcl)

Pin a repo to a specific Claude Code account

If you have more than one Claude account on a machine, Claude Code uses whichever one the default config dir is logged into. That's fine until you have repos that should bill to different accounts. This pins a repo to one account, deterministically.

How it works

Claude Code keeps all auth/session state in one directory, ~/.claude by default. The CLAUDE_CONFIG_DIR env var overrides that path. Point it at a second directory

@sgbaird
sgbaird / prompts.md
Last active August 19, 2026 15:48
Reusable prompts

@claude+opus:max download `` (use the Pi to do this) and extract the transcript and get screenshots of every place where there's some actionable feedback point from the transcript (and make sure to correct the transcript for intent since there's probably voice-to-text mishaps), and turn that into a full md document that you commit to this branch (there will be lots of screenshot images, so these images will need to be put in a subdir). Also grab comments on that video, if any, and inlay each comment line into the corresponding place in the video. Also make sure to include timestamps for where the screenshots were taken (and you might need to take multiple screenshots in quick succession, since sometimes comments made aloud correspond to where the mouse pointer is at exactly that moment). This is a high effort task and will require a good amount of image analysis. Every two minutes, check for follow-up comments that specifically relate to this video and address them. Your job is to implement the f

@sgbaird
sgbaird / CLAUDE.md
Last active September 8, 2026 23:18

Development Practices

  • Start with minimal, lean implementations focused on proof-of-concept
  • Avoid creating new files until asked
  • Avoid implementing things from scratch
  • Avoid defensive error handling for hypothetical situations For example, rather than using:
    ...
    try:
@sgbaird
sgbaird / claude-code-review.yml
Created June 30, 2026 21:57
Claude Code Review GitHub Actions - to be put in .github/workflows, based on instructions in https://code.claude.com/docs/en/github-actions, modified for myself
name: Claude Code Review
on:
pull_request:
types: [opened, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
@sgbaird
sgbaird / claude.yml
Last active August 26, 2026 23:11
Claude Code GitHub Actions - to be put in .github/workflows, based on instructions in https://code.claude.com/docs/en/github-actions, modified for myself
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
@sgbaird
sgbaird / ficks_first_law_steady_state.py
Created February 20, 2026 20:23
Fick’s First Law: Diffusion to Steady State
import numpy as np, matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt, io, os, math
import PIL.Image as Image
import imageio.v2 as imageio
# Parameters
L = 1.0
D = 1.0
Nx = 201
@sgbaird
sgbaird / gripper_wellplate_move.py
Created November 28, 2025 00:16
context7 chat about demo'ing the gripper of the flex (https://chatgpt.com/share/6928e9af-ad14-8007-b5a6-a13577985a44)
from opentrons import protocol_api
metadata = {
"apiLevel": "2.16",
"protocolName": "Flex Gripper Wellplate Demo",
"description": "Demo showing how to move a wellplate using the Flex gripper"
}
def run(protocol: protocol_api.ProtocolContext):
# Load a 96-well plate in deck slot D1
@sgbaird
sgbaird / copilot-setup-steps.yml
Last active December 17, 2025 20:58
Minimal setup instructions for GitHub copilot coding agent. Place in .github/workflows/copilot-setup-steps.yml per documentation at https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
name: "Copilot Setup Steps"
on:
workflow_dispatch:
push:
paths: [.github/workflows/copilot-setup-steps.yml]
pull_request:
paths: [.github/workflows/copilot-setup-steps.yml]
jobs:
copilot-setup-steps: