Skip to content

Instantly share code, notes, and snippets.

View jwarkentin's full-sized avatar

Justin Warkentin jwarkentin

View GitHub Profile
@jwarkentin
jwarkentin / cas
Last active June 9, 2026 02:25
Manages Claude/Codex credential files to make it quick and easy to switch between accounts when a session limit is hit (only works on Linux since Mac uses keychain)
#!/usr/bin/env bash
# cas - Claude/Codex Account Switch
# Switches a tool's live auth file to an aliased credentials file.
#
# Claude aliases: ~/.claude/.credentials.<alias>.json
# Codex aliases: ~/.codex/auth.<alias>.json
#
# The selected alias carries a ".cur" tag. If a tool replaces the symlink
# during token refresh, cas uses that marker to recover the refreshed file.
@jwarkentin
jwarkentin / session-cost-summary.py
Last active June 4, 2026 07:07
Claude Code status line and related script(s)
#!/usr/bin/env python3
"""Quick cost summary for statusline session state.
Usage:
./session-cost-summary.py [path-to-state.json] [--top N]
Each session's total cost is `prior` (accumulated before the last update)
plus `last` (the most recent segment).
"""
import argparse
@jwarkentin
jwarkentin / migrate-git-repo.sh
Created March 8, 2024 09:43
Migrate stashes and branches from an old git repo to a new clone
#!/usr/bin/env bash
TMP_SRC_REMOTE="git-stash-copy-source"
TMP_TARGET_REMOTE="git-stash-copy-target"
FROMDIR="$( cd "$1" && pwd )"
TODIR="$( cd "$2" && pwd )"
if ! cd "$FROMDIR" && git rev-parse --git-dir 2> /dev/null ; then
echo "Error: \"$FROMDIR\" is not a git repository"
exit 1

Keybase proof

I hereby claim:

  • I am jwarkentin on github.
  • I am jwarkentin (https://keybase.io/jwarkentin) on keybase.
  • I have a public key whose fingerprint is 8DB5 E388 74AF 9402 0720 9B48 8AAB D5FB 3FB1 AD7E

To claim this, I am signing this object: