Skip to content

Instantly share code, notes, and snippets.

View xpepper's full-sized avatar
๐Ÿ’ญ
๐Ÿ˜

Pietro Di Bello xpepper

๐Ÿ’ญ
๐Ÿ˜
View GitHub Profile

Decoding AI: How Large Language Models "Think" Like You Do

Have you ever wondered what's going on "inside the head" of an AI like ChatGPT? We often hear terms like "neural networks" and "algorithms," which can sound a bit like magic. But what if we told you that, in some fundamental ways, Large Language Models (LLMs) operate with processes remarkably similar to your own brain when you're trying to understand something complex, like a piece of code?

Let's dive into a fascinating analogy that maps the human cognitive process of reading code to the architecture of an LLM. Our goal is to demystify AI by showing how its "thinking" can be understood through the lens of our own memory systems.

The Human Brain Model: LTM, STM, and Working Memory

When you read a piece of code, your brain engages three core memory systems:

@xpepper
xpepper / The Greenfield Economics Just Shifted.md
Last active January 26, 2026 21:24
The Greenfield Economics Just Shifted

The Greenfield Economics Just Shifted

A $50k contract delivered for $297. Not a typo.

The "Ralph Wiggum loop" is an autonomous coding pattern where an AI agent restarts with fresh context in each iteration, reading filesystem state and tests to decide what to fix next. It sounds simple because it is. But the implications are profound.

For greenfield work (new projects, clean slate), the unit economics have inverted. The marginal cost of labor now approaches compute costs, not human salaries. This means outsourcing firms' traditional pricing model is broken for this class of work.

What this means for your Build vs. Buy strategy:

@xpepper
xpepper / switch-claude.sh
Created January 13, 2026 20:12
A Claude Code switcher between Anthropic coding subscriptions and Z.ai coding plan :D
#!/bin/bash
set -e
usage() {
echo "Usage:"
echo " switch-claude [-y] {pro|zai}"
echo " switch-claude status"
}
AUTO_YES=false
@xpepper
xpepper / agent.md
Created January 12, 2026 18:24 — forked from steipete/agent.md
Agent rules for git
  • Delete unused or obsolete files when your changes make them irrelevant (refactors, feature removals, etc.), and revert files only when the change is yours or explicitly requested. If a git operation leaves you unsure about other agents' in-flight work, stop and coordinate instead of deleting.
  • Before attempting to delete a file to resolve a local type/lint failure, stop and ask the user. Other agents are often editing adjacent files; deleting their work to silence an error is never acceptable without explicit approval.
  • NEVER edit .env or any environment variable filesโ€”only the user may change them.
  • Coordinate with other agents before removing their in-progress editsโ€”don't revert or delete work you didn't author unless everyone agrees.
  • Moving/renaming and restoring files is allowed.
  • ABSOLUTELY NEVER run destructive git operations (e.g., git reset --hard, rm, git checkout/git restore to an older commit) unless the user gives an explicit, written instruction in this conversation. Treat t
@xpepper
xpepper / Solving AOC 2025 day8 with Claude + GLM models.txt
Last active December 8, 2025 20:45
Solving AOC 2025 day8 with Claude + GLM models
โ•ญโ”€โ”€โ”€ Claude Code v2.0.61 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”‚ Tips for getting started โ”‚
โ”‚ Welcome back! โ”‚ Run /init to create a Cโ€ฆ โ”‚
โ”‚ โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚ โ–โ–›โ–ˆโ–ˆโ–ˆโ–œโ–Œ โ”‚ Recent activity โ”‚
โ”‚ โ–โ–œโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–›โ–˜ โ”‚ No recent activity โ”‚
โ”‚ โ–˜โ–˜ โ–โ– โ”‚ โ”‚
โ”‚ โ”‚ โ”‚
โ”‚ Sonnet 4.5 ยท API Usage Billing โ”‚ โ”‚
@xpepper
xpepper / TDD machine architecture.md
Created November 23, 2025 18:20
TDD machine architecture.md

Generate a productionโ€‘grade Rust workspace that implements an autonomous, multiโ€‘agent Testโ€‘Driven Development machine for code katas. The tool must run locally as a CLI, orchestrate three agents (tester, implementor, refactorer), and follow a strict redโ€‘greenโ€‘refactor loop for a configurable number of steps. It must store state in git and allow each agent to read the last commit message, the last git diff, and the entire working tree.

Objectives

  • Create a Rust workspace with clean boundaries, strong types, and testable modules.
  • Implement an orchestrator that cycles over agents: tester โ†’ implementor โ†’ refactorer โ†’ implementor โ†’ โ€ฆ for N steps.
  • Each agent must run tests and compile checks, and must be able to edit the codebase across multiple files and modules.
  • Persist progress via conventional commits. Commit messages must include all context needed by the next agent.
  • Consume a kata description from a Markdown file. Agents should align their actions to that document.
  • Support pluggable LLMs throu
@xpepper
xpepper / git-log-status.sh
Last active October 21, 2025 20:54
This script enhances git log by automatically fetching and displaying the GitHub Actions (CI) status for your most recent commits.
#!/usr/bin/env bash
# Requirements: GitHub CLI (gh) configured with access to the repository
set -euo pipefail
# Default branch is 'master' if not provided
BRANCH=${1:-master}
# Detect remote URL for origin or fallback to first remote
REMOTE_URL=$(git remote get-url origin 2>/dev/null || git remote get-url "$(git remote | head -n1)" 2>/dev/null || true)
@xpepper
xpepper / ci-local.sh
Created September 9, 2025 19:41
A script to run a CI-like check on a multi-create Rust repository
#!/usr/bin/env bash
set -euo pipefail
# Local mirror of CI steps (fmt, clippy, build, docs, tests) per crate.
# Usage: ./ci-local.sh [options]
# Options:
# -a, --all Run for all crates (ignore git diff detection)
# -b, --base <ref> Base git ref to compare against (default: origin/master)
# -f, --fix Apply formatting instead of just checking
# -t, --skip-tests Skip tests
@xpepper
xpepper / devcontainer.json
Created April 2, 2025 15:39
A devcontainer setup for practicing F# with code kata
{
"name": "F# (.NET)",
"image": "mcr.microsoft.com/devcontainers/dotnet:9.0-bookworm",
"customizations": {
"vscode": {
"extensions": [
"Ionide.Ionide-fsharp",
"ms-dotnettools.csharp",
"ms-dotnettools.vscode-dotnet-runtime"
],
@xpepper
xpepper / kill_rancher_desktop_leftovers.sh
Created January 27, 2025 21:40
Kill all Rancher Desktop leftover to be able to use again Warp client :D
#!/bin/bash
# Find all processes matching 'socket_vmnet' and kill them
ps auxwww | grep -i socket_vmnet | grep -v grep | awk '{print $2}' | xargs sudo kill