DEV Community

Gabriel Anhaia profile picture

Gabriel Anhaia

Senior Software Engineer @ Monta · 10+ years in backend, distributed systems & AI agents · Creator of Hermes IDE (AI-native terminal) & Neural Playground · Author of 2 books · Open-source enthusiast

Location Berlin, Germany Joined Joined on  Personal website https://xgabriel.com github website

Work

Software Engineer and Book Author

TypeScript strict Mode Is 8 Flags. Turn strictNullChecks On Last.

TypeScript strict Mode Is 8 Flags. Turn strictNullChecks On Last.

1
Comments
10 min read
Opaque Types Without `unique symbol`: A Lighter Branded-Types Pattern

Opaque Types Without `unique symbol`: A Lighter Branded-Types Pattern

Comments
8 min read
Function Overloads in 2026: Use a Discriminated Param Instead

Function Overloads in 2026: Use a Discriminated Param Instead

Comments
8 min read
noPropertyAccessFromIndexSignature: When the Strict Flag Pays Off

noPropertyAccessFromIndexSignature: When the Strict Flag Pays Off

Comments
9 min read
`infer` in Conditional Types: 5 Recipes That Aren't in the Handbook

`infer` in Conditional Types: 5 Recipes That Aren't in the Handbook

Comments
9 min read
Cross-Compiling Go for Alpine vs Distroless: The CGO_ENABLED Decision Tree

Cross-Compiling Go for Alpine vs Distroless: The CGO_ENABLED Decision Tree

2
Comments
9 min read
Go's net/http Server.Shutdown: The Three-Stage Drain You Probably Skip

Go's net/http Server.Shutdown: The Three-Stage Drain You Probably Skip

Comments
8 min read
atomic.Pointer[T] for Lock-Free Cache Updates That Don't Race

atomic.Pointer[T] for Lock-Free Cache Updates That Don't Race

Comments
8 min read
slog Beyond Basics: Group, ReplaceAttr, and Custom Handlers

slog Beyond Basics: Group, ReplaceAttr, and Custom Handlers

Comments
8 min read
unique.Make in Go 1.23: String Interning Without sync.Pool Tricks

unique.Make in Go 1.23: String Interning Without sync.Pool Tricks

Comments
8 min read
Sub-tests Done Right: t.Run, t.Parallel, and the Cleanup-Order Trap

Sub-tests Done Right: t.Run, t.Parallel, and the Cleanup-Order Trap

Comments
7 min read
sync.OnceFunc, OnceValue, OnceValues: When Each Beats sync.Once

sync.OnceFunc, OnceValue, OnceValues: When Each Beats sync.Once

Comments
8 min read
Few-Shot Selection at Runtime: Why Static Examples Hurt Edge Cases

Few-Shot Selection at Runtime: Why Static Examples Hurt Edge Cases

Comments
8 min read
From Java Records to TypeScript: Three Patterns That Replace Them Cleanly

From Java Records to TypeScript: Three Patterns That Replace Them Cleanly

Comments
8 min read
Bun's TypeScript Support in 2026: What Works, What Still Needs tsc

Bun's TypeScript Support in 2026: What Works, What Still Needs tsc

Comments
9 min read
PHP Enum Methods to TypeScript: Why Discriminated Unions + namespace Beats class enums

PHP Enum Methods to TypeScript: Why Discriminated Unions + namespace Beats class enums

Comments
8 min read
`asserts cond` vs `is X`: When the Assertion Function Beats the Type Guard

`asserts cond` vs `is X`: When the Assertion Function Beats the Type Guard

Comments
8 min read
Multi-Tenant Token Budgets: Quota Patterns That Don't Starve Your Best Customers

Multi-Tenant Token Budgets: Quota Patterns That Don't Starve Your Best Customers

Comments
9 min read
Embedding Dimension Reduction: When 1536 256 Doesn't Hurt Recall

Embedding Dimension Reduction: When 1536 256 Doesn't Hurt Recall

Comments
8 min read
Vector Index Cold Start: Why Your First Query Takes 8 Seconds

Vector Index Cold Start: Why Your First Query Takes 8 Seconds

Comments
9 min read
Cost-Aware LLM Routing: Sending 30% of Traffic to a Cheaper Model Without Quality Loss

Cost-Aware LLM Routing: Sending 30% of Traffic to a Cheaper Model Without Quality Loss

Comments
10 min read
RAG Chunk Boundary Bugs: Why Your Retriever Returns Half-Sentences

RAG Chunk Boundary Bugs: Why Your Retriever Returns Half-Sentences

Comments
9 min read
Anthropic Stop Reasons in Production: 5 Cases That Need Different Reactions

Anthropic Stop Reasons in Production: 5 Cases That Need Different Reactions

Comments
8 min read
A Custom http.RoundTripper Is the Cleanest Place for Cross-Cutting HTTP Concerns

A Custom http.RoundTripper Is the Cleanest Place for Cross-Cutting HTTP Concerns

Comments
8 min read
context.WithoutCancel: When You Need Work That Outlives Its Caller

context.WithoutCancel: When You Need Work That Outlives Its Caller

Comments
7 min read
Go's testing/synctest Package: Time-Mocked Tests That Aren't Flaky

Go's testing/synctest Package: Time-Mocked Tests That Aren't Flaky

Comments
9 min read
Go Race Detector Output: 3 Stack Shapes That Mean Different Things

Go Race Detector Output: 3 Stack Shapes That Mean Different Things

Comments
9 min read
TypeScript Watch Mode in Big Projects: What --extendedDiagnostics Actually Tells You

TypeScript Watch Mode in Big Projects: What --extendedDiagnostics Actually Tells You

Comments
9 min read
A Repository Layer in Go Without an ORM: 4 Patterns That Survive in Production

