Skip to content

Instantly share code, notes, and snippets.

@teslamint
teslamint / llm-codegen-failure-modes.md
Created June 30, 2026 00:24
LLM Code Generation: A Field Guide to Failure Modes

LLM Code Generation: A Field Guide to Failure Modes

There's a mass migration happening right now where developers are offloading more and more of their code writing to LLMs. Cursor, Copilot, Claude Code, aider, etc. — the tooling has gotten good enough that the default workflow for a lot of people is now "describe what you want, get code back, review it, ship it." And it works surprisingly well. Until it doesn't.

I've been paying attention to the ways it doesn't work, and the interesting thing is that the failures are not random. They cluster into a small number of recurring patterns, and once you see them, you can predict when they'll happen. More importantly, you can write rules — in your system prompt, your CLAUDE.md, your .cursorrules, whatever — that prevent most of them. But to write good rules, you need to understand why the failures happen. A rule without a mental model is just cargo cult.

Failure mode 1: Prior collapse

This is the big one. When you ask an LLM to "add authentication to this

@teslamint
teslamint / install.sh
Last active December 15, 2022 18:11
Install cloudflared into Turris Omnia(OpenWrt 19.07)
#!/bin/sh
opkg update
opkg install golang gcc
# ref: https://forum.openwrt.org/t/usr-bin-ld-cannot-find-lpthread/18404/10
ar -rc /usr/lib/libpthread.a
ar -rc /usr/lib/libl.a
ar -rc /usr/lib/libdl.a
@teslamint
teslamint / S3Storage.ts
Last active December 3, 2020 08:48
AWS S3 Storage Adapter for NestJS with Fastify
import { Req } from "@nestjs/common";
import { FastifyRequest } from "fastify";
import { File, StorageEngine } from "fastify-multer/lib/interfaces";
import * as uuid from 'uuid';
export type Info = Partial<
File & AWS.S3.ManagedUpload.SendData & AWS.S3.Types.PutObjectRequest
>;
export class S3Storage implements StorageEngine {
@teslamint
teslamint / 99-wgcf-restart
Created April 15, 2020 10:57
[OpenWrt] Restart WireGuard(WGCF) interface if WAN is up
[ "ifup" = "$ACTION" ] && {
[ "wan" = "$DEVICE" ] && {
ifconfig wgcf down
ifconfig wgcf up
}
}
@teslamint
teslamint / openpgp.txt
Created February 21, 2018 11:17
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:981d68191696915e130b93e8ba30c4dc772a8587]
@teslamint
teslamint / xcode9_nullmodem.patch
Created November 2, 2017 13:02
DOSBox SVN r4063 nullmodem patch
Index: src/hardware/serialport/nullmodem.cpp
===================================================================
--- a/src/hardware/serialport/nullmodem.cpp (revision 4063)
+++ b/src/hardware/serialport/nullmodem.cpp (working copy)
@@ -148,7 +148,7 @@
setCTS(dtrrespect||transparent);
setDSR(dtrrespect||transparent);
setRI(false);
- setCD(clientsocket > 0); // CD on if connection established
+ setCD(clientsocket != NULL); // CD on if connection established
@teslamint
teslamint / # php71-memcached - 2017-10-13_11-45-33.txt
Created October 13, 2017 02:47
php71-memcached (homebrew/php/php71-memcached) on macOS 10.13.1 - Homebrew build logs
Homebrew build logs for homebrew/php/php71-memcached on macOS 10.13.1
Build date: 2017-10-13 11:45:33
@teslamint
teslamint / # php71-libsodium@1.0 - 2017-09-28_11-17-43.txt
Created September 28, 2017 02:18
php71-libsodium@1.0 (homebrew/php/php71-libsodium@1.0) on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for homebrew/php/php71-libsodium@1.0 on macOS 10.12.6
Build date: 2017-09-28 11:17:43
@teslamint
teslamint / # python - 2017-08-03_18-04-46.txt
Created August 11, 2017 03:40
python on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for python on macOS 10.12.6
Build date: 2017-08-03 18:04:46
@teslamint
teslamint / # libsodium - 2017-06-09_14-31-40.txt
Created June 9, 2017 05:32
libsodium on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for libsodium on macOS 10.12.6
Build date: 2017-06-09 14:31:40