Newsletter #38
Since I still haven’t finished my task with Claude Code + Serena MCP from yesterday’s post, today we’re back to our boring AI-powered Newsletter series!! Enjoy Newsletter #38 hehe :>
9 Lessons From Cursor’s System Prompt
ByteAtATime pointed Cursor at a custom API endpoint (a local ngrok tunnel) to capture the raw requests the editor sends to the model, dissecting the system prompt for Agent mode running on GPT-4.1 and extracting nine prompt-engineering lessons. First, Cursor defines the persona sharply: the AI is a pair-programming assistant operating inside Cursor as an autonomous agent. Roughly 1,250 tokens of instructions are organized into XML-tagged blocks like <communication>, <tool_calling>, and <making_code_changes> so the model doesn’t lose track of directives buried mid-prompt. The prompt repeatedly pushes autonomy: keep going until the user’s request is completely resolved, look up information with tools rather than asking the user, and plan before acting. It also tells the model never to mention internal tool names to the user, alongside practical guardrails like not generating long hashes and not attempting to fix linter errors more than three times on the same file.
Most interestingly, Cursor sends two separate user-role messages: the first carries the user’s custom rules, and the second holds the actual query wrapped in rich context including web search results, file contents, and IDE state. As the author sums it up, context is “king, queen, and the entire royal court”: the more directly relevant information you pack into the prompt, the better the model performs. The final two lessons come from tool design: the file-reading tool returns only 200 to 250 lines per call to protect the context window, while terminal command outputs append stateful metadata like the current working directory so subsequent tool calls stay accurate.
My AI Skeptic Friends Are All Nuts
Thomas Ptacek (Fly.io) writes a deliberately provocative piece aimed at his AI-skeptic friends: even if LLM progress froze today, it would still be the second most important shift of his career. In his view, most dismissals are anchored in an outdated workflow—asking ChatGPT a question and pasting the snippet into an editor—whereas serious users now work with agents that read project files directly, run Unix tools, interact with Git, run linters, compile, execute tests, and iterate on the output. Because of that feedback loop, he argues, “hallucination” is largely a solved problem in practice: when an LLM invents a nonexistent function, the agent sees the compiler error and fixes it on the next turn. LLMs can handle the bulk of tedious code, freeing developers to spend their energy on the parts that truly matter.
Ptacek addresses the remaining objections one by one. You are still responsible for whatever you merge to main, so review AI-generated code just as you would a colleague’s. “Mediocre” code isn’t a dealbreaker because most code doesn’t need to be art, and LLMs actually raise the quality floor. LLMs struggling with Rust is mostly a tooling problem today, whereas Go pairs remarkably well with agents. On the craftsmanship argument, he reminds readers that professional developers are paid to solve real problems for people with code, not to act as artisanal woodworkers in their day jobs. He readily concedes that LLMs may shrink software job headcount, and ends by noting that his skeptic friends are sharp engineers—once they actually try coding agents, they’ll be even more effective with them than everyone else.
Claude 4 Best Practices
This is Anthropic’s official prompt-engineering guide for Claude models, originally written for Claude 4 and since updated for newer generations. The foundational rule is to write clear, explicit instructions: treat Claude like a brilliant new hire who has zero context on your team’s norms. If you want “above and beyond” output, ask for it explicitly—for example, instead of just saying “Create an analytics dashboard,” add “Include as many relevant features and interactions as possible.” Explaining the why behind a constraint helps Claude generalize toward your real goal; wrap few-shot examples in <example> tags, and separate instructions, context, and input data with XML tags. For long documents, place the reference material at the top of the prompt and the question at the very end, asking Claude to quote relevant passages before answering.
To control formatting, tell Claude what to do rather than what not to do—such as “write in smooth, flowing prose paragraphs” instead of “do not use markdown”—and match your prompt’s formatting style to the output style you want. The guide also covers leveraging extended thinking to reflect on results after tool calls, encouraging parallel tool execution for independent operations, and tracking state across long-running tasks. For coding specifically, instruct Claude to write general-purpose solutions that work for all valid inputs rather than hardcoding values to pass visible tests, since tests are meant to verify correctness rather than define the implementation.
Stop Over-thinking AI Subscriptions
Peter Steinberger, tired of constantly being asked how much he spends on AI, runs the numbers to show that AI subscriptions are a bargain compared to the time they save. At the time of writing (early June 2025), he calls the $200/month Claude Max 20x plan the best deal in tech: roughly 900 messages per 5-hour window, which translates to virtually unlimited Claude Code usage. Cursor Pro at $20/month includes 500 fast requests and charges $0.04 per extra request, meaning a three-hour live tutorial with over 200 requests cost him only about $8. His biggest variable expense is OpenAI’s o3 ($10 per million input tokens, $40 per million output tokens), which makes up roughly half of his total AI bill; developers on a tighter budget can route o3 through a standard ChatGPT subscription using Repo Prompt, or join Anthropic’s developer partner program for 30% off API rates. He even built a menu-bar app called Vibe Meter to track spend in real time.
Addressing fears of future price hikes, Steinberger points out that per-token inference costs have dropped roughly 1,000x over two years and competition continues to drive prices down. For contractors, the math is dead simple: at an $800 day rate, saving a single afternoon a month is worth $200, meaning Claude Max pays for itself in 5 hours and Cursor in 45 minutes. His takeaway: time is the only resource you cannot replenish, and Claude Max was the cheapest way to “mint” extra working hours.
Tests Should Not Contain Logic
This short post makes a case for keeping logic—especially conditionals and loops—out of unit tests so that when a test fails, you can immediately rule out a bug in the test itself. The author illustrates this with a buggy FizzBuzz implementation: because it checks n % 3 before n % 15, calling fizzbuzz(15) returns "fizz" instead of "fizzbuzz". If a developer tries to avoid repetitive assertions by writing a loop that computes the expected value using the exact same if/elif chain, the test duplicates the production bug and passes anyway. By contrast, “obvious” flat assertions with literal expected values, like assert fizzbuzz(15) == "fizzbuzz", catch the bug immediately.
To reduce repetition without sneaking logic back into tests, the author recommends parameterized (table-driven) tests: declare a list of explicit (input, expected) pairs—such as (1, "1"), (3, "fizz"), (5, "buzz"), and (15, "fizzbuzz") with @pytest.mark.parametrize in pytest. That keeps tests concise and readable while verifying each case independently against a concrete literal.
Do You Really Know Java?
Marking Java’s 30th anniversary, this JetBrains retrospective looks back at the language’s journey. In 1991, James Gosling’s team at Sun Microsystems kicked off the Green Project to build software for consumer electronics, needing a lightweight, safe language that could run across any hardware. Originally named Oak after the tree outside Gosling’s office window, the language was renamed Java after a trademark clash—likely inspired by Java coffee. Java debuted publicly in 1995 right as the web exploded. Its standout features for the era included “write once, run anywhere” portability via the JVM, automatic garbage collection, built-in multithreading (now joined by virtual threads from Project Loom), and a sandbox security model that treated untrusted code as a potential threat.
The post also traces IntelliJ IDEA’s arrival in 2001, bringing context-aware code completion, reliable automated refactorings, and real-time static analysis. In the AI era, Java 24 ships over 20 features—including the Vector API to tap specialized CPU instructions for compute-heavy workloads—alongside Projects Panama, Amber, and Valhalla and ecosystem frameworks like LangChain4j and Spring AI. As the article puts it, Java doesn’t chase hype; it quietly gets stronger where it counts. Fun closing trivia: Java’s mascot Duke was designed by Joe Palrang, who later worked on animated films like Shrek and Madagascar.
Machine Code Isn’t Scary
Jimmy Miller, who started out writing ActionScript in Flash, shares how he got over his fear of working close to the metal. Once he actually dug in, he realized that if you can make sure a JSON payload conforms to a JSON schema, you can write machine code. Machine code isn’t a single universal format—it depends on the processor’s instruction set architecture (x86-64 on most PCs, ARM on modern Macs, Raspberry Pis, and phones)—but it revolves around just three concepts: instructions, registers, and memory. On AArch64, every instruction is a 32-bit integer; an add-immediate instruction, for instance, is just a packed bit layout combining a 64-bit flag, a 12-bit immediate value, a source register, and a destination register at fixed bit offsets. Assembly like add x1, x0, #0x2a is simply a human-readable shorthand for that integer, while str writes a value to memory much like assigning into a giant array.
x86-64 is messier because instructions have variable lengths and carry decades of “historical baggage,” yet the building blocks are the same: a REX prefix for 64-bit operations, a ModR/M byte specifying register or memory addressing, and an opcode. Miller puts those bytes together by hand to encode an instruction that loads the number 42 into the RBX register. He notes there is still plenty more to learn—status flags, calling conventions, the stack—but getting a minimal program running from raw bytes dissolved the mystique and filled in foundational gaps he had previously papered over with other people’s libraries.
The Art of SQL Query Optimization
SQL is declarative: you state what result you want, and the database engine figures out how to compute it. The query optimizer enumerates candidate execution plans, estimates their cost, and picks the cheapest one—for example, when a query returns most of a table, a sequential full-table scan is often faster than chasing index pointers. To visualize where PostgreSQL switches plans, Jan Nidzwetzki built Plan Explorer, an open-source tool inspired by the Picasso optimizer visualizer: it runs a parameterized query across a 2D grid of selectivity values and plots the chosen execution plan, estimated cost, actual runtime, estimated row count, and actual row count. It can run entirely in the browser via PGlite (PostgreSQL compiled to WebAssembly) or in server mode against a real PostgreSQL instance using EXPLAIN (ANALYZE).
On a self-join over an indexed 100,000-row table, Plan Explorer reveals PostgreSQL switching between five distinct execution plans depending on the filter bounds. One neat detail: even when the query is written with a LEFT JOIN, PostgreSQL executes an INNER JOIN because a filter on the right-hand table eliminates any NULL-padded rows the left join would have produced. The visualizations also expose a cardinality-estimation bug: PostgreSQL assumes two filter predicates are correlated when they are actually independent, causing estimated row counts to diverge sharply from reality—a case where extended statistics can help. Beyond the striking visual patterns, Plan Explorer is a practical workbench for anyone tuning or developing custom cost models in PostgreSQL.
This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.
Comments