A Repository Layer in Go Without an ORM: 4 Patterns That Survive in Production

Comments
8 min read
The maps Stdlib in Go 1.21+: 8 Functions That Replace Half Your Map Helpers

The maps Stdlib in Go 1.21+: 8 Functions That Replace Half Your Map Helpers

Comments
8 min read
Tool Definition Drift: When Your Agent's Toolset Outgrows Its Prompt

Tool Definition Drift: When Your Agent's Toolset Outgrows Its Prompt

Comments
8 min read
Eval Set Sizing: The Statistical Power Math Behind LLM A/B Tests

Eval Set Sizing: The Statistical Power Math Behind LLM A/B Tests

1
Comments 1
8 min read
Self-Critique Loops for Agents: Where the 3rd Iteration Stops Helping

Self-Critique Loops for Agents: Where the 3rd Iteration Stops Helping

Comments
8 min read
Reranker Fine-Tuning on Click Data: When Off-the-Shelf Stops Winning

Reranker Fine-Tuning on Click Data: When Off-the-Shelf Stops Winning

Comments
8 min read
Agent Trace Sampling: When 100% Capture Stops Being Worth It

Agent Trace Sampling: When 100% Capture Stops Being Worth It

Comments
9 min read
declare global vs declare module: When to Use Which

declare global vs declare module: When to Use Which

Comments
10 min read
Kotlin Coroutines to TypeScript: Three Cancellation Patterns That Aren't 1:1

Kotlin Coroutines to TypeScript: Three Cancellation Patterns That Aren't 1:1

Comments
9 min read
Dual ESM/CJS Publish in 2026: A Modern tsconfig + package.json Setup That Just Works

Dual ESM/CJS Publish in 2026: A Modern tsconfig + package.json Setup That Just Works

Comments
9 min read
MCP in Production: 5 Patterns That Surface in Real Deployments

MCP in Production: 5 Patterns That Surface in Real Deployments

1
Comments 1
10 min read
Stateful Agent Replay: Deterministic Reruns From a Captured Trace

Stateful Agent Replay: Deterministic Reruns From a Captured Trace

Comments
10 min read
Embeddings on the Edge: sentence-transformers vs Hosted APIs

Embeddings on the Edge: sentence-transformers vs Hosted APIs

1
Comments
8 min read
Building a Plugin System in Go Without `plugin`: 3 Patterns That Actually Ship

Building a Plugin System in Go Without `plugin`: 3 Patterns That Actually Ship

1
Comments
7 min read
Stage 3 vs Legacy TypeScript Decorators in a NestJS App

Stage 3 vs Legacy TypeScript Decorators in a NestJS App

3
Comments
8 min read
Generic-Heavy APIs Hurt Compile Times. Here Is How to Measure It

Generic-Heavy APIs Hurt Compile Times. Here Is How to Measure It

1
Comments
8 min read
Mocking ESM in 2026: Vitest, Bun, and Node's mock.module

Mocking ESM in 2026: Vitest, Bun, and Node's mock.module

1
Comments
9 min read
LLM Response Caching: When the 80/20 Hit Rate Saves the Bill

LLM Response Caching: When the 80/20 Hit Rate Saves the Bill

1
Comments
8 min read
Stop Wrapping Errors in TypeScript. Use `cause` Instead.

Stop Wrapping Errors in TypeScript. Use `cause` Instead.

1
Comments
7 min read
The 7 Anthropic API Errors That Mean Different Things in Production

The 7 Anthropic API Errors That Mean Different Things in Production

1
Comments
8 min read
Spring Boot to NestJS: A Mental Model for Java Developers

Spring Boot to NestJS: A Mental Model for Java Developers

1
Comments
8 min read
Go's cmp.Or and cmp.Compare: Three-Way Comparison Without the Boilerplate

Go's cmp.Or and cmp.Compare: Three-Way Comparison Without the Boilerplate

Comments
7 min read
Reading -gcflags='-m=2' Output: What the Go Compiler Tells You About Inlining

Reading -gcflags='-m=2' Output: What the Go Compiler Tells You About Inlining

1
Comments
9 min read
iter.Seq in Go 1.23+: The Iterator Type Behind range-over-func

iter.Seq in Go 1.23+: The Iterator Type Behind range-over-func

1
Comments
7 min read
`Awaited<T>`, `ReturnType<T>`, `Parameters<T>`: When You're Reaching for the Wrong One

`Awaited<T>`, `ReturnType<T>`, `Parameters<T>`: When You're Reaching for the Wrong One

Comments
9 min read
--isolatedDeclarations: The Build-Time Win for TS Library Authors

--isolatedDeclarations: The Build-Time Win for TS Library Authors

1
Comments
9 min read
Tool-Use Latency Budget: Where the 8 Seconds Actually Go

Tool-Use Latency Budget: Where the 8 Seconds Actually Go

1
Comments
7 min read
RAG Evaluation Beyond Recall@K: Faithfulness, Coverage, Robustness

RAG Evaluation Beyond Recall@K: Faithfulness, Coverage, Robustness

Comments
9 min read
Stop Using `interface{}` Even in Your Generic Code

Stop Using `interface{}` Even in Your Generic Code

Comments
7 min read
Prompt Injection Defense: 6 Patterns That Don't Rely on the Model

Prompt Injection Defense: 6 Patterns That Don't Rely on the Model

Comments
7 min read
Bun Test vs Vitest for TypeScript Library Authors in 2026

Bun Test vs Vitest for TypeScript Library Authors in 2026

Comments
9 min read
Tagged Template Literals That Type-Check SQL: A 60-Line DSL

Tagged Template Literals That Type-Check SQL: A 60-Line DSL

Comments
8 min read
loading...