Skip to content

Instantly share code, notes, and snippets.

View pmatos's full-sized avatar

Paulo Matos pmatos

View GitHub Profile
@pmatos
pmatos / patch-claude-worktree-arm64.sh
Created February 23, 2026 13:18
ARM64 patch to enable worktrees in cc 2.1.50
#!/usr/bin/env bash
set -euo pipefail
EXPECTED_SHA="4e2b23dbf2f97918d5edc95ae1de03d230a66b94d5fa31a57cc673742ec6ae22"
PATCHED_SHA="fcf070c6e28f5649578f5359b4d3d9dce27eaf6768bb3e0300072f0b13b11169"
TARGET="${1:-$(readlink -f "$(which claude)")}"
if [[ ! -f "$TARGET" ]]; then
echo "Error: file not found: $TARGET" >&2
exit 1
@pmatos
pmatos / patch-claude-worktree.sh
Created February 23, 2026 13:08
Patch issue with worktrees
#!/usr/bin/env bash
set -euo pipefail
EXPECTED_SHA="74042739197c58a4791c1f67414c0d8956639ec2f2e935280872b83d4317be78"
PATCHED_SHA="f098915988a2ac5a5747334147e4893bbca94eacd02bb36ee4c0e7d8f6df1c74"
TARGET="${1:-$(readlink -f "$(which claude)")}"
if [[ ! -f "$TARGET" ]]; then
echo "Error: file not found: $TARGET" >&2
exit 1
@pmatos
pmatos / demo.c
Created February 13, 2026 13:47
Demo C program with subtle bugs for ESBMC Claude Code plugin verification
#include <stdlib.h>
// Bug 1: off-by-one in the loop bound — writes past the end of buf[]
// Bug 2: missing NULL check after malloc — dereferences a potentially NULL pointer
int main() {
int buf[10];
for (int i = 0; i <= 10; i++)
buf[i] = i * 2;
@pmatos
pmatos / claude-usage.sh
Created February 11, 2026 09:23
Waybar custom module: Claude Code session and weekly API usage
#!/bin/bash
TOKEN=$(jq -r '.claudeAiOauth.accessToken' ~/.claude/.credentials.json 2>/dev/null)
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
echo '{"text": "CC: --", "tooltip": "Claude Code: no credentials", "class": "claude-error"}'
exit 0
fi
USAGE=$(curl -sf \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
@pmatos
pmatos / drill-sergeant.md
Created October 23, 2025 07:40
Put it under $HOME/.claude/output-styles
description
No-nonsense drill sergeant - direct, blunt, and tough

Drill Sergeant Mode

You are a rough, no-nonsense drill sergeant coding partner. Your communication style:

Tone and Attitude

  • Never apologize - no "sorry", no "my apologies", no excuses
@pmatos
pmatos / wtm.py
Last active October 17, 2025 07:15
create worktree for kompass
#!/usr/bin/env python3
"""
Worktree Management (wtm) - Git worktree creation and removal script for Kompass project.
This script automates the process of managing git worktrees with full environment setup:
CREATE command:
1. Creates a new git worktree from specified branch
2. Sets up a virtual environment (_venv)
3. Installs dependencies using uv sync
@pmatos
pmatos / CLAUDE.md
Created July 31, 2025 12:11
V8 Claude.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build Commands

V8 uses GN + Ninja build system. The primary development tool is tools/dev/gm.py:

# Quick build and test
@pmatos
pmatos / f80.rkt
Created April 4, 2024 15:48
f80 to decimal conversion
#lang racket
(define one #x3fff8000000000000000)
(define two #x40008000000000000000)
(define three #x4000c000000000000000)
(define (fits-in-80bit? x)
(zero? (arithmetic-shift x -80)))
(define (sign x)
version: "3.7"
services:
runner:
image: pmatos/github-runner:latest
environment:
RUNNER_NAME: "arm64-ChezScheme-runner"
RUNNER_REPOSITORY_URL: ${RUNNER_REPOSITORY_URL}
GITHUB_ACCESS_TOKEN: ${GITHUB_ACCESS_TOKEN}
volumes:
#lang racket/base
(require xsmith
racr
xsmith/racr-convenience
racket/pretty
racket/random
racket/list
racket/class
racket/string