Yeda AI Knowledge Base
Short, practical tips on AI and AI-assisted engineering — plain-language explainers and hands-on techniques from the Yeda AI team.
Intro to AI →
7 articles
Plain-language explainers on how modern AI actually works — no math required.
What Is AI, Really?
How machine learning flips traditional programming, why nobody programs “cat”, and where you already use AI every day.
Tip #005Your AI Has Creativity Dials: Temperature, Top-K & Top-P
How temperature, top-k, and top-p sampling actually work, when to turn each dial, and what replaced them on the newest models.
Tip #006The System Prompt Is the Director’s Notes
Why the system prompt is the highest-leverage “code” in any AI feature — plus the caching trick that makes a frozen prompt ~90% cheaper.
Tip #007Your AI Is What It Eats: Why Data Quality Beats Size
Frontier models throw away ~99% of the text they collect. Why quality, diversity, and quantity — in that order — decide what a model can do.
Tip #008AI Learns Like a Toddler: The Training Loop
How language models actually learn: guess the next word, check, nudge billions of dials, repeat — and why a trained model is frozen.
Tip #009How Chatbots Get Their Manners: Fine-Tuning in Three Steps
How supervised fine-tuning, human preference ranking, and RLHF turn a raw next-word predictor into a helpful assistant.
Tip #010The AI Onion: AI vs. ML vs. Deep Learning vs. Generative AI
AI, machine learning, deep learning, and generative AI are nested layers, not synonyms — and how to spot which one a product uses.
AI-Assisted Coding →
81 articles
Practical techniques for shipping real software with AI coding agents.
ADRs Are AI Agent Fuel
Architecture Decision Records give AI coding assistants the one thing your code can’t: why you chose what you chose.
Tip #002The 5-Second AI Hallucination Detector
AI-generated code can call APIs that never existed. A type checker in pure-check mode catches it in seconds.
Tip #003Run Two AI Agents at Once with Git Worktrees
Two agents in one folder overwrite each other’s files. Git worktrees give each its own directory and branch on the same repo.
Tip #101Review the Tests First, Split Big Diffs
Read the tests before the implementation to learn intent first — then keep diffs near 100 lines and split anything approaching 1,000 by stacking, file group, or vertical slice.
Tip #102Big Refactor? Write a Codemod, Not Hand Edits
When a refactor touches hundreds of lines, stop hand-editing — write a codemod, sed script, or AST transform so one rule applies everywhere and the diff stays reviewable.
Tip #103That Ugly Code Is Load-Bearing
Chesterton’s Fence for AI-assisted refactoring: run git blame and answer 3 questions before you let an agent delete code it doesn’t understand.
Tip #104Early Returns Kill Nesting, Named Constants Kill Magic Numbers
Two thirty-second refactors that make AI-generated code readable: flip nested ifs into guard clauses, and pull unexplained numbers into named constants.
Tip #105Never Cast an Env Var to Bool
bool(\“false\”) is True — a raw cast silently inverts your kill switch. Parse booleans through one shared true/false vocabulary for env vars and config alike.
Tip #106A Malformed Config Value Should Log and Fall Back
Route every setting through one typed reader that logs a bad value and degrades to a documented default — so a typo becomes a log line, not an outage.
Tip #107Result And Wait Are Deadlocks Waiting
Why blocking on .Result or .Wait deadlocks C# web apps under load — and how to go async all the way down, with cancellation tokens where they matter.
Tip #109Your Site Screams AI-Generated: Grep the Three Tells
The AI-slop look is greppable: purple gradients, centered-everything, one uniform 16px+ radius — three commands find it, three fixes break it.
Tip #110outline: none Without a Replacement Focus Style
One line of CSS locks keyboard users out of your app — how :focus-visible gives them back a focus ring without cluttering the mouse UI.
Tip #111Server State Belongs in a Cache Layer, Not Global State
Backend-owned data doesn’t belong in your global store — put it in a data-fetching cache layer and get caching, dedup, and invalidation for free.
Tip #112AI-Generated UIs Skip the Empty States — Prompt for Every One
AI builds your UI’s happy path; users live on the sad path. A checklist for prompting loading, empty, error, and overflow states — every single time.
Tip #113Never Launch a Goroutine Without an Owner
Goroutines are not garbage collected — every `go` statement in AI-generated Go code needs a cancellation path, a channel owner, and a WaitGroup, or it leaks until the service falls over.
Tip #115Use ?? For Defaults, Not ||
Why `config.port || 3000` silently discards 0, empty string, and false — and how nullish coalescing (`??`) only falls back on null/undefined.
Tip #116forEach Doesn’t Await Anything
Why an async callback inside forEach silently races ahead — and how to choose between for...of + await and Promise.all deliberately.
Tip #117Reject Double Bang in Generated Kotlin
Why every !! in AI-generated Kotlin is a deferred crash, and how explicit nullables and sealed results make the empty case impossible to skip.
Tip #118Ban GlobalScope.launch in Code Reviews
Unscoped coroutines leak work and swallow cancellation — make GlobalScope.launch an automatic review reject and keep every coroutine tied to an owner.
Tip #121That Innocent `if exists` Check Is a Race Condition
Why check-then-act filesystem code is a TOCTOU race, and how one parameter — exist_ok=True — deletes the bug and a line of code at the same time.
Tip #122sum() Streams Lazily, sum([]) Builds First
Drop the square brackets inside sum() and a million-item memory spike becomes a lazy stream — same result, one character less.
Tip #123Two Ifs In A Comprehension? Give It A Function Name
When a list comprehension grows a second condition, expand it into a named generator function — readable, testable, and a pattern your coding agent will copy.
Tip #124Threads Won’t Fix CPU-Bound Python
Threads or asyncio for I/O-bound work, ProcessPoolExecutor for CPU-bound — the one-line decision AI assistants get wrong, and how to check which bound you’re fighting.
Tip #125String += In A Loop Is O(n²), Use Join
Why += on strings inside a loop is quadratic, and the two linear fixes — ''.join() on a list of parts, or io.StringIO for streaming builds.
Tip #126Always Chain Exceptions With 'from e'
Re-raising a wrapped exception without 'from e' buries the original traceback — two words keep the stack trace pointing at the real cause.
Tip #127Protocol Over Inheritance: Structural Test Seams in Python
Use typing.Protocol to swap real dependencies for test fakes with zero base-class coupling — structural typing the checker still verifies.
Tip #130Reject AI-Generated Rails Callbacks That Do Slow Work
AI assistants love after_save callbacks that call APIs — one review rule keeps saves fast, tests offline, and slow work retrying safely in jobs.
Tip #131Enforce Uniqueness in the Database, Not Just the Model
Rails' validates_uniqueness_of is race-prone under concurrent load — keep it for friendly errors, but add a database unique index for the guarantee.
Tip #132Every unsafe Block Needs a Safety Comment
An unsafe block suspends the compiler’s checks — write a // SAFETY comment stating the invariant it upholds, and let reviewers and AI agents verify instead of guess.
Tip #133Never Build Shell Commands As Strings
One unquoted variable can delete the wrong directory. Use Bash arrays for argument lists, quote every expansion, and start scripts with set -euo pipefail.
Tip #134Swap Offset Pagination for Keyset Pagination
On a large, changing table, LIMIT/OFFSET silently skips and repeats rows — keyset pagination pages by the last row’s key instead and stays consistent while the table mutates underneath you.
Tip #135Audit AI-Generated Swift for Task.detached
See Task.detached in AI-generated Swift? Stop and check it — a detached task silently drops cancellation, priority, and actor isolation, and it’s almost always the wrong default.
Tip #136Give Every Suppression an Expiry Date: ts-expect-error over ts-ignore
@ts-ignore stays silent forever; @ts-expect-error errors the moment the underlying bug is fixed, so type suppressions can’t rot in your codebase.
Tip #55Comment The Why, Never The What
Delete the comments that restate your code and keep the one kind that never rots — why-comments that record intent for humans and AI assistants alike.
Tip #56Never Leave Commented-Out Code
Delete dead code instead of commenting it out — git remembers every line, and your AI assistant reasons better over files with zero graveyards.
Tip #57Keep a Rules File for Your Agent
Document your conventions once in a rules file — CLAUDE.md, AGENTS.md, .cursor/rules — and every AI session follows them without you retyping a thing.
Tip #58Document Gotchas Inline, Where They Bite
The bug that cost you a day belongs as a comment right where the next person will hit it — not in a wiki nobody opens.
Tip #59Docs Are Executable Context Now
Nobody read your docs — until your coding agent started reading every word. Why decision records are the highest-leverage context you can write, and how to keep one in 10 minutes.
Tip #60The ADR Alternatives Section Is Gold
Record the options you rejected — pros, cons, and one line on why each lost — so your AI coding agent stops re-proposing ideas you already ruled out.
Tip #61Onboard AI To A New Codebase Like A Human
Give your coding agent the same onboarding a new hire gets — a fixed five-step recon order plus one traced request — so its code matches your conventions.
Tip #62Trace One Real Request End-To-End
The fastest way to understand any codebase: follow one real request from the entry point to the database and back — then hand that map to your AI agent.
Tip #63Record the Local Dialect So AI Code Blends In
A 3-item conventions checklist — naming, patterns, house rules — that makes AI-generated code match your codebase instead of a generic default.
Tip #64The SMIG Rule: Situation, Mechanism, Implication, Gotcha
A four-part rule for onboarding docs and code tours: skip what the code shows, spend your words on implications and gotchas.
Tip #65Don’t Dump A File Tree And Call It Onboarding
A folder listing tells your coding agent what exists, not what to act on — replace the raw dump with five narrated moves that trace the real path through the system.
Tip #66Tour Files: Persona-Targeted Code Walkthroughs
Turn onboarding into a guided route: .tour files anchor step-by-step walkthroughs to real files and lines, one tour per persona, played back inside the editor.
Tip #67Verify Every Claim Against the Code
READMEs drift; the code doesn’t. How to onboard to any repo by tracing one real request end to end and verifying every claim against source.
Tip #68Run Your Native Test Suite Under Sanitizers
Why ASan, UBSan, and TSan catch the C/C++ bugs a green line-coverage report ships — and how to wire them into the tests you already have.
Tip #69Trap Every Crash Before You Fix It
Write the failing regression test before the fix, run it under a sanitizer, and the bug can never silently come back.
Tip #70Don’t Trust In-Memory Database Tests
In-memory database fakes skip SQL translation — the query that passes in tests can still break in production. When and how to test against the real engine.
Tip #71Assert All Four UI States
Most widget tests only check the happy render — here’s how to assert loading, empty, error, and success, with the mocking patterns that make each state reachable.
Tip #72Never waitForTimeout — Wait for the Actual Network
Fixed sleeps make E2E tests slow AND flaky at the same time — replace every one with a wait on the real condition: a network response or an auto-retrying assertion.
Tip #73Make a Flaky Test Fail Ten Times on Purpose
Reproduce a flaky test locally with --repeat-each=10 (and its pytest/Go equivalents) instead of burning a week of CI retries.
Tip #74Inject Clocks, Random Seeds, and Temp Dirs
Flaky tests almost always read a hidden input — the real clock, a shared RNG, or a common temp dir. Inject all three and the same inputs give the same result on every run.
Tip #75Slice Tests, Not a Full Boot
Why @SpringBootTest should be the exception, not the default — use @WebMvcTest and @DataJpaTest slices for faster feedback, and teach your AI assistant the same habit.
Tip #76Shuffle Your Test Suite to Expose Order-Dependent Tests
Run your suite in random order to surface shared-state bugs on your machine — with the exact shuffle and seed flags for Vitest, Jest, pytest, Go, and RSpec.
Tip #77A Test That Passes Against Empty Code Tests Nothing
If your suite stays green after you delete the production code, it asserts nothing. The five-minute audit, the placeholder smells, and the tools that automate the check.
Tip #78Never Launch Real Coroutines in Tests
Why real dispatchers make async tests flake in CI — and how injected TestDispatchers, virtual time, and full Flow lifecycle tests make them deterministic.
Tip #79One Fixture, Three Databases
Parametrize one pytest fixture across SQLite, PostgreSQL, and MySQL and every test that uses it runs once per backend — 3x coverage from one decorator.
Tip #80Tag the Slow Tests, Get Your Inner Loop Back
Use pytest markers to split slow integration tests from fast unit tests, so every save runs in under a second while CI runs everything.
Tip #81Always Mock With Autospec True
A plain Mock says yes to methods that don’t exist — patch with autospec=True so your tests fail when AI-generated code misuses a real API.
Tip #82Async Mocks: Assert Awaited, Not Called
assert_called_once passes even when your code forgot the await — assert_awaited_once is the assertion that actually catches the bug.
Tip #83Never Disable Warnings in Pytest
Deprecation warnings are early failure signals — why silencing pytest warnings trades a noisy test run today for a production break tomorrow, and how to filter with precision instead.
Tip #84pytest --lf: Re-run Only What Broke
Shrink your debug loop from minutes to seconds with pytest --lf, -x, --ff, and --sw — and why it matters even more when an AI agent is doing the debugging.
Tip #85100% Test Coverage Is a Red Flag, Not a Badge
Why chasing 100% coverage suite-wide wastes effort — target ~80% overall and push auth, payments, and data mutation toward 100% branch coverage instead.
Tip #86Test Background Jobs for Idempotency and Retries
Queues deliver at-least-once, so every job will eventually run twice — here’s how to test that a duplicate run charges once, emails once, and recovers cleanly after a crash.
Tip #87Flaky Tests Trace To Time, IO, Or Randomness
A test that passes sometimes almost always touches real time, real files, or real randomness — inject all three and the flake disappears.
Tip #88Make Docs Executable: Doc Tests
Compile the examples in your docs as part of the test suite — Rust doc tests, Python doctest, and pytest patterns that make stale documentation fail CI.
Tip #89Run Shell Scripts Through ShellCheck First
Lint AI-generated bash with ShellCheck before you test it — most shell bugs are static quoting and portability issues a linter catches in seconds.
Tip #90Test Shell Scripts From a Path With Spaces
Run your shell scripts from a temp directory whose path contains a space — quoting and cwd bugs break loudly, for free, before they break in production.
Tip #91Test Data Invariants at the Database Layer
Why app-layer validation isn’t enough — prove unique keys, foreign keys, and check constraints on a real, disposable database that matches production.
Tip #92Fake the Network, Persistence, Clocks — and Permission State
You already fake the network and the database in tests — inject a fake for permission state too, so the denied branch stops shipping broken.
Tip #93Prove The Bug Before You Fix It
Make your AI coding agent write a failing test that reproduces the bug before touching the fix — proof it exists, proof it’s gone, and a permanent guard.
Tip #94Have a Separate Subagent Write the Reproduction Test
Split the reproduction test from the fix — a fresh subagent writes the failing test without seeing the fix, so shared blind spots can’t rubber-stamp a broken patch.
Tip #95The Tautology Mock
When a mock returns the exact value the test asserts, the test passes with zero production code running — how to spot tautology mocks and replace them with real implementations or in-memory fakes.
Tip #96Keep Tests DAMP, Not DRY
Why duplication is fine in tests: DAMP (Descriptive And Meaningful Phrases) beats DRY when a failing test has to explain itself.
Tip #97Have the Agent Discover the Project’s Own Commands
Stop your AI agent from guessing pytest or npm test — make it read package.json, pyproject.toml, the Makefile, and CI to find the repo’s canonical commands.
Tip #98Never Trust AI-Written Tests To Validate AI-Written Code
When one model writes both the code and its tests, they can share the same wrong assumption — a green suite proves consistency, not correctness. Here’s how to break the loop.
Tip #99A Raw Owning Pointer in C++ Is a Review Blocker
Why a raw owning pointer should fail C++ code review — and the RAII checklist (unique_ptr, shared_ptr, span, rule of zero) to enforce on AI-generated code.
TipCheck context.mounted After Every await
Why Flutter apps crash after slow async calls — and the one-line context.mounted guard that fixes use-after-dispose for good.
TipOne Model Writes, a Different Model Reviews
Why the model that wrote your code can’t be trusted to review it — and how a two-model write/review loop with a human final call catches far more bugs.
TipJava Optional Is a Return Type Only
Optional was designed for one job — method return types. Why fields, parameters, and unchecked .get() fight the design, and the patterns to use instead.
Claude Code →
5 articles
Getting more out of Anthropic’s coding agent: context, plans, rules, and subagents.
Plan Before You Prompt: Review the Plan Before Your AI Agent Touches Code
Put your coding agent in plan mode before it edits a single file. One keystroke gets you a reviewable, editable plan instead of a surprise diff.
Tip #012Keep Your Rules File Lean
Your CLAUDE.md gets loaded into every request — a bloated rules file wastes context and dilutes instructions. Here’s what belongs in it and what doesn’t.
Tip #013Give Grunt Work Its Own Agent: Subagents for Context Isolation
How Claude Code subagents isolate context — delegate noisy research to a helper agent with its own window so only the summary lands in your main thread.
Tip #014Make It Ask First: The 95%-Confidence Prompt
Stop revision loops before they start — tell Claude Code to ask clarifying questions until it’s 95% confident, then push it to name what you’re missing.
Tip #015Keep Your Context Fresh: Fighting Context Rot in Claude Code
Long Claude Code sessions quietly lose quality — context rot. Learn when to /clear, when to /compact with keep-notes, and how to watch your context percentage.
Prompt Engineering →
5 articles
The structure, context, and examples that turn a vague prompt into reliable output.
The Six-Part Prompt Order That Stops AI From Guessing
A messy long prompt fails for the same reason a messy meeting agenda fails — order, not length, is the fix. The five-part structure that gets it right first try.
Tip #017Treat AI Like a New Hire — Better Prompts in One Mindset Shift
A one-line prompt gets you a generic answer for the same reason a one-line brief to a new hire does. The context-first mindset that fixes both.
Tip #018Stop Describing the Output — Show It Examples Instead
Describing the format you want in words is slower and less reliable than showing the model two or three examples — the few-shot prompting trick, explained.
Tip #119Match the Model Tier to the Scope
Classify every task from trivial to epic before you pick a model — fast tiers for one-line fixes, deep reasoning tiers for architecture — and stop paying flagship prices for typo fixes.
Tip #120End Every Prompt With a Do-NOT Section
Why a 3-line Do-Not section at the end of your prompt stops AI agents from over-building — plus which boundaries to set and where permanent ones belong.
Agentic Workflows →
25 articles
Tool-agnostic habits for getting dependable work out of any coding agent.
Write The Spec First
A short spec — what, why, constraints, tasks — stops your coding agent from guessing the details you didn’t mention.
Tip #020Match Effort To Task Size
Running several agent sessions at once? Set each one’s reasoning effort to match its task so quick questions don’t wait behind deep ones.
Tip #021Bash Or MCP
Don’t wire an MCP server for tools your agent can already reach with bash. A decision rule for when a server actually earns its keep.
Tip #137Order CI Stages Cheapest and Most Likely to Fail First
Stop wasting ten minutes to catch a typo — order your CI so the cheapest, most likely-to-fail checks run first and fail fast.
Tip #138Never Make a Flaky Test a Required Gate
A test that passes on retry is a defect, not a hiccup — quarantine it so the required gate keeps meaning something and your team never learns to just hit retry.
Tip #141Plan the Funeral Before You Build
When you design anything new, ask how you’d delete it in three years — the answer forces clean interfaces, flags, and a small surface area that stays cheap to kill.
Tip #142Hyrum’s Law: With Enough Users, Even Bugs Get Depended On
With enough users, every observable behavior of your system becomes an API someone depends on — which is why deprecation is a migration you run, not a memo you send.
Tip #143Ask What Your Agent Didn’t Touch
Make every agent change end with a Changes / Didn’t-touch / Concerns summary so scope creep surfaces before your reviewer finds it.
Tip #146Stop Your Agent Every 100 Lines to Test
Never let a coding agent write more than ~100 lines before you test — thin vertical slices keep bugs small, local, and cheap to fix.
Tip #147Tell Your Agent to Note, Not Fix, Out-of-Scope Issues
One CLAUDE.md rule keeps a coding agent from bloating your pull request — when it spots an unrelated problem, it writes it down instead of fixing it.
Tip #148Make Your First Task a Tracer Bullet
Your first task should be a tracer bullet: the thinnest slice through every layer that proves the path before you build wide.
Tip #149If a Task Title Contains “And”, Split It
The word “and” in a task title usually hides two tasks. Split until each fits in ~5 files, ≤3 acceptance bullets, and one focused agent session.
Tip #150The Bug in an AI PR Lives in the Callers
The bug in an AI-generated PR usually isn’t in the diff — it’s in the callers the diff never shows you. Review the blast radius, not just the changed lines.
Tip #151Read the Tests Before the Code
In a pull request, read the tests first and the code second — the tests encode the author’s intent, and a risky path with no test is itself a finding.
Tip #152Make Your AI List Its Assumptions Before It Writes Code
One instruction — 'list every assumption, then wait for my correction' — catches the misunderstanding while it still costs a sentence to fix instead of an afternoon of rework.
Tip #153An Untested Rollback Is Not a Rollback
A rollback plan you have never exercised is a hope, not a plan. Prove the kill switch turns the feature off in seconds — before launch, not during the incident.
Tip #184Add One Line to Every AI Research Prompt
Ask an AI a broad research question and it mirrors back what you already believe. One line forcing contrarian evidence and downside cases turns confirmation bias into a real decision brief.
Tip #185When Structure Won’t Come, Skip the Outline
Forcing an outline before you have the spine of a piece builds a skeleton you write to, and it reads like it. Dump every fragment into one file and let structure emerge one paragraph at a time.
Tip #186Ban AI From Simulating Specificity
AI cold email’s deadliest move is faking specificity. Ban the model from inventing anchors and require one real, verifiable observation per email, or flag the draft as not ready.
Tip #188Force Ambiguous Choices Into a Strict 3-Line Brief
When an AI hits an ambiguous choice it hands back three hedged paragraphs that end in 'it depends.' Force a three-line decision brief — ELI10, Stakes, Recommendation — so it must commit to one pick.
Tip #189Make the Stakes Concrete: Blast Radius, Reversibility, Time Cost
'Could cause issues' is not a risk assessment. When an agent surfaces a decision, make it name the blast radius, whether it’s reversible, and the time cost of getting it wrong.
Tip #190Never Pass Your Conclusion to a Reviewer Agent
Hand an AI reviewer your conclusion and it validates your conclusion. Give it only the artifact and the contract, prompt it to find what is wrong, and it surfaces the issues you could not see.
Tip #191Cap Adversarial Review at Three Cycles
Adversarial self-review catches blind spots, but looping it forever just stalls on the same findings. Cap it at three cycles; if real issues survive, that’s information about the artifact, not a reason to loop again.
Tip #192Block Your AI’s First Edit
Agents edit files they never actually read. Block the first mutation until the agent lists importers, names affected public functions, and shows real data shapes. No facts, no edit.
Tip #193Make Your AI Quote Your Instruction Verbatim
Agents quietly reinterpret your request and build a polished version of something you never asked for. One line — quote my instruction back word for word before touching code — surfaces the drift instantly.
Skills & MCP →
12 articles
Extending agents with skills and tools that actually fire when they should.
Let Claude Write Your Skills
Stop hand-writing SKILL.md files. Anthropic’s official skill-creator skill interviews you in plain English, then drafts, tests, and packages the skill for you.
Tip #023Skill Triggers That Fire
Claude decides whether to use a skill from its name and description alone, never the full file — here’s how to write a description that actually fires.
Tip #024Give Your Skill a Report Card
Numeric self-scores lie. Build a pass/fail evals file for your skill’s output, grade it with a separate clean-context agent, and loop until every check passes.
Tip #187Index Your Docs, Don’t Dump Them
Stuffing every methodology doc into your agent’s context burns the budget and buries the one file the task needs. Build a lightweight index that maps task to doc, and load only what’s needed.
Tip #195Adapting Someone Else’s Methodology? Rewrite It and Sign It
The moment you adapt someone’s AI rules or methodology into your workspace, you own it. Rewrite it in your own voice, strip the vendor branding, and sign it — a stale copy of someone else’s file rots.
Tip #196Keep Skills Flat, Keep Helpers in Source
Nesting scripts and helpers inside each AI skill duplicates untested logic that quietly drifts. Keep skills as flat, self-contained methodology files; put deterministic code in your real, tested source tree.
Tip #197Audit Your Skill Library Quarterly With Grep
AI skills rot like code, silently. Every quarter, grep your skill library for unreferenced files, front-matter drift, and stale tool names so your agent stops loading the wrong thing.
Tip #198Past 700 Lines, Split the Skill
An 800-line AI skill file gets skimmed, not read. Past about 700 lines or when it covers multiple topics, split it via progressive disclosure — keep the original filename as an overview entry so every reference still resolves.
Tip #199Force an Assumptions Block Before Any Non-Trivial Task
The most common way an AI agent wastes your time is running with wrong assumptions on ambiguous requirements. A four-line assumptions block turns silent guesses into a cheap checkpoint.
Tip #200Tell Your AI That Sycophancy Is a Failure Mode
By default your assistant agrees with you and ships your bad idea with enthusiasm. Make it name the problem, quantify the downside with a number, and propose an alternative before it accepts your call.
Tip #201Score Your CLAUDE.md Like a Linter
Your CLAUDE.md loads into context on every turn, so bloat, contradictions, and platitudes tax every prompt. Score it like a linter — start at 100, deduct for each contradiction and redundancy — then cut what lost points.
Tip #202Every Registered MCP Server Costs Tokens on Every Turn
Every registered MCP server injects its tool schema into context on every turn, whether you use it or not. Audit what’s registered, replace cloud servers with plain CLIs where you can, and unregister the rest.
Codex →
3 articles
Configuring and running OpenAI’s coding agent, from a lean AGENTS.md to parallel worktrees.
Set Codex’s Leash Before It Runs: Sandbox Mode and Approval Policy
How OpenAI Codex’s sandbox mode and approval policy work together, and why workspace-write + on-request is the safe default for real projects.
Tip #026One File Codex Reads Before Anything Else: Writing a Lean AGENTS.md
How to write a lean AGENTS.md so OpenAI Codex reads your project’s conventions before writing a line of code, instead of you repeating them every prompt.
Tip #027Stop Watching One Codex Agent Work: Parallel Agents with Git Worktrees
How to use git worktree to run several OpenAI Codex agents on the same repo at once, each in its own folder, without them colliding.
Cursor →
3 articles
Editor-native AI: set your rules once, undo fearlessly, and keep the docs current.
Cursor Rules: Set It Once
How to write a Cursor Rules file once so Cursor applies your coding standards to every prompt, instead of you re-explaining them each time.
Tip #029Feed Cursor Live Docs
How to use Cursor’s docs feature to index live documentation so it stops guessing outdated syntax for libraries and APIs.
Tip #030Restore Checkpoint: Your Undo Button
How Cursor’s restore checkpoint feature lets you revert an AI agent’s edits back to before a bad change happened, without manually undoing anything.
GitHub Copilot →
3 articles
Scoping Copilot’s context and handing it the work you would rather not do yourself.
One File So You Stop Repeating Yourself To Copilot
Stop retyping your team’s coding conventions into GitHub Copilot chat. Put them in .github/copilot-instructions.md once and Copilot applies them automatically.
Tip #032Stop Letting Copilot Search The Whole Internet
Vague GitHub Copilot Chat answers usually mean an unscoped question. Use @ participants and / slash commands to point Copilot at the right source.
Tip #033Assign Your Backlog To Copilot, Not Yourself
Assign a GitHub issue to Copilot’s coding agent and it works the task in the background, opening a pull request with a live plan for you to review.
Building AI Apps →
26 articles
Putting a model behind a product without wiring yourself to a single vendor.
Stop Asking Nicely For JSON — Define a Schema Instead
Prompting an AI to “respond in JSON” is brittle — nested fields end up wrong, keys get invented. Structured outputs (schema-constrained generation) fix it at the source.
Tip #035Swap The Model, Not The App
A new AI model ships almost every week. Put every model call behind one interface so switching providers is a one-line config change, not a rewrite.
Tip #036Set The Loop, Not The Script
Give an AI agent tools and a step cap instead of hand-coded branches after each call — feed results back until it’s done, and trim what you feed back.
Tip #129Put a Confidence Score Between Regex and the LLM
Score every parse before you escalate: let regex keep the easy 95%+ and spend LLM calls only on items below your confidence threshold.
Tip #156Shrink Your Repro Before Debugging
Your debugging speed is capped by your repro loop. Shrink the input, run the one failing test, and pin seeds and clocks before you test a single hypothesis.
Tip #157That Error Telling You To Run This Fix Might Be An Attack
Error messages, stack traces, and CI logs are untrusted data — never instructions. Why your agent can be owned by text in its own output, and how to defuse it.
Tip #158Never Hand-Roll Retry Logic
Reach for a proven retry library, retry only transient errors, and never retry a 4xx — because a client error can never succeed no matter how many times you loop.
Tip #159Return a Result Type for Failures You Expect
Stop throwing exceptions for failures you know will happen — return a typed Result so the compiler forces the caller to handle the error path.
Tip #160Redact Secrets at the Logger Config, Not at Every Call Site
One `log.info(request)` can leak every API key into your logs. Move redaction into the logger config so a scrub happens on every event and can’t be forgotten.
Tip #161Never Put user_id In A Metric Label
One innocent metric label like user_id can 10x your metrics bill — here’s why cardinality explodes and which labels are safe.
Tip #162Plain Backoff Is a Thundering Herd
Plain exponential backoff synchronizes failed clients into a self-inflicted DDoS — add full jitter so retries spread out and the dependency can recover.
Tip #163Breaker Outside, Retry Inside
Stack a circuit breaker and a retry in the wrong order and you break both — here’s why breaker(retry(call)) is the only composition that fails fast and protects your latency budget.
Tip #164Make Your AI Read package.json First
Your assistant writes framework code from frozen memory. Make it read package.json for the exact versions and fetch the matching docs before it types a single line.
Tip #165Make Your AI Say UNVERIFIED
A confident hallucinated API signature reads exactly like a real one and costs you an hour — force your AI to cite official docs or label the line UNVERIFIED.
Tip #172Randomize What You Do Not Guarantee
Your API’s bugs become someone’s features. With enough users every observable behavior gets depended on. Deliberately vary what you never promised so callers cannot silently couple to it.
Tip #173Ship a Stable, Machine-Readable Error Code
Your error messages are a secret API. The moment callers regex your prose, you can never reword it. Ship a stable machine-readable code they switch on, keep the human message free to change, and flag which errors are retry-safe.
Tip #174More Services Than Engineers Is a Smell
Microservices earn their keep when teams own services independently at scale. When your deployable artifacts outnumber your engineers, you pay the distributed-systems tax every day and never see the benefit. Match services to team size, not to hype.
Tip #175Delete It. Did Things Get Simpler?
A module whose interface is nearly as complex as its implementation hides no complexity — it just adds a hop. Run the delete-and-inline test: if folding it back in makes the system simpler, it was a shallow passthrough. Prefer deep modules.
Tip #176Any Bash Script Past 200 Lines Belongs in Python
Bash lacks data structures, real error handling, and testability. Once a script passes ~200 lines with conditionals, rewrite it in Python or another real language — you get shorter code, real error handling, and a test suite instead of crossed fingers.
Tip #177Use a Postgres Table Before You Reach for a Queue
Teams reach for SQS or RabbitMQ by reflex, then operate a whole new system for low-volume work. If you already run Postgres and your producers and consumers share a deployment, a plain table is a fine queue — and you can graduate later if you truly outgrow it.
Tip #178Score Every Tool by Its 12-Month Cost
A tool’s landing page sells the first week. The real bill arrives in month twelve as on-call pages, hiring drag, licensing, and lock-in. Score every choice by its 12-month cost.
Tip #179Make Your Rules File a Map, Not a Library
Every line in an always-on rules file is a tax paid on every turn. Stuff it with detail and you drown the signal. Keep a small durable core, then point to files the agent loads only when a task needs them.
Tip #180Prune Your MCP Servers: Every Tool Schema Is Always-On Cost
Each connected tool’s schema is loaded on every turn, and too many tools degrade selection accuracy, not just token count. Expose the few tools a task needs and cut the rest.
Tip #181Grep AI-Written Data Fetching for the N+1 Query
AI loves to put a query inside a for-loop: fetch a list, then hit the database once per row. That’s the classic N+1, and it scales terribly. Grep for it before you merge and replace it with a single join.
Tip #182Overusing React.memo and useMemo Is a Red Flag
useMemo everywhere is not making your app faster. Memoizing every value and component adds complexity and comparison cost. Profile first, then memoize only the bottleneck the numbers prove matters.
TipRegex First, Model for the Edges
For consistent-format text, regex handles ~95–98% of extractions deterministically — route only the low-confidence leftovers to an LLM and cut your bill dramatically.
Building AI Agents →
8 articles
The design decisions that separate agents which work from agents which merely demo well.
Agent or Workflow? Ask Before You Build
Not every automation needs an AI agent. Learn how to tell a predictable process from a genuinely unpredictable one, and build the cheaper, more reliable option.
Tip #038Describe Your Tools Like You’re Training Someone New
An agent only picks the right tool if the description tells it exactly what the tool does and when to use it. Here’s how to write descriptions and docstrings that actually work.
Tip #039One Agent, One Job: Why Specialist Crews Beat Generalists
One agent trying to research, judge risk, and write the report isn’t one job — it’s three. Split bloated single-agent workflows into a crew of specialists.
Tip #144Force Three Genuinely Different Approaches
Ask an AI for a plan and it converges on the first idea, then pads it with strawmen — force at least three genuinely different approaches to widen the option space before you narrow.
Tip #145Never Accept Your AI’s First Plan Without the Loser
A recommendation with no rejected alternative is a default, not a decision. Force your agent to diverge, then converge — and always demand the runner-up and why it lost.
Tip #154Log a Hash of the Messages Array Before Every Call
Your agent looks broken but the model is fine — your wrapper is rewriting history between calls. Hash the messages array before each request and the mutation shows up in one log line.
Tip #155Count Your Model Calls Per Turn
One user turn can fire five model calls when a framework silently re-asks on a bad answer — here’s how to count the real number and bound the loop.
Tip #183Don’t Ask AI to Research. Ask It Five Questions
A vague research this topic prompt gives a shallow answer. Break the topic into three to five sub-questions, fan them out to parallel subagents that read real sources, then synthesize one cited report.
RAG & Vector DBs →
3 articles
Retrieval that finds the right chunk — and refuses to answer when it doesn’t.
Chunk With Overlap: Stop Losing Meaning at the Boundary
Why naive fixed-size chunking breaks RAG answers, and how a recursive splitter with overlap (chunk_size~1000, chunk_overlap~200) fixes it.
Tip #041Refuse On Empty Context: The One Check That Stops RAG Hallucinations
How to add a similarity-score threshold to your RAG pipeline so weak or empty retrieval returns an honest refusal instead of a confident hallucination.
Tip #042Hybrid Search + Rerank: Fix Embeddings' Blind Spot for Exact Matches
Why pure embedding search misses exact-match queries like order numbers, and how combining BM25 keyword search with reranking fixes it — with real NDCG numbers.
Fine-Tuning →
3 articles
When to adapt a model instead of prompting it, and how to do it without burning a GPU budget.
Freeze the Model, Train the Adapter: How LoRA and QLoRA Cut Fine-Tuning Memory
LoRA freezes a base model’s weights and trains two small adapter matrices instead — here’s why that slashes GPU memory for fine-tuning without giving up much quality, plus how QLoRA pushes it further.
Tip #044Garbage Format In, Garbage Answers Out: Matching the Chat Template Before You Fine-Tune
A fine-tune that answers with broken text and stray tokens usually isn’t a data problem — it’s a chat-template mismatch. Here’s what a chat template is and how to apply the right one before training.
Tip #045A Model That Memorizes Isn’t Smart: Watching the Loss Curve to Stop Overfitting
Train a fine-tune for too many epochs and it stops generalizing and starts reciting your training data. Here’s how to read the loss curve and cap epochs before that happens.
Local LLMs →
3 articles
Running open models on your own hardware: private, offline, and free.
Run Any Open A.I. Model on Your Own Computer, Free
Install Ollama and run open A.I. models locally with one command — no cloud bill, no per-token cost, nothing leaves your machine.
Tip #047Lock In a Local Model’s Behavior With a Modelfile
Write a two-line Ollama Modelfile to permanently set a local model’s rules or personality, then run it as its own named model.
Tip #048Chat With Your Own Files, Locally: RAG in Plain Terms
Connect a local A.I. to your own notes or documents with RAG, so it checks your real files before answering — no fine-tuning required.
LLM Evals & Safety →
12 articles
Measuring whether your AI actually works, and containing the damage when it doesn’t.
Guardrails Are Two Checkpoints, Not One
Most AI guardrail setups only check one side of the conversation. Here’s why you need an input check and an output check, and how to build both.
Tip #050A Prompt Will Break, So Limit the Blast Radius
You can’t filter out every prompt injection. Here’s how to limit what a hijacked AI agent can actually do with least-privilege tools and human approval.
Tip #051Your A.I. Judge Has Favorites, Check For Them
LLM-as-judge scales evaluation past manual review, but it inherits biases. Here’s how to run a positional-swap test before you trust the score.
Tip #139Run One Unit Before You Scale
Before you run 10,000 AI calls, run one. Measure the real cost, then scale — with the exact per-unit math and the 50% batch discount.
Tip #140Put a Hard Per-Job Cap on Every Automated AI Call
A bug in an automated AI job should produce a bounded bill, not an unbounded one — cap tokens, items, and time per call, then put a budget alarm on the account.
Tip #166Secrets Deleted in a Later Docker Layer Still Live in History
A secret copied or used in a Dockerfile RUN step is baked into that layer forever — deleting it later doesn’t erase it, and anyone can extract it with one command. Use build secrets instead.
Tip #167Replace Long-Lived AWS Keys With OIDC
Static AWS access keys in CI never expire, so a single leak works until someone notices. Swap them for OIDC role assumption and get short-lived credentials with nothing stored to steal.
Tip #168Audit Postinstall Scripts on Any Package
npm install can run a stranger’s shell script the moment you install. Audit postinstall and prepare hooks and flag any that reach the network or shell, so you catch supply-chain code execution before it runs.
Tip #169The System Prompt Is Not a Security Boundary, Code Is
A do-not-reveal instruction in your system prompt stops nothing, because a motivated user can talk the model out of any instruction. Enforce security with deterministic code that brackets the model call: an input screen before, an output scrub after.
Tip #170Your Agent Config Is an Attack Surface
Instruction files, settings, and MCP server configs steer your coding agent, so a hidden instruction or a leaked key in there is a real breach path. Scan them like code for wildcard permissions, hardcoded secrets, and injected instructions.
Tip #171When Your Pipeline Reads Uploads, the Content Is the Attacker
When your AI pipeline ingests uploads or scraped pages, the content itself is the attacker. Treat untrusted content as data, never instructions: delimit it before the model sees it, and never let it flow unescaped into a shell, SQL, or a file path.
Tip #194Give Each Severity Level a Confidence Floor
When every AI finding is flagged critical, people stop reading. Gate each severity on a confidence floor and downgrade a tier under uncertainty, so a critical actually means stop and fix.
Model Comparisons →
3 articles
Compare models on work that resembles yours, then route each task to the right one.
Route Tasks to the Right Model
No AI model wins every task. Here’s how reviewers route writing, coding, reasoning, and stuck bugs to different models instead of picking one favorite.
Tip #053Don’t Trust Plan Mode Blindly
“Plan mode” is supposed to mean read-only. One tester caught a model editing files anyway. Here’s how to verify plan mode actually holds before you trust it.
Tip #054Test Models on Hard Tasks, Not Easy Ones
Easy prompts make every AI model look interchangeable. Here’s how one deep tester built a private, messy benchmark to see the real gaps — and why you still need human review.
Open Source vs Closed Source →
6 articles
Open-weight vs proprietary models: what open really means, the true cost of a token, and when each one wins.
Cost Per Task, Not Per Token
A model that’s half the price per token can cost the same per finished task, because the cheap one burns twice the tokens. Here’s the number to actually compare.
Tip #204Open Weights Isn’t Local, and Isn’t Free
The thumbnails say free, local, open source. Only one of those three is really true for a frontier open-weights model. Here’s what open weights actually buys you — and what it doesn’t.
Tip #205Plan Expensive, Build Cheap, Review Sharp
Don’t hand one coding task to one model. Split it across three: plan with your strongest model, execute with a cheap fast one, review with a second frontier model. Same result, roughly a third of the cost.
Tip #206Point Your Coding Agent at an Open Model
Your coding agent doesn’t care which model sits underneath. Point its env vars at a provider serving an open model and the harness never notices. Here’s how — and when to keep a frontier model one flag away.
Tip #207Caching Is Where Open Models Get Cheap
Open models look cheap per token — until the bill lands. Input caching is the setting that makes them actually cheap.
Tip #208Benchmarks Flatter New Models
A new open model “ties the frontier” on the charts, then takes about 90 minutes and 21M tokens to do what the leader did in 17. Benchmarks flatter new models — run your own hardest task before you switch.