Skip to content

Instantly share code, notes, and snippets.

View omarmciver's full-sized avatar
🏠
Working from home

Omar McIver omarmciver

🏠
Working from home
View GitHub Profile

Inside the Claude Code source

Anthropic's Claude Code CLI source code leaked onto GitHub recently. All of it. About 1,900 files and a lot of TypeScript.

I read through the key modules. What follows is a breakdown of the surprising parts: how the system actually works, where Anthropic made clever engineering choices, and where their approach diverges from OpenAI's Codex in ways you wouldn't guess from using either tool.

Lifecycle of a request

Here's what happens when you type a message into Claude Code:

# wsl-vpn-arp-fix.ps1
# Fixes WSL2 connectivity after Cisco VPN reconnects by syncing ARP from Windows
# Requires: Run as Administrator
Write-Host ""
Write-Host "=== Fix WSL VPN (Adapter-based ARP Sync) ===" -ForegroundColor Cyan
# Match Cisco AnyConnect / Secure Client adapter
$adapterPattern = "Cisco"
@omarmciver
omarmciver / new-data-vhdx-wsl2.md
Last active March 15, 2026 08:26
New VHDX attach to WSL2

Creating and Maintaining a VHDX Drive in WSL

This guide explains how to create, mount, and maintain a VHDX drive for use with WSL (Windows Subsystem for Linux).

Prerequisites

  • Windows 10/11 with WSL2 installed
  • Administrative access
  • PowerShell
  • Sufficient disk space
@omarmciver
omarmciver / Windows DPC Latency Fixes.md
Created January 21, 2025 04:26
[Windows DPC Latency Fixes]

Windows & NVIDIA DPC Latency Issues: Troubleshooting Steps

General Steps:

1. Disable Power Saving Features

  • Disable all power-saving features in BIOS/UEFI settings.
  • Set a high-performance power plan in Windows:
    Right-click on 'Power' icon in taskbar > 'Choose what the power button does' > 'Change settings that are currently unavailable'
    
@omarmciver
omarmciver / create_self_signed_cert.sh
Created August 6, 2024 16:03
[create_self_signed_cert] #Shell
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <hostname> <IP address>"
exit 1
fi
HOSTNAME=$1
IP=$2
@omarmciver
omarmciver / dotnet-trace
Last active June 2, 2023 16:54
dotnet-trace
Ensure SDK installed:
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
sudo chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace
dotnet tool install --global dotnet-trace
Manual download linux: wget https://aka.ms/dotnet-trace/linux-x64
@omarmciver
omarmciver / installazcliwithpip
Created April 24, 2023 19:11
Install AzureCLI with pip
apt update
apt install python3-pip
python -m pip install --upgrade pip
pip install azure-cli
@omarmciver
omarmciver / GetSQLServers.ps1
Created November 28, 2022 17:25
Get All SQL Servers (or any resource type) #PowerShell #Azure
#az login
$subs = az account list | ConvertFrom-Json
$allServers = @()
foreach($sub in $subs){
Write-Output $sub.Name
az account set -s $sub.Id
$subServers = az resource list --resource-type 'Microsoft.Sql/servers' | ConvertFrom-Json
foreach($server in $subServers){
$allServers += $server
}
@omarmciver
omarmciver / az api calls
Created November 9, 2022 18:59
AZ API Calls
$ SUBSCRIPTION_ID=$(az account show --query id -o tsv)
$ az rest \
--url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourcegroups?api-version=2020-06-01 |
jq ".value | .[] | .name" -r
OR
$ curl -sL \
@omarmciver
omarmciver / Recreate VM in Availability Set
Created July 28, 2022 20:06
Recreate VM in Availability Set #azure #powershell
# Set variables
$subscriptionId="" #Set to your subscription id where the VM is created
$resourceGroup = "" #Resouce group of the VM
$vmName = "" #VM Name
$location = "westeurope" #VM Location
$zone = "2" #1 2 or 3
#Login to the Azure