Skip to content

Instantly share code, notes, and snippets.

View Haseeb-Qureshi's full-sized avatar
🕶️
Being a cool guy

Haseeb Qureshi Haseeb-Qureshi

🕶️
Being a cool guy
View GitHub Profile
@Haseeb-Qureshi
Haseeb-Qureshi / claude-code-harness-deep-dive.md
Created March 31, 2026 21:26
Inside the Claude Code source

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:

@Haseeb-Qureshi
Haseeb-Qureshi / agentic-harness-comparison.md
Created March 31, 2026 19:57
AI Coding Agent Architecture Analysis: Claude Code vs Codex vs Cline vs OpenCode

I Read the Source Code of Four AI Coding Agents. The Real Product Isn't the AI.

I expected the differences between AI coding agents to be in how they call the LLM. They're not. The API call is trivial -- a streaming HTTP request with a JSON payload. Every agent does it essentially the same way.

What makes these tools different -- what makes them products -- is everything wrapped around that API call: the 40 tools that give the AI hands, the permission systems that keep it from breaking things, the compaction strategies that prevent it from forgetting what it's doing, and the prompt engineering that shapes how it thinks.

I cloned the source code for all four major AI coding agents -- Claude Code (from a leaked copy of Anthropic's proprietary source), OpenAI's Codex CLI, Cline (the popular VS Code extension), and OpenCode (an open-source Go CLI) -- and read through their internals. What I found reveals four competing philosophies about a fundamental question: **how much should you trust an AI with your c

@Haseeb-Qureshi
Haseeb-Qureshi / flasherc20.js
Created February 26, 2020 06:51
FlashERC20
interface Lender {
function goWild() external;
}
contract FlashERC20 is ERC20 {
using SafeMath for uint256;
function flash(uint256 amount) external {
balances[msg.sender] = balances[msg.sender].add(amount);
Lender(msg.sender).goWild();
@Haseeb-Qureshi
Haseeb-Qureshi / seeds.cpp
Created May 7, 2019 00:26
Bitcoin seeds
// From: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp
vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd
vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9
vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr
vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf
vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost
vSeeds.emplace_back("dnsseed.emzy.de"); // Stephan Oeste
@Haseeb-Qureshi
Haseeb-Qureshi / ethereum_2_dot_0.md
Last active May 26, 2020 06:40
Ethereum 2.0 and Beyond (SBC19)

Ethereum 2.0 and beyond

Vitalik Buterin (Ethereum Foundation)

  • Ethereum 2.0 spec pre-release
    • Released yesterday!
  • Proof of stake and sharding have been part of the ETH roadmap since 2014
    • Started with Slasher in 2014, which is totally broken
    • But since then have made a lot of progress
    • Casper FFG devised and formally verified
  • Sharding is now better specified
@Haseeb-Qureshi
Haseeb-Qureshi / zexe.md
Created February 4, 2019 03:46
Zexe: Enabling Decentralized Private Computation (SBC19)

Zexe: Enabling Decentralized Private Computation

Speaker: Pratyush Mishra

  • How can we do computing on distributed ledgers?
    • Many existing systems for smart contract execution
      • Ethereum, Tezos, EOS, etc.
    • They all work through re-computation—every party redundantly performs the computations to agree on state
    • This comes with scalability tradeoffs
      • Recomputing all of these programs is costly
  • Weakest computers (e.g. cell phones) can't keep up recomputing all transactions
@Haseeb-Qureshi
Haseeb-Qureshi / fantomette.md
Created February 4, 2019 00:58
Betting on Blockchain Consensus with Fantômette (SBC19)

Betting on Blockchain Consensus with Fantômette

Speaker: Sarah Azouvi

  • Bitcoin vs Traditional Consensus
    • Bitcoin is open memberships, participants unknown
    • One message broadcast per round
    • Incentives are at the core of its security
    • High energy consumption!
    • Slow...
  • Blockchain without PoW?
@Haseeb-Qureshi
Haseeb-Qureshi / formal_verification_makerdao.md
Created February 3, 2019 18:29
Formal verification: the road to complete security of smart contracts (SBC19)

Formal verification: the road to complete security of smart contracts

Martin Lundfall (MakerDao)

  • What is formal verification?
    • Process of specifying and verifying the behavior of programs
    • Specification: mathematical description of intended program behavior
    • Verification: operational semantics of a language -> spec -> proof
    • There are 4 different "flavors" of assurances that formal verification can provide
        1. Smart contract bytecode verification - "Full description of EVM behavior"
  • What can happen over the course of one transaction?
@Haseeb-Qureshi
Haseeb-Qureshi / multi_hop_locks.md
Created February 3, 2019 17:47
Privacy-preserving Multi-hop Locks for Blockchain Scalability and Interoperability (SBC19)

Privacy-preserving Multi-hop Locks for Blockchain Scalability and Interoperability

Speaker: Pedro Monero-Sanchez

  • Payment channels are a widely pursued layer 2 scaling solution
    • But they only solve for bidirectional payments (between the two parties who open the channel)
  • What if we build a payment channel network?
    • Naive solution—every pair of parties (N^2) opens a channel with each other
      • But then we need to lock up an exorbitant amount of capital in all these channels
    • Instead, let's open a few channels for each party
  • And rely on other intermediary channels to reach the intended receiver
@Haseeb-Qureshi
Haseeb-Qureshi / thunder_mainnet.md
Created February 3, 2019 06:58
New and Simple Consensus Algorithms for ThunderCore’s MainNet (SBC19)

New and Simple Consensus Algorithms for ThunderCore’s MainNet

Speaker: Elaine Shi

  • Synchronous, with a change of partition tolerance
  • State machine replication (e.g., blockchain consensus)
    • Requires safety (nothing bad ever happens), and liveness (eventually something good happens)
  • Thunderella
    • If you don't know Thunderella, go look it up (check out the BPASE '18 talk)
  • Wait, there's a flaw in Thunderella?!
  • A confirmed transaction can be undone, even in a somewhat benign setting