Saurabh Kumar

#ai

Working with AI: practice, review, opinion, AI products, general ML

Includesharnessllmpi-agentclaude-code

Writing

TIL notes

  • The way agents ‘read’ code is different - good agents are all about gathering data about how the code works. They’ll prod around with it, execute parts of it.

    So ‘readability’ to agents really means ‘verifiability’. How easy it is to mess about with that code to see it working.

    Let’s take this scenario:

    • You have a huge module in your codebase that uses all sorts of complex performance tricks

    • It has 100% test coverage

    A talented human would need an hour or two to get comfortable working in that module.

    An agent needs zero time. They verify it with the tests, poke about a bit, and they’re good to go.

    — Matt Pocock, on code readability in the age of agents
  • Experts go with their AI agent's answer

    Anthropic gave 50 data analysts a Claude Code agent and a realistic analysis with four open decisions. Each decision had two reasonable answers. In secret, a coin flip told the agent which answer to argue for. It had to argue honestly.

    The analysts picked the agent’s answer 86% of the time. Afterwards, 77% explained their answers with the agent’s arguments, sometimes word for word. Only 15% gave the agent credit. Analysts who said “it was my decision” picked the agent’s answer just as often as the rest.

    • The coin flips alone predicted 82% of the final recommendations. The agent didn’t need to argue for the recommendation. It had already picked the inputs.
    • With no instructions to argue for anything, Opus 4.8 gave the same five answers in 112 of 123 runs. Ten teams on one model agreeing is one model agreeing with itself.

    This is the limit of my meat proxy note. Rewriting AI output in your own words proves you read it. It doesn’t prove the decision was yours. For the two or three decisions that matter, write down your answer before you ask the agent.

    Discuss on Mastodon

  • Your job is not to use agents to help you write code. Your job is to lead the agents to help them write code.

    — Uncle Bob Martin, paraphrasing the CTO of Proton

    Discuss on Mastodon

  • skill-diet

    nicobailon/skill-diet is an agent skill that slims your other agent skills, then proves the slim version still works. It runs each task with the old skill, the new one and no skill at all, 3 times each, and keeps the cut only if the new one scores at least as well.

    I ran it on three of my skills with gpt-6-luna:

    • adr: SKILL.md went from 13 KB to 1.6 KB, 30/30 before and after. With no skill it still passed 26/30. The model already knew ADRs.
    • notion: 32/33 to 33/33 at 55% fewer tokens per run. With no skill, the agent did one-line edits with a whole-page replace and reported success.
    • web-browser: 16 KB to 6.4 KB. The no-skill runs used twice the tokens of the old skill, because the agent explored the scripts by hand.

    The size cut was not the best part. For a skill that wraps a tool, it checks every claim against the tool and your session logs. It found 16 places where my skills or scripts were wrong, such as agent.mjs --domain x.com silently setting no allow-list. The rule I’m keeping: fix the tool’s error message before adding a line to the skill.

    The cost: 1,434 agent sessions and 23.5M tokens for three skills, and a sandbox-exec profile, because the test agents kept finding my installed skills on disk.

    The diet commit shows what got cut, and the full report covers the method and the costs.

  • AI tricks get folded into the product

    Charles Miller: “a skill that can be picked up in a few weeks, and will be obsolete in a few months, has no value outside the moment.” His mechanism: a prompt trick that works gets folded into the product and ships as the default a few months later. His analogy is the 1990s C belief that ++i beats i++, which survived long after compilers erased the difference.

    He’s right about tricks, but not every AI skill is a trick. Verification, choosing context and deterministic gates depend on your problem, not the model, so no release absorbs them. Ron Minsky argues they matter more with agents. My test when I learn something: is this about the model or about the problem? Model tricks go in a skill file I can delete on release day.

  • Ron Minsky: types, expect tests and review matter more with agents

    Ron Minsky’s Bug Bash 2026 talk argues Jane Street’s old habits (rich types, expect tests, real code review) matter more with agents: they give the model fast, exact feedback and keep the code readable for the humans who own it. He goes the other way from the Claude Code team on review: its main job is keeping a human able to explain the system, not catching bugs.

    The idea I’m taking: expect tests. The test prints output, the expected text lives inline, and a change shows up as a diff of behavior, not just code. Python’s version is inline-snapshot: assert result == snapshot(), filled in by pytest.

    • Gotcha with agents: under --inline-snapshot=fix (or create, review) every snapshot comparison returns True and the file is rewritten. An agent chasing green doesn’t need to delete a test; it re-accepts the wrong output. Keep acceptance with a human and never auto-fix in CI.
  • Django Seedkit

    viewflow/seedkit is an agent skill that scaffolds a Django project by asking you questions, then writes only the parts you picked. The edge over cookiecutter: it also works on a live repo. /django-seedkit add proper auth inventories what exists and wires the new package in midway: deps, settings, .env example, CI step. A deterministic generator runs once, on day zero.

    The layout is the part worth copying. One SKILL.md walks the questions and routes each answer to exactly one file in references/ (auth.md, billing.md, tasks-celery.md, about 50 of them). Each file keeps only what the model gets wrong: current setting names, current packages. Their benchmark: Sonnet 5 with the skill passed 72 of 72 security and config checks across nine projects; Fable 5 without it missed about a quarter.

    The pattern generalizes past Django: one orchestrator skill that asks the questions, plus a reference pack per stack (Django, Next.js, Flutter). Seedkit ships only the Django pack today.

  • EmbeddingGemma 2

    EmbeddingGemma 2 puts text, code, images, video and audio (or a mix) into one 768-dimension vector, from a 740M open model under Apache 2.0. Image, video and audio tokens are spliced into the text sequence and run through one encoder, so a text query can find a video moment or a scanned PDF page without captioning or transcribing first.

    • It’s not the quality leader. Text is flat against v1; the gain is code (MTEB Code 68.8 to 78.7). Audio (49) and video (51) scores are modest. All numbers are Google’s own.
    • Every major vendor ships one-space multimodal embeddings now: Amazon Nova, Gemini Embedding 2, Voyage, Cohere, and the open Qwen3-VL-Embedding, which reports higher image and document scores but has no audio. Pick by constraint. EmbeddingGemma 2’s niche is open weights plus audio.
    • Matryoshka truncation isn’t free: its MMEB score falls from 59.0 at 768 dimensions to 45.7 at 128.
    • The interesting part is the system around the model. DigUp is local file search on it: one vector per photo, PDF page, video shot and 30 s of audio, each pointing back to its page or second, next to an FTS5 keyword index, because no embedding holds an invoice number exactly.
    • DigUp fuses the two by turning cosine into a per-query z-score (how far a match stands out for this query), gating on it, and adding a word-coverage bonus. It beat reciprocal-rank fusion on their evals (R@1 0.88 vs 0.73) and can honestly say “nothing found”. Small, author-run eval.
    • It also pins llama.cpp, records the model version in the index, and checks every upgrade against stored reference vectors. Vectors from two runtimes don’t mix, and nothing errors when they do.

    Discuss on Mastodon

  • How the Claude Code team does code review

    How the Claude Code team does code review. Claude writes ~90% of Claude Code, so nobody reads every diff. They swapped “did a human read it?” for “which check, automated or human, should catch what could go wrong here?”, and optimise for the least human time per change, with revert and incident rates as the guardrail.

    • The bit I missed on first read: review noise costs more when the author is an agent. A person waves off a nit in seconds; an agent fixes every one, which is a new commit and another full review. One PR ran 50+ rounds overnight, and ~59% of later findings were on code already there at round one. Fix: cap at three rounds, re-review only the new diff, flag the class of bug, never repeat a finding.
    • The bot posts findings, never approvals. Human approvals (zero, one or two) are set by the change’s risk, not by who wrote it. Whoever prompted the agent counts as a reviewer, and an approval covers one commit, so an agent’s next push dismisses it.
    • Their reviewer’s eval is their own past incidents and reverts, run daily. Noise is measured by what authors did with each comment: fixed it, said it was wrong, intentional, or not worth it.
    • Versus Ankit Jain’s review layers I noted in April: this is the production version, with no spec-review layer and fast rollback under everything.
    • Read the numbers carefully: the share of PRs reverted fell 40% while PR volume doubled, so the count of reverts still rose (~1.2x). Also: the authors sell the reviewer.
    • Where I push back: “nobody needs a full mental model, ask Claude for an explainer of the slice you’re changing.” An explainer recovers what the code does, not why it was built that way, which is the comprehension debt Addy Osmani (a co-author here) wrote about. People should spend review on whether to ship it and on direction, not line-level correctness.
    • How I read it: had Claude explain it against my notes, then quiz me. The question I got wrong taught me the most.

    Discuss on Mastodon

  • 'AI' is Not a Tool

    Rich Hickey’s "‘AI’ is Not a Tool" vs Huahai Yang’s “AI Is a Tool. Using It Well Takes Skill.”. Hickey: a tool is something you wield, and wielding is where expertise comes from, so an LLM is automation you abdicate work to. Yang: a compiler also works unattended and is still a tool; the line is skilled use vs delegating without oversight. Arguing over the label is a dead end. What matters is which skill survives.

    • Hickey’s best line: you are “only a software update from everything you’ve ’learned’ being rendered obsolete.” Model quirks and prompt recipes expire. Verification, choosing context and domain judgment carry over to the next model.
    • Bainbridge’s Ironies of Automation said it in 1983: automate the work and the operator is left monitoring, which needs the skill they stopped practicing. My rule: do the work, then ask the model. Don’t ask the model instead.
    • Best reply to “LLMs are slot machines” in the HN thread: a Las Vegas algorithm is random but always correct; only the runtime varies. Randomness plus a verifier gets you accuracy. Without the verifier you’re just pulling the lever.

    Discuss on Mastodon

  • Rampart

    Small on-device models are getting good enough to sit in front of the big ones. Rampart from the National Design Studio redacts PII in the browser before a prompt reaches any LLM: regexes with checksum or structural checks for cards (Luhn), SSNs, emails, URLs and IPs, plus a fine-tuned MiniLM for names, phones, account numbers, government IDs and street addresses.

    • 14.7 MB Q4 ONNX (~15 MB with tokenizer), 98.4% private-term recall across seven Latin-script languages. p50 is 3.9 ms on WebGPU but 12.6 ms on the default WASM backend. OpenAI’s Privacy Filter is ~2.8 GB; Presidio scores 65% on the same test set.
    • guard.protect() swaps PII for placeholders like [GIVEN_NAME_1], and guard.reveal() fills them back into the reply. The LLM never sees the name; the user still does.
    • Default-deny: every detected label is redacted except city, state and ZIP, so the assistant keeps coarse location without the street line.
    • Know the gaps: names in non-Latin scripts recall ~14% (Hindi 6%, Arabic 5%), and it scores 86.4% on a hostile-input suite. The repo calls it harm reduction, not perfect protection.
    • Same size class, different job: Cactus Whistle is 16.9 MB speech-to-text in seven languages, 11 ms to first token on an M4 Pro CPU (Whisper base: 145 MB, 73 ms). It loads into the same engine as Needle 3, their tool-calling model, so one call takes audio in and returns set_lights(room="kitchen", on=false). Voice commands for home automation with no cloud round trip.
    • The pattern: a tiny specialist at the edge does one narrow job (redact, transcribe, route), and the big model only sees what it needs. Both sets of benchmarks are vendor-reported.

    Discuss on Mastodon

  • Sebastian Raschka's history of text classifiers

    Sebastian Raschka’s history of text classifiers puts numbers on why Jev feels new. On IMDb, bag-of-words + logistic regression gets 89.9%, a fine-tuned ModernBERT about 95%, and Jev 96.5% zero-shot for $0.65 across 25k reviews. Under the hood it is likely still a pretrained transformer with a one-number head that scores each answer option. The hard part is broad training data and calibrated probabilities. What changes is the cost of starting: no labelling, training or hosting per task. Specialists still win on huge volume, the last point of accuracy, or data that can’t leave your network. Within a month OpenAI and Microsoft shipped the same yes/no, choice and score contract.

    Discuss on Mastodon

  • Microsoft eXecution Container (MXC)

    Microsoft eXecution Container (MXC) is an embeddable SDK for running untrusted commands under OS-enforced policies, not a hosted sandbox service.

    • Defaults: Seatbelt on macOS, Bubblewrap on Linux, ProcessContainer on Windows. SDKs for Node, Rust, and .NET.
    • Restricts filesystem and network access. macOS hostname allowlists need a caller-managed proxy; not every backend is a VM.
    • Useful boundary: sandbox the command where it executes, not just the agent’s tool-composition script. Isolation limits damage; it does not make generated output trustworthy.

    Discuss on Mastodon

  • Pi Pocket's subagent implementation

    Pi Pocket’s subagent implementation gives each worker a retained conversation and uses durable tasks to deliver messages and report answers. Request IDs and recorded answer IDs prevent duplicate delivery and reporting after restart. The idea worth stealing: make the handoff durable, not just the worker.

    Discuss on Mastodon

  • Arnav Gupta's pi-subagent-manager

    Arnav Gupta’s pi-subagent-manager makes context inheritance explicit. Nested threads receive their parent’s snapshot; independent roots start without its history. Threads stay around for steering and resume. I want synchronous coordination by default, forks for continuity and fresh context for independent review.

    Discuss on Mastodon

  • Armin Ronacher's subagent extension

    Armin Ronacher’s subagent extension runs one observable Pi child at a time in tmux. The parent waits for the result, while I can attach to inspect or intervene. Worth preserving when adding hierarchy: synchronous coordination must not mean invisible execution.

    Discuss on Mastodon

  • Pi Durable

    Pi Durable is Earendil’s experimental agent harness, shipped alongside Pi 1.0. TannerMidd/pi-pocket is a mobile-first, multiplayer web app for Pi built on it.

    • Every model call and tool call is a task that checkpoints to storage (SQLite, JSONL, or memory) before moving on. Kill the process and a new one opens the same file and resumes.
    • Recovery is per step: a cut-off model request is resent with the partial answer kept and marked aborted. A cut-off tool call reruns only if it is replay-safe; otherwise the model is told it was interrupted.
    • A requestId makes a submission exactly-once, so a client retrying after a crash gets the original back.
    • Forks see the parent transcript up to the fork point without copying it.
    • ~15k lines total, small enough for an agent to read end to end.
    • pi-pocket: restart the server mid-run and the work continues. Several people can watch, steer, or queue messages on the same session.
    • npm start -- --access tailscale binds only to the tailnet address, so my phone gets it with no tunnel.
    • The shift: the session lives in a SQLite file, not a terminal process, so the phone is just another client. Could replace my Moshi + tmux setup.
    • Caveat: anyone who can steer runs shell commands as you.

    Discuss on Mastodon

  • pi-blackhole

    Every coding agent (Claude Code, Codex, pi) compacts long sessions the same way: ask an LLM to prose-summarize, then summarize that summary, until load-bearing details erode (why a decision was made, which approaches got rejected). pi-blackhole swaps that for deterministic compaction: a zero-token compile() that extracts structured sections (goal, files touched, commits, preferences, brief transcript). No LLM, no drift, no cost. The compile is only lossy in the window, not on disk: blackhole also ships a recall tool (BM25 + regex over the raw session JSONL and the memory ledger) that re-fetches any dropped turn on demand, so compile + recall together is lossless where an LLM summary-of-a-summary destroys the original. It also adds observational memory: background observer/reflector workers append durable facts to per-session ledgers that survive every compaction, and /blackhole-export walks every past-session JSONL under a git-root into a ranked context file. The clever part is what export trusts. A fact’s rank is driven by cross-session recurrence, damped as log(1 + distinctSessions) with a burst penalty, not raw counts, so one chatty session can’t inflate it. Recurrence-as-reinforcement is basically Hebbian: facts that keep firing across sessions get stronger. Dedup is a 3-pass funnel, exact then Levenshtein then Sørensen-Dice token-set, with a Levenshtein floor so keyword overlap alone can’t merge two distinct facts. Bonus: the OM workers run on their own model and billing, so I point them at openai-codex/gpt-5.6-luna while the main thread stays on Claude.

    Discuss on Mastodon

  • Meat proxy

    Someone finally named it: meat proxy. You paste Claude’s answer into Slack or a PR review without reading it, and you have made yourself the pipe between me and a model I could have prompted myself, with better context. Everyone already knows that annoyance. Nobody had the word for it. The word is the useful part, because “don’t be a meat proxy” is something you can actually say to a colleague: it names a role instead of calling them lazy. Best line is about code review. Paste the ticket into Claude, paste the reviewer feedback back in, read neither, and the reviewers implemented your PR while you held the pipe. The bar before forwarding anything is to write it in your own words, “a decent certificate that you’ve done the prior steps.” 704 comments on HN, barely any disagreement.

  • NVIDIA's NOOA framework

    Python’s Ellipsis literal (...) is a real object (type(...) is <class 'ellipsis'>), not just a placeholder. Beyond type stubs and numpy slicing, NVIDIA’s NOOA framework repurposes it as a runtime dispatch marker: methods with ... bodies are completed by an LLM at runtime, while methods with real bodies stay deterministic Python. The boundary between “code I control” and “code the model controls” becomes greppable: grep -n '\.\.\.' agent.py. Clever reuse of existing syntax that linters and type checkers already accept.

    Discuss on Mastodon

  • baidu/Unlimited-OCR

    baidu/Unlimited-OCR (paper) parses dozens of pages in one forward pass by fixing the real bottleneck in end-to-end OCR.

    • The problem: an OCR decoder types out the page token-by-token, and its KV cache grows unbounded with output length — so memory climbs and speed decays the longer the doc, forcing page-by-page loops that wipe memory each step.
    • The trick (Reference Sliding Window Attention): split context into two zones with different retention. Vision/prompt tokens stay fully visible and pinned forever (the “source book”); each token attends to only the last 128 of its own outputs (the “last few words you wrote”). KV cache becomes a fixed-size queue, so memory and TPS stay flat regardless of output length.
    • The non-obvious part: discarding history improves accuracy (+6% on OmniDocBench, beating Qwen2.5-VL-72B at 3B/0.5B-active) — full attention can diverge on long dense output, and pinned vision tokens never blur.
    • Cheap to build: freeze DeepSeek-OCR’s encoder, fine-tune only the decoder with the swapped attention.
    • Generalizes past OCR: separate what you reference from what you remember.
    • Ran it on an M1 Mac (32GB) with R-SWA intact, no NVIDIA. The official HF model (trust_remote_code) already ships R-SWA as a pure-PyTorch eager ring buffer (SlidingWindowLlamaAttention, picked via attn_implementation="eager") — not buried in a CUDA/FlashAttention kernel. So the “port” was just stripping .cuda()/torch.autocast("cuda") and running bf16 on MPS; zero MPS op-gaps hit. bf16 works on MPS in torch 2.12.
    • Proof R-SWA is live: instrument the KV cache during decode — on a 540-token page it plateaus at prefill(277) + window(128) = 405 and never grows (full MHA would hit 817). That constant-cache assertion + Distinct-35≈1.0 are the decisive signals, not edit distance (too noisy vs a single reference).
    • Gotcha: feeding all pages to one generate() (infer_multi) loops at the document level — the 128-token decode window forgets the doc was already transcribed while the vision prefix still shows every page, so it restarts from page 1. Fix = one generate() per page (matches official infer.py PAGE_SIZE=1). Accuracy then lands at/below gemini-vs-docai inter-annotator noise (~0.31 mean edit). ~35–55 s/page on M1.
  • fabric

    faberic is a crowd-sourced collection of prompts bundeled with a cli to use them via piped interfaces.

  • karpathy/autoresearch

    [karpathy/autoresearch] is a concept/framework that allows one to leverage LLM to run an optimization loops based on a criteria. davebcn87/pi-autoresearch takes this further has built a generic optimization long run loop method on top of pi agent. gemini

  • Dynamic workflows

    Dynamic workflows in Claude Code. Claude dynamically writes orchestration scripts that spawn tens to hundreds of parallel subagents. It plans, decomposes into subtasks, fans out agents, and checks results before returning a coordinated answer. Adversarial agents try to refute findings, iterating until convergence. Enable via ultracode setting or ask Claude to “create a workflow”. Notable: Jarred Sumner used it to port Bun from Zig to Rust (~750K lines, 11 days). Available on Max, Team, Enterprise plans. Consumes significantly more tokens than typical sessions.

  • Claude Code: The Unreasonable Effectiveness of HTML

    Use HTML instead of markdown to effectively plan and review. Claude Code: The Unreasonable Effectiveness of HTML" / X

  • colbymchenry/codegraph

    colbymchenry/codegraph: Pre-indexed code knowledge graph for Claude Code — fewer tokens, fewer tool calls, 100% local

  • Ankit Jain on automated AI code review

    A good collection of practices on automated AI code reviews by Ankit Jain

    • The Scalability Crisis: Manual post-PR review is no longer viable. AI agents have nearly doubled code output, causing human review time to spike by 91%, creating a bottleneck that traditional workflows cannot solve.
    • The Upstream Pivot: Human value must shift from reviewing implementation to defining intent. Instead of checking syntax, humans spend their energy writing rigorous specs and acceptance criteria before the code is written, which the machine then uses to self-verify.
    • The Swiss-Cheese Defense: Rather than one “perfect” human gate, the model uses a stack of imperfect automated layers. By layering signals like agent competition, deterministic guardrails, and adversarial “red-team” agents, the system catches errors where their individual failure modes don’t overlap.
  • K-dense

    K-dense known for using skills to enable deep research has published 140+ skills related to scientic research including literature review, data analysis, etc.

  • Opus 4.6 launch

    Opus 4.6 launch.

    • context compaction (beta) and 1M context window, enables longer agentic tasks without loosing context.
    • they claim it has found 500 Zero-Day Flaws in open-source projects (yet to see the proofs though)
    • agent teams, multiple agent coordinates with a leader agent. https://code.claude.com/docs/en/agent-teams
  • How AI assistance impacts the formation of coding skills

    Notes on “How AI assistance impacts the formation of coding skills” Article HN

    • AI speeds up coding but reduces deep understanding and mastery
    • Juniors (1-3 years experience) showed speed improvements with AI, but 4+ year developers showed no difference
    • Modern software work is more about requirements, specs, documentation, and communication than raw coding skill
    • Small sample size (n<8) and study design limitations make results questionable
    • Takeaways:
      1. Use AI for high-scoring interaction patterns: Ask conceptual questions and request explanations rather than just code generation
      2. Adopt AI for documentation and specs: Multiple developers report dramatic improvements in tickets, PRs, and documentation quality
      3. Be deliberate about learning: If using AI, actively practice explaining concepts and avoid pure copy-paste workflows
      4. Use AI to reduce grunt work: Let it handle boilerplate, test writing, and repetitive tasks while focusing on architecture and requirements
    • The research confirms what many suspected: AI coding assistants create a real trade-off between speed and skill development, but the practical significance is hotly contested. The critical question isn’t whether AI reduces learning (it does), but whether deep coding skill remains as valuable as expressing requirements clearly—and whether we’re comfortable with a generation of developers who can’t function without AI assistance.
  • LangGraph

    “LangGraph is an orchestration framework for building stateful multi-agent applications using LLMs. It provides low-level primitives such as nodes and edges, along with built-in features that give developers granular control over agent workflows, memory management and state persistence. This means developers can start with a simple pre-built graph and scale to complex, evolving agent architectures. With support for streaming, advanced context management and resilience patterns like model fallbacks and tool error handling, LangGraph enables you to build robust, production-grade agentic applications. Its graph-based approach ensures predictable, customizable workflows and simplifies debugging and scaling.”

  • Thoughtworks - Technology Radar vol 33

    Notes from Thoughtworks - Technology Radar vol 33

    • text-to-sql solutions aren’t working as expected
    • pnpm, langGraph, and pydantic recommended for adoption