Skip to content

Instantly share code, notes, and snippets.

View sammcj's full-sized avatar
🦃

Sam sammcj

🦃
View GitHub Profile
@ruvnet
ruvnet / claude-code-mods-guide.md
Created October 2, 2026 00:55
Claude Code Mods: a field guide — build plugins that hook the engine, add commands and tools, and draw their own UI (panes, colour graphics, animation). By ruvnet.

Claude Code Mods: a field guide

How to build Claude Code mods: plugins that hook the engine, add commands and tools, and draw their own UI inside Claude Code, from status lines to animated panes.

By ruvnet. Written from building and shipping a real mod, with every pitfall we hit included.

Early access. Mods (function hooks) are an early-access Claude Code feature, and the API moves between releases. Your build writes its own type definitions next to every mod you load (see Setup), and those types are the authority. Grep them before you trust any guide, this one included.

Throughout this guide:

  • 🧪 Field-tested means we did it in a shipped mod and saw it work (or break) for real.
@nazeshinjite
nazeshinjite / repack-ple-shard.py
Created August 26, 2026 19:18
Repack a split GGUF so the qwen4exp PLE/engram table sits alone in the final shard (llama.cpp PR 27742)
#!/usr/bin/env python3
# Repack a split GGUF so one tensor (default: the qwen4exp engram table
# per_layer_token_embd.weight) sits ALONE in the final shard, with no other tensors
# sharing that file. Motivation: on Metal, llama.cpp wires the mmap'd regions that
# back GPU tensors; a tensor interleaved with them in the same file gets wired along
# for the ride (measured +24 GiB on Qwen3.8-Flash-Next). A file containing only
# CPU-side tensors keeps its own mapping and stays pageable.
#
# Tensor bytes are copied verbatim (no requantization). Output layout for an N-file
# input: shard 1 = byte-for-byte copy of input shard 1 (metadata-only; split.count and
@sammcj
sammcj / local-models.ts
Last active September 18, 2026 09:41
Pi Coding Agent - Local Models Extension
/**
* Local Models Extension
*
* Manage self-hosted LLM endpoints entirely from the TUI.
* Commands:
* /local-models - Open the local models manager
*
* Config is persisted across sessions. Models show up in /model selector
* automatically when their endpoint is reachable.
*
name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output.

Explain Diff

Please make me a rich, interactive explanation of the specified code change.

It should have these sections:

@ahumanft
ahumanft / LLM-Wiki-V3.md
Last active October 24, 2026 05:12
LLM Wiki V3: Compartmentalized Wiki Architecture

LLM Wiki V3: Segmentation

Karpathy gave us the foundation. Rohitg00 warned us what breaks. V3 is how you structure it to scale.

This is a concept document in the same spirit as V1 and V2.

V1 was intentionally vague. Build on it. V2 was intentionally open. Solve it.

@rohitg00
rohitg00 / llm-wiki.md
Last active November 13, 2026 11:43 — forked from karpathy/llm-wiki.md
LLM Wiki v2 — extending Karpathy's LLM Wiki pattern with lessons from building agentmemory

LLM Wiki v2

A pattern for building personal knowledge bases using LLMs. Extended with lessons from building agentmemory 20K+ Stars ⭐️, a persistent memory engine for AI coding agents.

This builds on Andrej Karpathy's original LLM Wiki idea file. Everything in the original still applies. This document adds what we learned running the pattern in production: what breaks at scale, what's missing, and what separates a wiki that stays useful from one that rots.

What the original gets right

The core insight is correct: stop re-deriving, start compiling. RAG retrieves and forgets. A wiki accumulates and compounds. The three-layer architecture (raw sources, wiki, schema) works. The operations (ingest, query, lint) cover the basics. If you haven't read the original, start there.

@liskl
liskl / The-Complete-Guide-to-Building-Skills-for-Claude.md
Last active September 3, 2026 04:37
Complete guide to building Skills for Claude — covers fundamentals, planning, testing, distribution, patterns, and YAML frontmatter reference (converted from Anthropic's official PDF)
@mikeckennedy
mikeckennedy / .zshrc
Last active October 30, 2026 11:25
Security-aware Always Activate The Venv for Python
# Standard zshrc stuff like path, etc.
# ...
# Enable using the two files above:
# Functions
source venv-auto-activate.sh
# Venv security whitelist/blocklist
alias venv-security='uv run -q --no-project ~/scripts/venv-security.py'
@i2cjak
i2cjak / nextpcb_search.py
Created September 12, 2025 16:57
Search NextPCB's part catalog from the command line
import requests
import json
import argparse
from rich.console import Console
from rich.table import Table
from rich.live import Live
from rich.spinner import Spinner
def search_for_part(description, show_all, no_sort):
"""
@ubergarm
ubergarm / Qwen3-MoE-Benchmarks.md
Last active November 15, 2026 11:08
Qwen3 235B and 30B MoE Quant Benchmarking Roundup

The Great Quant Wars of 2025

"All things leave behind them the Obscurity... and go forward to embrace the Brightness..." — Dao De Jing #42

tl;dr;

  • Q: Who provides the best GGUFs now?
  • A: They're all pretty good.

Skip down if you just want graphs and numbers comparing various Qwen3-30B-A3B GGUF quants.