<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammad Nawal Ali on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Nawal Ali on Medium]]></description>
        <link>https://medium.com/@mnawalali4?source=rss-9f7e7fc44ca6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MHFqYfXFsK3C9JMBpquR1w.png</url>
            <title>Stories by Mohammad Nawal Ali on Medium</title>
            <link>https://medium.com/@mnawalali4?source=rss-9f7e7fc44ca6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:57:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mnawalali4/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Every Test Passed. Nothing Was Delivered.]]></title>
            <link>https://medium.com/@mnawalali4/every-test-passed-nothing-was-delivered-c4df1c608538?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4df1c608538</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 07:49:40 GMT</pubDate>
            <atom:updated>2026-08-18T08:05:43.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cBxhdSwoHVtCKL0EiXC4PA.png" /></figure><p>A bug ticket came in about one code path. An action wasn’t notifying the person it was supposed to notify. Narrow, specific, the kind of thing you expect to close before lunch.</p><p>That path wasn’t special. The notifications for the whole feature had been silent for months. Every part of the system had been reporting success the entire time.</p><h3>What actually broke</h3><p>A refactor had dropped a foreign-key column that was no longer needed. It never touched the one place still reading it, which was the code that assembled the notification payload.</p><p>So every send raised NoMethodError on an attribute that no longer existed. The notifier caught it in its own rescue =&gt; e, wrote a line to the log, and returned.</p><p>No exception escaped and no request failed. Nothing went red.</p><p>The rescue was correct in intent, and I’ll defend it. A notification that fails to send must not roll back the action that triggered it. Rescuing into a log file nobody reads is what turned a loud failure into months of nothing.</p><p>If you’re already thinking the rescue should have reported to the error tracker instead of writing to the log, you’re right, and that was part of the fix. Worth noticing how obvious it is, and how long it survived anyway.</p><p>The column was dead weight, by the way. Nothing downstream consumed the value. It was read, and then dropped on the floor. The fix was deleting three lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zE-mRbRIcrGc7InBwelPAQ.png" /></figure><h3>The two tests</h3><p>The interesting question isn’t why it broke. Things break. It’s why a codebase with a healthy test suite couldn’t tell.</p><p>That class was the only notifier in the codebase without a spec. The single reference to it anywhere in the suite was a negative assertion, sitting in an unrelated spec about a different feature:</p><pre>expect(RequestNotifier).not_to receive(:canceled)</pre><p>That’s a reasonable line in the context it was written for. It’s checking that a particular flow stays quiet. And it passes identically whether the notifier is correctly suppressed or completely dead.</p><p>The only test in the suite that so much as named the broken class was a test that couldn’t distinguish the two.</p><p>Here’s the shape used by the classes that did have specs. It would also have passed the whole time:</p><pre># Passes while the notifier throws the payload away inside its rescue<br>expect(Notify).to receive(:call).with(hash_including(event: :request_canceled))<br>subject.run</pre><p>Read that assertion for what it actually claims. The application called its own method with the arguments it intended to pass. That is the entire claim. It says nothing about whether anything left the building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgECi7VJXA5_NnhICdW8JA.png" /></figure><p>I’ve written that test. Most backend engineers I know have written that test. It feels like coverage because the line goes green and the method name in the expectation matches the method name in the feature.</p><p>Here’s the distinction I didn’t have language for until this bug, and now use constantly: <strong>that test is evidence of work, and what I needed was evidence of outcome.</strong> The system was perfectly capable of proving it had done its part. It had no way to show that its part had produced anything.</p><p>A passing test is a claim the code makes about itself. So is a background job that finishes without raising, and so is a log line reading “notification sent”. Self-reports are exactly what fail first when something breaks quietly, because the part that broke is also the part filing the report. The assertions that survive contact with reality are the ones placed where the system can no longer vouch for itself: a mail sitting in the queue, a row that exists where there was none before.</p><h3>Proving the new test could fail</h3><p>I wrote a proper spec for the class, asserting delivery rather than invocation. Then I did the thing that mattered more.</p><p>I put the bug back. I restored the reference to the dropped column, ran the new spec, and watched it fail on the examples I expected it to fail on.</p><p>That takes two minutes and it’s the step nearly everyone skips. A test you’ve never watched fail is still just an assertion you’re trusting on the strength of its name, which is the same mistake that produced the outage in the first place. The original suite was full of assertions nobody had ever watched fail, and every one of them was green.</p><p>Instruments need calibrating against a known-bad input before you’re entitled to believe them on an unknown one. It’s close to the only defence against a checker that has quietly stopped checking.</p><h3>What I’m not claiming</h3><p>There’s no count of how many notifications were missed. Nothing in the system recorded the failures, which is the whole point of the story, so any number I gave you would be invented.</p><p>Nothing was replayed either. No backfill, no re-send. The fix restored delivery going forward and that was the end of it, which is what nearly everyone actually does in this situation.</p><p>I’d rather leave both of those bounded than round them up into a better ending.</p><h3>Two ordinary things, lined up</h3><p>A refactor left a reader behind, which happens constantly and is usually caught in a week. A rescue block sent its error to a log file instead of an error tracker, which is common and usually harmless. Either alone would have surfaced in days. Together they produced a feature that reported success and delivered nothing to anyone for months.</p><p>Anything that produces confident output can produce confidently wrong output, and the more fluent the output, the longer it survives review. That’s true of a green test suite, and it’s true of a model that answers every question in the same even tone whether or not it knows.</p><p>The move is the same either way. Stop reading the claim, and go look at the far end.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4df1c608538" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What a Wedding Venue Site Taught Me About Where Authorization Belongs]]></title>
            <link>https://medium.com/@mnawalali4/what-a-wedding-venue-site-taught-me-about-where-authorization-belongs-ded597b44f9f?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ded597b44f9f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 10:16:04 GMT</pubDate>
            <atom:updated>2026-08-17T10:16:04.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbbIm7_NJLK59bMluNqIwA.png" /></figure><p>A friend was getting married and asked me to help find a venue. So I did what anyone does, which is open six tabs and start comparing.</p><p>One of the sites was good. Clean listings, real photographs, per-head prices, filters that worked. Somebody had clearly put a year into it. A signup wall dropped over the page the moment it loaded: free trial, monthly, three months. Fair enough. Somebody built something worth charging for.</p><p>But the page had already loaded underneath it.</p><p>All of it. Every venue, every package, every per-head price, sitting in the document with a box on top. I restored scrolling, removed the overlay elements, and the paid product was just there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKkjgbFRBjEiiHh95sMOPg.png" /></figure><h3>What happened, precisely</h3><p>This part matters, so I want to be exact about it.</p><p>I did not log in. I did not defeat any authentication. I did not tamper with a request, replay a token, or touch anything their server had not already chosen to send me. The first anonymous request from a browser that had never seen the site before came back with the entire catalogue in it. What the wall did was cover that catalogue with an element and turn off scrolling.</p><p>Both of those are instructions to a machine I control.</p><p>That is the whole of it. There is no clever part, which is exactly why it is worth writing about.</p><h3>The rule underneath</h3><p>Anything your server sends to the browser already belongs to the user.</p><p>That is a statement about physical custody rather than about intent. The moment the response leaves your infrastructure, it is sitting on hardware owned by someone else, being rendered by a program that ships with a full inspector, and the user can read every byte of it whenever they like. CSS can hide it. A modal can cover it. A conditional render can decline to draw it. Every one of those runs on their machine, at their discretion, and they can be undone by anyone who opens developer tools.</p><p>So a paywall is an authorization decision, and authorization decisions belong on the server. The test is not whether the paid thing is visible. The test is whether the paid thing is in the response at all.</p><p>If the JSON your list endpoint returns to a logged-out visitor still contains the field they have not paid for, you have a curtain rather than a wall. It does not matter how convincingly the curtain is drawn.</p><h3>Why this class of thing survives</h3><p>Here is what interests me more than the bug.</p><p>This is not a vulnerability in the sense that would get it triaged. There is no CVE here, no injection, no broken crypto, no privilege escalation in the usual shape. If you ran a scanner across that site it would find nothing, because nothing is technically wrong. The server did what it was asked. Every request was answered correctly. The application is behaving exactly as written.</p><p>Which is why it lasts. Security tooling looks for defects, and this is not a defect. It is a product decision that was only ever implemented in one layer.</p><p>And the reason it happens is the same everywhere, in my experience. When a feature ships fast, the visible half is the half that gets built. Somebody was asked to put subscribers behind a paywall. The fastest honest way to do that, against an app that already renders listings, is to mount a gate in the front end. It looks right in the browser. QA sees a wall. The demo shows a wall. The ticket gets marked done, and nobody opens the network tab to ask the boring question: what is actually inside this response for someone who has not paid?</p><p>There has never been more pressure to ship the visible half quickly, or more tooling that makes doing so effortless. The gap between “it looks correct” and “it is correct” has never been cheaper to create.</p><h3>Then I opened their contact page</h3><p>The same wall was on it.</p><p>A customer with a question about a booking, or a venue owner who wants to get listed, has to get past a payment prompt before they can type a message. Every lead that page exists to catch is hitting a signup form instead.</p><p>That reframed the whole thing for me, because it tells you what this actually is. One overlay, mounted across the entire application, without anyone asking which routes it belonged on. The result leaks the thing it was meant to protect and blocks the thing it should be letting through. The same decision produced both, and only one of them looks like an engineering problem.</p><p>Which is the more expensive of the two? I would guess the contact page, and it would not be close. A leaky paywall costs you the subscriptions of people who would have paid and now do not, which is a real number but a slow one. A blocked contact page costs you inbound leads, and you never see them, because a lead that cannot reach you does not appear anywhere in your analytics as anything except someone who left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5567MGAgCeonGtuyQuOUw.png" /></figure><h3>Half an hour on your own product</h3><p>Four things, and you can do all of them before lunch.</p><p><strong>Log out and read the raw responses.</strong> Open the network tab, load your own list pages as an anonymous visitor, and read the JSON. Do not look at the rendered page; the rendered page is the thing that lies to you. Look for the fields you sell. If your premium tier is “contact details for verified vendors”, search the payload for a phone number.</p><p><strong>Treat every visual gate as a display choice.</strong> Anything hidden by CSS, covered by a modal, or skipped by a conditional render is a rendering decision, and rendering decisions are advisory. Make a list of the ones in your app. For each, ask what the server would send if that gate were deleted.</p><p><strong>Move the gate to where the data is selected.</strong> This is the actual fix and it is usually not a large change. The decision belongs at the point where you build the response, in the query, the scope, or the serializer, so that an unauthorized request produces a genuinely different and smaller payload. The front end then renders whatever it received, which is all a front end was ever supposed to do. Two shapes rather than one shape with a lid on it.</p><p><strong>Then check where your gates mount.</strong> A wall applied at the layout or router level covers routes nobody audited. Walk your route list and ask, page by page, whether the gate belongs there. This takes ten minutes and it is the one that found the contact page.</p><p>The first three protect your revenue. The fourth protects your pipeline, and it is the one nobody runs.</p><h3>I told them</h3><p>I emailed the company, addressed to a founder by name, before writing any of this. Two problems, both live, plus screenshots so none of it had to be taken on trust, and an offer to walk whoever owns the code through the specifics at no charge. No leverage, no deadline, no invoice.</p><p>I have not named them here and I am not going to. The screenshots in this piece are redacted for the same reason. Naming them would publish a live revenue flaw in an identifiable business, which helps nobody, and it would move the conversation onto one company’s competence when the point is that this is everywhere. You have almost certainly shipped a version of it. I have.</p><p>I also did not include the script I used, and it is not much of a script. Anyone who needs it can derive it in about a minute, which is precisely the argument. The barrier between a paying customer and a non-paying one was four lines of something a browser will run for free, on request, for anybody.</p><p>If your paywall lives in the browser, it is not a paywall. It is a suggestion, politely worded, addressed to a machine that does not work for you.</p><p>This is the kind of thing I get brought in to find. I work with teams on the parts of a product that quietly stop holding when it grows faster than the people looking after it. If that is where you are, that is the conversation I am usually in.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ded597b44f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t go into your 2026 interview without reading this]]></title>
            <link>https://medium.com/@mnawalali4/dont-go-into-your-2026-interview-without-reading-this-cc2f1c246adb?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc2f1c246adb</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 19:00:29 GMT</pubDate>
            <atom:updated>2026-07-28T19:00:29.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbdOlgX-7BQhSdJRTZ_MkA.png" /></figure><h3>1. The question I didn’t have an answer for</h3><p>It was a remote interview for a senior software engineer role. Everything was going fine. Then the interviewer asked me something I wasn’t ready for.</p><p>“What coding tools do you use?”</p><p>Easy. “Claude Code,” I said.</p><p>“Okay. What’s your setup?”</p><p>And that’s where I ran out of road.</p><p>I told him I use CodeGraph to cut my token usage, and that I keep a CLAUDE.md file so the agent understands my project. Then I stopped, because that was it. My whole setup, two things, both of them the bare minimum. Nothing about how I actually work with the agent day to day. Nothing that would tell him I was any better at this than someone who’d installed Claude Code an hour before the call.</p><p>I answered honestly, and I heard how thin it sounded the second it left my mouth. It’s the kind of answer that tells an interviewer you’re using one of the most powerful tools of your career the way you’d use autocomplete.</p><p>I felt it right away, that small hot flush of <em>I should know better than this.</em> I’m a senior engineer. I use this thing every day. And asked to describe how, I had two sentences.</p><p>I understand now what he was really after. Anyone can name the tool they type. He wanted to know whether I knew what to do with it, and in 2026 it’s become one of the sharpest questions an interviewer can ask. This article is the answer I wish I’d given.</p><h3>2. The question was a proxy, and I missed what it was measuring</h3><p>I understood this only afterward. “What’s your setup?” was a proxy question. The interviewer didn’t care about the names of my tools. He was trying to find out something harder to ask directly: do you know how to <em>drive</em> one of these agents, or do you just sit in the passenger seat and hope?</p><p>Because the job changed. For most of my career, being a good engineer mostly meant writing good code. In 2026 it’s no longer the center of the role. The agent writes a lot of the code now. Your value moves to the work around the code: deciding what to build, breaking it into pieces the agent can handle, and catching what it gets wrong.</p><p>Developers are turning into <a href="https://blog.codacy.com/ai-agents-are-turning-developers-into-engineering-orchestrators-and-moving-the-risk-to-review">orchestrators</a>, and the risk of the job is shifting from writing to reviewing. The teams doing this well have a shape to their workflow now: <a href="https://sourcegraph.com/blog/agentic-coding">plan first, let the agent execute in a sandbox, then gate everything behind review</a> before it merges.</p><p>And there’s a specific tell they’re listening for. The engineers who sound behind <a href="https://www.interviewcoder.co/blog/agentic-ai-interview-questions">answer with definitions</a>. The ones who sound current answer with a system they actually run, and a story of a time it saved them. I had neither. I had two nouns.</p><p>This article closes that gap with the real setup I should’ve been able to describe in the room, piece by piece.</p><h3>3. My real setup, and why “basic” was only half the story</h3><p>Let me tell you exactly how I was working, because I suspect it’s how a lot of you work too.</p><p>I open Claude Code. I paste in a ticket. I ask it to build the thing and open a pull request. If it gets something wrong, I tell it what’s wrong and ask again. That’s the loop. One agent, one conversation, me feeding it work and waiting. CodeGraph and the CLAUDE.md file sit underneath all of that, making it cheaper and a little smarter. That was the whole picture.</p><p>Now, part of that embarrassment was wrong, and it took me a while to see it. CodeGraph isn’t nothing. Indexing your whole codebase into a graph so the agent retrieves less and burns fewer tokens is genuinely good practice, and I wrote a whole <a href="https://medium.com/@mnawalali4/how-i-cut-my-ai-agents-token-usage-by-76-with-one-change-18e6ba8ed501">article about cutting my token usage by 76% with it</a>. In the interview, I mentioned it in one flat sentence, like a checkbox, and moved on. I had a real answer in my hands and undersold it. Half the game is just that: narrating the smart things you already do as if you chose them on purpose. Because you did.</p><p>But I’m not going to let myself off that easy, because the other half was fair. I had no custom commands. No automation. No agent running anything without me watching it. No second agent checking the first. One agent, one human, one conversation at a time. The frontier had moved, and I hadn’t moved with it. I didn’t even know which direction it had moved in.</p><p>So I went and found out.</p><h3>4. The setup I should have described</h3><p>None of what follows is exotic. Every piece already exists in Claude Code, waiting for someone to bother using it. I just never opened the door. The setup below runs roughly in order of how much each one changes the game.</p><p><strong>1. Custom slash commands.</strong> This is the one I’d demo first. You write a markdown file, and it becomes a command. Instead of pasting a ticket and re-explaining my process every single time, I type one word:</p><pre>/ship ENG-1421</pre><p>That single command could pull the ticket, cut the branch, write the code, run the tests, and open the PR: your whole repetitive loop collapsed into one word you defined once. In practice I keep a few smaller commands instead of one do-everything version, so I get a beat to look at the diff between steps: one to start a ticket and cut the branch, one that runs my pre-commit gate (formatter, the test suite in parallel, a security scan) to catch locally what CI would catch, and one that opens the PR in the right format against the right base. Almost nobody builds these, and they’re the single most impressive thing you can show someone. (Claude Code is merging commands into “skills,” but the idea is the same: your workflow, saved and named.)</p><p><strong>2. Specialized subagents.</strong> You can define separate agents, each with its own instructions, tools, even its own model. One that only writes tests. One whose entire job is to poke holes in what the first agent wrote, before any of it reaches me. One honest caveat, because accuracy is the whole point of this article: inside a single session these run one after another, not truly side by side, and real parallelism means handing work to background sessions. But you stop being the only reviewer in the room.</p><p><strong>3. Hooks.</strong> The difference between babysitting and a setup that runs itself. A hook is a command that fires automatically on an event: run the tests the moment a file changes, block a dangerous command, ping me when a task is done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*q7UTmjPSRR2vof37LzhaJw.png" /><figcaption><em>The Claude Code lifecycle. Every box is a point you can hook into. Most engineers use none of them. (Source: Claude Code documentation.)</em></figcaption></figure><p>The one that changed my week is a PostToolUse hook that greps every file the agent edits for my mechanical rules (a hardcoded API key, a strayeslint-disable, a leftover console.log) and hands the violations back to fix before I ever see the code. It never once forgets. And this is where a hook and the reviewer agent above stop overlapping. The agent reasons, so it catches the judgment calls a script never could, like a new helper that reinvents one we already have. The hook is dumb and deterministic, so it stops the console.log the agent would sometimes wave through. You want both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIY0Gelru9OazBVlG-CFBA.png" /></figure><p>A hook and a review subagent look after your work but catch different mistakes</p><p><strong>4. Headless mode.</strong> Claude Code doesn’t only live in a chat window. You can run it from the command line, non-interactive, and pipe it into a CI pipeline, a git hook, or a scheduled job. This is where “automate the ticket process” stops being a buzzword.</p><p><strong>5. The Agent SDK.</strong> If an interviewer asks whether you build agent loops and you want to end the question, this is the answer: a full SDK, in Python and TypeScript, for building your own agent that plans, calls tools, checks the result, and decides what to do next, all in code you control. The line between using an agent and building one.</p><p><strong>6. MCP connections.</strong> Connect the agent straight to your tracker, your database, your error monitor. We run Linear, so I wire in the Linear MCP and the agent pulls the ticket and its context itself instead of me copy-pasting. This is the real mechanism behind “the agent picks up the ticket,” the thing I gestured at in the interview without knowing it had a name.</p><p><strong>7. Git worktrees.</strong> Want several agents working at once without stepping on each other? Give each one its own worktree, an isolated checkout of the repo, and review and merge the diffs in order. (Accuracy note: by default a new worktree branches from your remote, not your local state, so know that before you rely on it.)</p><p><strong>8. Scheduled and self-running loops.</strong> Have Claude run a task on a loop or a schedule: triage new issues every morning, watch your open PRs. Your setup working while you sleep, which is a very different answer than “I paste in a ticket when I get to it.”</p><p><strong>9. Let the agent interview you first.</strong> This one flips the relationship, and it’s the most underused move on the list. Instead of prompting and hoping, you give it a one-line description and tell it to interview <em>you</em>: pointed questions about edge cases, tradeoffs, the hard parts you haven’t thought through. It writes the spec from your answers, and then you open a fresh session to build against that spec. Now you’re engineering the context before a single line of code exists, which is the real job today.</p><p>One more thing, and it stung a little. While I was still running one agent in one chat, the frontier had already jumped past all of it. Claude Code now has <a href="https://code.claude.com/docs/en/workflows">workflows where a lead agent fans out to hundreds of subagents</a> at once, plus a grader that sends each subagent’s work back to be redone until it meets a standard. The manager-developer-reviewer team I thought would be a clever thing to build? It shipped as a feature. That’s how far behind “I paste in a ticket” really is.</p><p>A few more, quickly: <strong>Plan Mode</strong> (approve the plan before it touches anything), <strong>checkpoints</strong> (pause and resume days later with full context), <strong>nested CLAUDE.md rules</strong> for monorepos, and <strong>browser automation</strong> for when the agent has to click through a real UI. None of these are hard. All of them would’ve made me sound like I actually live in this tool.</p><h3>5. But do not confuse more agents with better</h3><p>Now let me argue against my own article, because if you read all that as “run as many agents as possible,” you’ll hurt yourself, and a good interviewer will catch it.</p><p>There’s a study that should be taped to every developer’s monitor right now. In a controlled trial, experienced open-source developers working on their own real projects were about <a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">19% <em>slower</em></a> when they used AI tools. Slower. The detail that should stop you cold: those same developers <em>thought</em> the AI had made them 20% faster. They were off by nearly forty points about their own productivity.</p><p>The time they saved not typing got eaten right back up by reviewing, correcting, and un-breaking what the agent produced, and they never felt it happen. These were experienced developers who knew their code cold.</p><p>Now the fine print, because pretending otherwise is the thing this article is against: that study ran on early-2025 tools, and even the researchers now call it historical. The models are better today. But the lesson outlives the tools. Review has always been the real bottleneck, and piling on more agents just makes the review pile taller.</p><p>Put that next to another number. Anthropic’s own <a href="https://resources.anthropic.com/2026-agentic-coding-trends-report">2026 report</a> found engineers now use AI in roughly 60% of their work, but can fully hand off only 0 to 20% of tasks. They even gave the space between those two numbers a name: the delegation gap. And that gap is the job. It’s where the context-heavy judgment lives, and that part is still yours.</p><p>What I wish I’d said in that room is simple. The whole skill is deliberateness. One agent with tight context, a clear task, and a real check on its output will beat five agents you’re frantically juggling every time. Reach for the swarm when the work is genuinely independent and you have gates that catch mistakes between the stages. Reach for it just to sound impressive and you get a stack of agents with no verification, which is only a faster way to ship bugs.</p><p>And running deliberately comes down to unglamorous habits every good operator has. Anthropic’s own <a href="https://code.claude.com/docs/en/best-practices">best-practices guide</a> puts this ahead of every shiny feature: the context window is the most important resource you manage, and the agent’s performance degrades as it fills. So start a fresh session for each task instead of dragging one conversation across five unrelated problems, the kitchen-sink session that makes the agent dumber the longer you run it.</p><p>Compact on purpose at the end of a phase, not mid-thought. Feed the agent less, but feed it better. It’s the same instinct behind CodeGraph, and the least impressive-sounding, most important skill on the list. Anyone can add another agent. Knowing what to keep <em>out</em> of the context window is the craft.</p><p>Ironically, the most senior answer I could have given was about restraint, knowing when to leave the tools alone.</p><h3>6. The answer I would give now</h3><p>If I could take that call again, I know what I’d say.</p><p>This time I’d walk him through a system, with real judgment in it. I’d say I keep my repeated work saved as commands so I’m not re-explaining myself to the agent every day. I have a reviewer agent that checks the work before I do. I have hooks that run my tests automatically so nothing untested slips through. I pull tickets and context straight from our tracker instead of copy-pasting. And I’m deliberate about when I let it run wide and when I keep it on a short leash, because I’ve read the research and I know more agents isn’t the same as better work.</p><p>That’s a world apart from “CodeGraph and a CLAUDE.md file,” because it shows I thought about how I work.</p><p>I owe you an honest admission. When that interview ended, this setup was still just a map. I had the list and none of the muscle. So I did the thing I should’ve done before the call instead of after: I went and built it, piece by piece, on my own real work. The commands, the reviewer agent, the hooks, the ticket connections, the context discipline. It’s how I work now. Not all of it stuck. The flashier features, agents running on a schedule and big parallel fan-outs, made a better story than a daily habit, and I don’t reach for them much. The plain ones, my commands and the pre-commit gate and the reviewer agent, are what I actually use every day.</p><p>If there’s one thing to take from my bad interview, it’s this. Interviewers in 2026 are past caring which tool you type. They want proof you know what to do with it. You have a year of interviews, standups, and performance reviews ahead of you where some version of that question is coming. Have a better answer than I did.</p><p>Start with one command. Save one workflow you do every day. That’s the whole first step. The rest is just repeating it.</p><h3>References</h3><ol><li>METR, <em>Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity</em> (2025). A randomized trial: 16 experienced developers, 246 tasks on their own mature repositories, about 19% slower with early-2025 AI tools while estimating they were 20% faster. METR notes the result may not reflect today’s tools. <a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">Blog post</a> and <a href="https://arxiv.org/abs/2507.09089">paper</a>.</li><li>Anthropic, <a href="https://resources.anthropic.com/2026-agentic-coding-trends-report">2026 Agentic Coding Trends Report</a>. Engineers use AI in roughly 60% of their work but can fully delegate only 0 to 20% of tasks. Anthropic calls the space between the two “the delegation gap.”</li><li>Codacy, <a href="https://blog.codacy.com/ai-agents-are-turning-developers-into-engineering-orchestrators-and-moving-the-risk-to-review">AI agents are turning developers into engineering orchestrators, and moving the risk to review</a>.</li><li>Sourcegraph, <a href="https://sourcegraph.com/blog/agentic-coding">Agentic coding in 2026</a>: plan first, execute in a sandbox, then gate behind review before merge.</li><li><a href="https://www.interviewcoder.co/blog/agentic-ai-interview-questions">Agentic AI interview questions</a>: interviewers want a shipped loop and a real story, not textbook definitions.</li><li>Claude Code documentation, <a href="https://code.claude.com/docs/en/workflows">Orchestrate subagents at scale with dynamic workflows</a>, where a lead agent fans out to many subagents that review each other’s work. Full feature docs at <a href="https://code.claude.com/docs">code.claude.com/docs</a>.</li><li>Claude Code documentation, <a href="https://code.claude.com/docs/en/best-practices">Best practices</a>: the context window is the most important resource to manage, performance degrades as it fills, so use a fresh session per task and compact deliberately.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc2f1c246adb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You’ve Multiplied Matrices Since School. Nobody Told You What They’re For]]></title>
            <link>https://ai.plainenglish.io/youve-multiplied-matrices-since-school-nobody-told-you-what-they-re-for-01024dabfc5d?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/01024dabfc5d</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 08:58:57 GMT</pubDate>
            <atom:updated>2026-07-13T08:58:57.130Z</atom:updated>
            <content:encoded><![CDATA[<p>I have multiplied a lot of matrices. Through school, through university, and then for years as an engineer, without anyone ever telling me what the grid was actually for.</p><p>I knew the steps cold: row times column, add up the products, write the number in the box, move on. The <em>how</em>, over and over. Never the what-for. The numbers went in, other numbers came out, and it always felt like arithmetic with extra bookkeeping.</p><p>Then it slowly dawned on me that those grids are quietly running a huge share of the things I use every day. The photo I cropped this morning. The search that found this for you. The app deciding what to play next. All of it, the same little grid I’d been drilled on for years and never actually understood.</p><p>So here’s the thing nobody ever stopped to explain: what a matrix is <em>for</em>.</p><h3>The one idea everything else hangs on</h3><p>A matrix isn’t a box of numbers. It’s a machine that takes something in and moves it.</p><p>The simplest version to picture: an arrow. Say you have an arrow pointing right, and you want it pointing up. There’s a little 2×2 grid of numbers that does exactly that. Feed it the “right” arrow, and out comes the “up” arrow. The grid <em>is</em> the instruction for the turn. A different grid stretches the arrow to twice its length. Another one tilts it. The numbers in the box aren’t data; they’re a move.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*lHi_xTrfZTle8kJklb-DXw.gif" /><figcaption><em>The four numbers in the grid are an instruction. This one takes an arrow pointing right and turns it to point up. That’s all a matrix is: a move, written down.</em></figcaption></figure><p>That’s the whole idea, and it stretches further than arrows. More broadly, a matrix is a way to write down how one set of things relates to another, and “multiplying” by it pushes your data through that relationship. Store a relationship in a grid, then run things through it. Hold onto that one sentence. Every example below is that same move wearing a different costume.</p><h3>It rotates and recolors your photos</h3><p>Straighten a crooked photo and you’ve done matrix multiplication without noticing.</p><p>An image is a grid of pixels, each at some coordinate. Rotate or scale the photo and every pixel coordinate gets multiplied by a matrix that says, precisely, how far to turn or stretch. That’s the geometry.</p><p>Color works the same way. Each pixel is three numbers: how much red, green, and blue. Turn a photo to grayscale, or give it that warm vintage cast, and you’re multiplying each pixel’s three numbers by a small matrix that mixes the colors in a fixed recipe. A chunk of the filters you tap on are, underneath, a grid of numbers deciding how to remix light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ynO5dzP4l-GAm5yHEJWWg.png" /><figcaption><em>Two things happen when you edit a photo, and both are matrix multiplication. On top, rotating or scaling multiplies every pixel’s position by a grid. On the bottom, going grayscale multiplies every pixel’s color by a grid.</em></figcaption></figure><h3>You’ve been building them all along</h3><p>Here’s the one that actually got me. Every table of data I’ve ever made is a matrix.</p><p>A spreadsheet, a database table, a CSV: rows going down, columns going across, a value in every cell. That’s a grid. That’s a matrix. Every time I stored users in rows and their details in columns, I was building the exact thing I couldn’t see the point of in class, and calling it a table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*5ubWusnOrEXqWyBE9jk_hg.gif" /><figcaption><em>The same numbers, wearing two costumes. Strip a table of its headers and gridlines, draw brackets around what’s left, and it was a matrix the whole time.</em></figcaption></figure><p>And it quietly changes what a matrix <em>is</em>. Up to now it’s been a move: rotate this, recolor that. But a grid can just as easily be a <em>record</em>, a way to lay out how one set of things relates to another. Users to their details. Movies to their ratings. Pages to the pages they link to. Once you let a matrix be “a table of relationships,” the biggest systems around you stop looking mysterious, because they’re all built on exactly that.</p><h3>It ranked the entire web</h3><p>Google’s original breakthrough was a matrix trick, and it’s a beautiful one.</p><p>Picture the whole web as one enormous grid: a row and a column for every page, with a mark wherever one page links to another. That grid is a map of the web’s link structure. Now take a list of “importance” scores, one per page, and multiply it by that grid, over and over. Each pass lets important pages pass some of their importance to the pages they link to. After enough rounds the scores stop moving and settle, and the pages that rose to the top are the ones everyone else effectively voted for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySa7HRDuZnoD4c_dn2gdNg.png" /><figcaption><em>The web as a grid. Every page is a row and a column, with a dot wherever one page links to another. Multiply the importance scores by that grid over and over, and the pages everyone links to swell to the top.</em></figcaption></figure><p>That settling ranking is PageRank. The web as a matrix, run through itself until the important pages surface. A search engine that reshaped the internet started as repeated multiplication by a grid.</p><h3>It knows the people you may know</h3><p>That “People You May Know” list is the same trick, pointed at people instead of pages.</p><p>Put everyone on a social network into a grid: a row and a column for each person, with a mark wherever two people are connected. That’s the friend graph, written as a matrix. Now multiply that grid by itself. The result counts, for every pair of people, how many friends they have in common. And two strangers with a big pile of mutual friends are exactly the ones the app decides to introduce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXvZ4h2rKT23VoEoYju_OQ.png" /><figcaption><em>You and a stranger aren’t connected, but you share two friends. Multiplying the friendship grid by itself counts exactly those shared friends for every pair, and a big count is what puts someone on your ‘People You May Know’ list.</em></figcaption></figure><p>A network stored in a grid, and one multiplication pulling a genuinely useful answer out of it. Same move as the web ranking, wearing a different face.</p><h3>It guesses what you’ll watch next</h3><p>That “because you watched…” row is a matrix being asked to fill in a blank.</p><p>Imagine a giant table: every user is a row, every movie a column, and each cell holds a rating. Almost all of it is empty. You’ve rated a tiny fraction of what exists. The job is to guess the empty cells: how would <em>you</em> rate a film you’ve never opened?</p><p>The classic answer factors that giant table into two smaller grids, one that captures each person’s taste, one that captures each movie’s flavor, such that multiplying them back together reproduces the ratings you <em>do</em> know. Once you have those two compact grids, multiply them out fully and the blanks fill in with predictions. That’s matrix factorization, and it’s not a toy: it’s essentially how the famous million-dollar Netflix Prize was won. Modern systems layer more on top, but that grid-splitting idea is still near the core of what suggests your next show or song.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oby--JseSgziZr__hHN2zw.png" /><figcaption><em>The ratings table is mostly blanks (left). Factor it into two small grids, one for taste and one for flavor, multiply them back, and the blanks turn into predictions (right, in amber). That’s what fills your ‘because you watched…’ row.</em></figcaption></figure><h3>And it’s the whole engine of the AI everyone’s talking about</h3><p>Strip the mystique off a neural network and a single layer of it is one matrix multiply.</p><p>Your input (an image, a sentence, anything) becomes a list of numbers. The layer multiplies that list by a grid of <em>learned</em> numbers, producing a new, transformed list, then applies one simple nonlinear squish. That’s it. Stack a hundred of those layers and you have the “deep” in deep learning. Training the model means slowly nudging the numbers inside those grids until the stack of transformations turns raw, messy input into a clean answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8udQxRwSIm-rb7jeiRSWug.png" /><figcaption><em>One layer, top: your data is a list of numbers, multiplied by a grid of learned weights, then given a simple squish. Stack a hundred of those, bottom, and raw pixels get turned, grid by grid, into ‘cat’.</em></figcaption></figure><p>If you read <a href="https://medium.com/@mnawalali4/the-simple-idea-behind-deep-learning-its-not-the-math-you-think-e5d1a03ad481">the last piece</a>, this is the machine behind it. Learning is finding the transformations that bend the data’s space until the answer is easy to read off, and each of those transformations is a matrix.</p><h3>You were handed the verb and never the sentence</h3><p>Look back at the list. Straightening a photo, ranking the web, spotting people you may know, guessing your next show, recognizing a face, and every plain table of data you’ve ever built. Underneath, they’re the same move: store a relationship in a grid, then push data through it. Different grids, one operation.</p><p>That’s what makes the way we’re taught them so strange. Through school, through university, into the job, we’re handed the verb, <em>multiply</em>, with the sentence carefully removed. No wonder it felt like a chore. A matrix isn’t a box of numbers you crunch to pass a test. It’s a machine that moves information, and once you see that, you start noticing it everywhere: in the photo you crop, the search that found this, the feed that knows you a little too well.</p><p>Same grid you were drilled on. It was never the boring part. It was the point.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01024dabfc5d" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/youve-multiplied-matrices-since-school-nobody-told-you-what-they-re-for-01024dabfc5d">You’ve Multiplied Matrices Since School. Nobody Told You What They’re For</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Simple Idea Behind Deep Learning (It’s Not the Math You Think)]]></title>
            <link>https://ai.plainenglish.io/the-simple-idea-behind-deep-learning-its-not-the-math-you-think-e5d1a03ad481?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5d1a03ad481</guid>
            <category><![CDATA[representation]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 12:18:15 GMT</pubDate>
            <atom:updated>2026-07-11T12:18:15.010Z</atom:updated>
            <content:encoded><![CDATA[<p>Try multiplying 17 by 24.</p><p>Now try multiplying XVII by XXIV.</p><p>Same two numbers. Same operation. But one is a quick scribble, and the other makes your head hurt, and <em>nothing about the math changed.</em> The only thing that changed was how the numbers were written down.</p><p>That gap between the Roman numerals nobody wants to calculate with and the Arabic ones you actually use, is one of the most important ideas in machine learning. And most people who train models never hear it said out loud.</p><p>This is the example Ian Goodfellow opens <em>Deep Learning</em> with, the book half of us learned this stuff from. I hit it on about page 3, expected to skim past it, and instead sat there for ten minutes. It quietly reframed how I look at every hard problem since.</p><h3>A line that can’t be drawn</h3><p>Picture a scatterplot with two kinds of points, say, blue and red. The blue ones cluster in a little blob near the center. The red ones wrap all the way around them, like a ring. Your whole job is to draw <strong>one straight line</strong> that puts blue on one side and red on the other.</p><p>Go ahead and try. You can’t. Any straight line you draw slices through both the ring and the blob. Tilt it, shift it, angle it however you like; it always gets some blue and some red on the wrong side. With these coordinates, the task is, in the book’s exact words, <em>impossible.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzka-g6oNlPEKqLvaMU3CA.png" /><figcaption>A scatterplot with a blue cluster of points surrounded by a red ring; three dashed straight lines each pass through both groups, none separating them.</figcaption></figure><p>It’s tempting to blame the problem. A smarter algorithm, maybe. A bigger model. But the problem isn’t hard. We’re just looking at it from the wrong angle, literally.</p><h3>The reframe</h3><p>Here’s the move. Don’t touch the data. Don’t add a single point. Just change the two numbers you use to describe each one.</p><p>Right now every point is labeled by <em>where it is</em>: how far left-or-right (x) and how far up-or-down (y). Swap that for a different pair: how far the point sits <strong>from the center</strong> (its radius), and <strong>what angle</strong> it’s at.</p><p>Watch what happens to our two groups. The blue blob was near the center, so all its points have a <em>small</em> radius. The red ring was further out, so all its points have a <em>large</em> radius. Re-plot everything with radius on one axis, and the two groups fall into two clean bands.</p><p>Now draw your line. A single straight cut, “everything past this radius is red,” separates them perfectly. The task that was impossible a paragraph ago is now something you could solve with a ruler.</p><p>The points never moved. We just measured them against better axes. That’s the whole trick, and it has a name: <strong>representation.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHoNJppBEAsrjad4WVKtOw.png" /><figcaption>A scatterplot of the same two-class data in polar coordinates; blue points fall to the left of a vertical line and red points to the right, cleanly separated.</figcaption></figure><h3>This is everywhere, not just in math</h3><p>It shows up everywhere once you start noticing. Goodfellow points out that this dependence on representation runs through all of computer science and ordinary life. Searching a pile of data is slow; index that same data well and the search gets exponentially faster, same information, smarter arrangement. Arithmetic on Arabic numerals is easy; the identical arithmetic on Roman numerals is a slog. Nothing about the underlying problem changed. Only its representation did.</p><p>The quiet lesson is this, worth keeping even if you never train a model: <strong>a problem that feels impossible is often just a problem in the wrong coordinates.</strong> Before reaching for more compute, more data, a fancier model, it’s worth asking whether you’re simply describing the thing badly.</p><p>Which raises the obvious question. If the right representation makes everything easy… who picks the representation?</p><h3>The catch: nobody can see in a thousand dimensions</h3><p>For our scatterplot, switching to polar coordinates was easy, because we could <em>see</em> it. We looked at the picture, and the better axes were obvious.</p><p>Real problems don’t come with a picture. Take Goodfellow’s example: you want to write a program that detects cars in photos. You know cars have wheels, so a sensible feature would be “is there a wheel here?” Fine, now describe a wheel <em>in terms of raw pixel values.</em> A wheel is a simple shape, but in an actual photo it’s wrapped in shadow, glare off the metal, the fender cutting across it, a shopping cart parked in front of half of it. The clean idea “wheel” turns into a nightmare the moment you try to pin it to pixels.</p><p>For decades, this was the job. Smart people sat down and hand-designed the right features, the right coordinates, for each task, one at a time. It was slow, expensive, and deeply manual. Goodfellow notes that hand-crafting features for a genuinely complex task could take an entire research community <em>years.</em></p><h3>The payoff: let the machine find the coordinates</h3><p>Then came the idea that flipped everything. What if we don’t hand the machine the coordinates at all? What if we let it <strong>discover the representation itself, </strong>not just the answer, but the way of seeing that makes the answer easy?</p><p>That’s called <strong>representation learning</strong>, and it’s the heart of the book. Learned representations routinely beat hand-designed ones, and they adapt fast: a model can find a good set of features for a simple task in minutes, and for a hard one in hours, work that used to take people years. The textbook example is the <strong>autoencoder</strong>: squeeze data through an <em>encoder</em> into a new representation, then a <em>decoder</em> rebuilds the original from it, with the system trained to keep the parts that matter. It learns, on its own, a more useful way to write the data down.</p><p>And <strong>deep learning</strong> is just this idea, stacked. Each layer of a neural network is another change of coordinates. Raw pixels go in; the first layer bends them into a slightly more useful space, the next bends <em>that</em> into a better one, and on and on until, by the final layer, the data is arranged so cleanly that the last step only has to draw a straight line.</p><p>That’s why a book about enormous, powerful models opens with a humble scatterplot and a vertical line. The line was never the magic. The magic is everything that moved the data until a simple line was enough.</p><h3>So</h3><p>The next time something feels impossible, don’t assume you need a bigger hammer. Check the coordinates first. Deep learning’s real trick was never drawing smarter lines; it was learning where to stand so a simple line would do.</p><p>Or, to put it the way we started: make sure you’re not doing the whole thing in Roman numerals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5d1a03ad481" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/the-simple-idea-behind-deep-learning-its-not-the-math-you-think-e5d1a03ad481">The Simple Idea Behind Deep Learning (It’s Not the Math You Think)</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Cut My AI Agent’s Token Usage by 76% With One Change]]></title>
            <link>https://ai.plainenglish.io/how-i-cut-my-ai-agents-token-usage-by-76-with-one-change-18e6ba8ed501?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/18e6ba8ed501</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 13:32:42 GMT</pubDate>
            <atom:updated>2026-06-16T13:32:42.800Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Same task. Same model. One change, and tool calls dropped 87%, total tokens dropped 76%, and the bill got cheaper. Here’s exactly what I did and why it works.</em></p><p>If you’ve built anything with an agentic coding setup, you already know the quiet problem: the agent spends most of its budget just <em>finding its way around</em>. Before it writes a single useful line, it opens a file, reads it, opens the next one, reads that, follows an import, and reads again. Each read is more tokens in the context window, and each round trip is another tool call and another turn.</p><p>The model isn’t being dumb. It’s doing exactly what you’d do when walking into an unfamiliar codebase with no map, opening doors until you understand the layout. The difference is that the model pays for every door, every time.</p><p>So I tried something simple: instead of letting the agent read raw files to understand the code, I gave it a <strong>code graph</strong> to query first.</p><h3>What a code graph actually is</h3><p>A code graph is a pre-built, structured index of your codebase, the symbols, definitions, references, call relationships, and dependencies, stored in a form the agent can query directly.</p><p>Instead of “read this 600-line file to figure out where processPayment is defined and what calls it,&quot; the agent asks the graph: <em>where is this defined, what does it call, what calls it?</em> It gets back a precise, compact answer, not a wall of source code it has to wade through and hold in context.</p><p>The key insight is that <strong>most file reading is navigation, not comprehension.</strong> The agent doesn’t need the whole file. It needs to know how the pieces connect. A graph answers that in a fraction of the tokens.</p><h3>The numbers</h3><p>I ran the same task two ways, once with the code graph, once the traditional way, where the agent reads files to orient itself. Same task, same model. Here’s the comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWb2XeKL0L4VhErHMCXBuw.png" /></figure><p>4 tool calls instead of 30. 5 turns instead of 31. The agent went almost straight to the answer instead of spelunking through the repo.</p><h3>Why this scales</h3><p>The gap widens as the codebase grows. On a tiny repo, reading files directly is fine; there’s not much to read. But every new module, every new layer of indirection, adds more doors for the agent to open. File-reading cost grows with the size of the code. Graph-query cost grows with the size of the <em>question</em>, which is almost always far smaller.</p><p>That’s the whole bet: <strong>stop paying for navigation.</strong> Give the agent a map, and let it spend its context budget on the actual work.</p><h3>How to try it yourself</h3><p>You don’t have to build a code graph from scratch. The tool I used for this is <strong>CodeGraph, </strong>an open-source, local-first MCP server by <a href="https://github.com/colbymchenry">Colby McHenry</a> that indexes your repo and exposes it to the agent as queryable tools instead of raw file reads.</p><ul><li><strong>Repo:</strong> <a href="https://github.com/colbymchenry/codegraph">github.com/colbymchenry/codegraph</a> (MIT-licensed)</li><li><strong>npm:</strong> <a href="https://www.npmjs.com/package/@colbymchenry/codegraph">@colbymchenry/codegraph</a></li></ul><p>It runs entirely on your machine; no source code leaves it. Here’s the exact setup I ran with Claude Code.</p><p><strong>Prerequisite:</strong> Node.js and npm installed. (CodeGraph bundles its own runtime for the CLI and MCP server, so you don’t need to match a specific Node version for those.)</p><p><strong>Step 1: (optional) opt out of usage telemetry.</strong> CodeGraph sends anonymous usage stats by default: no source code, no file paths, no IP. If you’d rather send nothing:</p><pre>export DO_NOT_TRACK=1</pre><p>Add that line to your ~/.zshrc (or ~/.bashrc) to make it permanent.</p><p><strong>Step 2: Install the CLI.</strong></p><pre>npm install -g @colbymchenry/codegraph<br>codegraph version   # confirm it installed</pre><p><strong>Step 3: wire it in (do this once, ever).</strong></p><pre>codegraph install</pre><p>When prompted:</p><ul><li><strong>Which agent</strong> → choose Claude Code or any other agent you are using</li><li><strong>Auto-allow permissions?</strong> → Yes. It only auto-approves CodeGraph’s read-only lookup tools; it can’t run shell commands, edit, or write files.</li></ul><p>This is global, so it covers every project you open. You never repeat this step.</p><p><strong>Step 4: index each repo (once per repo).</strong> Inside each project folder:</p><pre>cd /path/to/your/repo<br>codegraph init</pre><p>This builds the index and creates a local .codegraph/ folder. From there, it auto-syncs as you edit; no need to re-run it. Keep the index out of version control:</p><pre>echo &quot;.codegraph/&quot; &gt;&gt; .gitignore</pre><p><strong>Step 5: restart your agent. </strong>Quit and reopen it (or start a fresh session) in the repo. The CodeGraph tools won’t appear in a session that was already open.</p><p><strong>Step 6: Verify it’s working.</strong></p><pre>codegraph status   # should show a populated index, no pending-sync warnings</pre><p>Then ask Claude a codebase question like <em>“what calls function X?”</em> and confirm it uses tools named mcp__codegraph__... rather than plain Read / Grep. If you see those, you&#39;re set.</p><p>The broader lesson goes beyond any one tool. As we hand agents bigger and bigger tasks, the winning move usually isn’t a bigger context window; it’s <strong>giving the agent a better way to find what it needs</strong> so it never has to load everything in the first place.</p><p>Read less. Ship more.</p><p><em>If you’re experimenting with context efficiency in agentic workflows, I’d love to compare notes. What’s working for you?</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18e6ba8ed501" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/how-i-cut-my-ai-agents-token-usage-by-76-with-one-change-18e6ba8ed501">How I Cut My AI Agent’s Token Usage by 76% With One Change</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Stopped Using Models in Rails Migrations]]></title>
            <link>https://medium.com/@mnawalali4/why-i-stopped-using-models-in-rails-migrations-eeb23d366576?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeb23d366576</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 09:04:43 GMT</pubDate>
            <atom:updated>2026-01-14T09:04:43.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQPpHN02Cmgb8eIx0ni0jg.png" /></figure><p>What staging success and production failures finally taught me</p><p>For a long time, I thought I was doing Rails migrations the “right” way.</p><ol><li>They ran fine locally.</li><li>They ran fine on staging.</li><li>They even passed code review without raising any eyebrows.</li></ol><p>And yet, every once in a while, a production release would fail.</p><p>Sometimes the migration crashed halfway through deployment. Other times it completed, but left the database in a state that didn’t match what the application expected. The most frustrating part was that these failures were <strong>inconsistent</strong>. The same migrations that behaved perfectly in staging would suddenly break when production ran them weeks later.</p><p>At first, I treated these as isolated incidents. Bad luck. Edge cases. “One of those things.”</p><p>Eventually, the pattern became impossible to ignore.</p><p>The common thread in every failure?<br> <strong>Migrations that relied on application models.</strong></p><p>That’s when I made a hard rule for myself:</p><blockquote><em>I stopped using models in Rails migrations.</em></blockquote><p>This article is about why.</p><p>Let’s walk through a situation that will feel familiar to many Rails teams.</p><p>An application is doing well and has grown beyond its early days. Users exist in the system, and each user belongs to a role that determines access and permissions.</p><pre>class User &lt; ApplicationRecord<br>  belongs_to :role<br>end</pre><pre>class Role &lt; ApplicationRecord<br>  has_many :users<br>end</pre><p>At some point, the product team asks for better reporting. They want to see a user’s role name directly on the user record so reports don’t need joins across multiple tables.</p><p>Reasonable request. Reasonable solution.</p><h3>A “Safe” Migration</h3><p>The team decides to denormalise the role name onto the users table. The requirements are clear:</p><ul><li>Add a role_name column</li><li>Populate it for existing users</li><li>Ensure it can’t be NULL</li></ul><p>The migration looks straightforward.</p><pre>class AddRoleNameToUsers &lt; ActiveRecord::Migration[7.0]<br>  def up<br>    add_column :users, :role_name, :string<br><br>    User.find_each do |user|<br>      user.update!(role_name: user.role.name)<br>    end<br><br>    change_column_null :users, :role_name, false<br>  end<br><br>  def down<br>    remove_column :users, :role_name<br>  end<br>end</pre><p><strong>Locally</strong>, everything works.<br>On <strong>staging</strong>, everything works.</p><p>The migration ships, gets merged, and moves on to the next task.</p><h3>Time Passes</h3><p>Weeks go by before the next production release.</p><p>In the meantime, the application evolves.</p><p>The team realizes the role system is too rigid. A refactor begins. Roles are replaced with a more flexible permissions model stored in a JSON column. The Role model disappears. The role association on User is removed.</p><pre>class User &lt; ApplicationRecord<br>  store_accessor :permissions, :admin, :editor<br>end</pre><p>Staging already ran the migration, so no alarms go off. Tests pass. Development continues.</p><h3>Release Day</h3><p>Production deploys.</p><p>As part of the release, Rails starts running all pending migrations. When it reaches AddRoleNameToUsers, it loads the <strong>current application code</strong> and executes:</p><pre>User.find_each do |user|<br>  user.update!(role_name: user.role.name)<br>end</pre><p>But now:</p><ul><li>role doesn’t exist</li><li>Role doesn’t exist</li><li>The application code has moved on</li></ul><p>The deployment halts.</p><pre>NoMethodError: undefined method `role&#39; for User</pre><p>Production is stuck mid-deploy.</p><p>Rollback is required.</p><p>The release is delayed.</p><h3>Why This Was Inevitable</h3><p>Nothing about this migration was obviously wrong when it was written.</p><p>The problem wasn’t the code.<br> The problem was <strong>time</strong>.</p><p>The migration depended on:</p><ul><li>a model (User)</li><li>an association (role)</li><li>application behaviour that no longer existed</li></ul><p>Migrations are permanent.</p><p>Application code is not.</p><p>By tying a migration to live models, the migration became fragile, guaranteed to break eventually as the codebase evolved.</p><h3>The Safe Alternative: Trust the Database, Not the App</h3><p>At migration time, there is exactly one reliable source of truth: <strong>the database schema</strong>.</p><p>Tables exist.<br>Columns exist.<br>Foreign keys exist.</p><p>Models are optional.</p><p><strong>SQL-Based Migration (Most Resilient)</strong></p><pre>class AddRoleNameToUsers &lt; ActiveRecord::Migration[7.0]<br>  def up<br>    add_column :users, :role_name, :string<br><br>    execute &lt;&lt;~SQL<br>      UPDATE users<br>      SET role_name = roles.name<br>      FROM roles<br>      WHERE roles.id = users.role_id<br>    SQL<br><br>    change_column_null :users, :role_name, false<br>  end<br><br>  def down<br>    remove_column :users, :role_name<br>  end<br>end</pre><p>This migration survives:</p><ul><li>model renames</li><li>association removals</li><li>application refactors</li></ul><p>Because it depends only on the database state at that moment in time.</p><h3>Temporary Models: A Compromise</h3><p>If SQL feels too low-level, a temporary model can be defined inside the migration.</p><pre>class AddRoleNameToUsers &lt; ActiveRecord::Migration[7.0]<br>  class User &lt; ActiveRecord::Base<br>    self.table_name = &quot;users&quot;<br>  end<br><br>  def up<br>    add_column :users, :role_name, :string<br><br>    User.update_all(role_name: &quot;unknown&quot;)<br><br>    change_column_null :users, :role_name, false<br>  end<br>end</pre><p>This creates a <strong>snapshot model</strong> frozen in the context of the migration. Even if User changes later, this migration remains safe.</p><h3>The Lesson</h3><p>This failure wasn’t caused by bad developers or rushed code.</p><p>It was caused by a subtle misunderstanding:</p><blockquote><strong><em>Migrations don’t live in the present.<br> They live forever.</em></strong></blockquote><p>If a migration relies on application models, it will eventually break, not because someone made a mistake, but because the application evolved.</p><h3>Where This Leaves Us</h3><p>Avoiding models in migrations is not about being paranoid.<br> It’s about acknowledging reality:</p><ul><li>Code changes</li><li>Schemas don’t</li><li>Time always wins</li></ul><p>Once we accepted this, our production releases stopped being a gamble.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb23d366576" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Just Because You Can Doesn’t Mean You Should: Engineering Decisions Beyond the Hype]]></title>
            <link>https://medium.com/@mnawalali4/just-because-you-can-doesnt-mean-you-should-engineering-decisions-beyond-the-hype-9f7974ca639e?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f7974ca639e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Fri, 19 Dec 2025 04:04:35 GMT</pubDate>
            <atom:updated>2025-12-19T04:04:35.314Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQKnEgvJ7Z0jZ6QIn11ipg.png" /></figure><p>In software engineering, especially in startups and early-stage products, we often confuse <strong>capability</strong> with <strong>necessity</strong>.</p><p>Just because you <em>can</em> set up a complex, highly scalable, enterprise-grade infrastructure doesn’t mean you <em>should, </em>at least not yet.</p><p>This article isn’t an attack on AWS, nor is it blind praise for platforms like Render or Heroku. Instead, it’s a reflection on <strong>engineering judgment</strong>, <strong>context</strong>, and <strong>stage-aware decision making</strong>.</p><h3>The Trap Many Teams Fall Into (It’s Not About the Tool)</h3><p>There’s an important clarification to make early on:</p><p>This is <strong>not</strong> about telling people <em>what tools they should or shouldn’t use</em>.</p><p>It’s about <strong>using tools without understanding them, </strong>often for the wrong reasons.</p><p>Here’s a scenario I’ve seen repeatedly:</p><ul><li>A team chooses a powerful platform (often AWS)</li><li>Not because the product demands it</li><li>But because it <em>sounds</em> professional or future‑proof</li><li>Or because “that’s what real companies use”</li></ul><p>The result isn’t scale, it’s fragility.</p><p>Pages load slowly despite low traffic. Small changes break deployments. Simple issues take hours to debug.</p><p>Not because AWS is bad, but because it’s being driven without knowing how the engine works.</p><h3>AWS Is Not the Villain, Misuse Is</h3><p>Let’s be very clear:</p><p>AWS is an <strong>exceptional platform</strong>.</p><p>Used correctly, it powers some of the most reliable systems in the world.</p><p>The problem arises when teams adopt AWS <strong>without a solid grip on what they’re configuring</strong>.</p><p>AWS doesn’t protect you from poor decisions. It amplifies them.</p><p>Incorrect networking setups, inefficient instance choices, misconfigured load balancers, or lack of caching won’t fail loudly, they’ll fail subtly, through slow pages, random outages, and unpredictable behaviour.</p><p>That’s not an AWS problem.</p><p>That’s an understanding problem.</p><h3>The Hidden Cost: Understanding Before Optimisation</h3><p>The real cost of powerful infrastructure is not just financial.</p><p>It’s <strong>cognitive load</strong>.</p><p>With platforms like AWS, every abstraction you touch assumes knowledge:</p><ul><li>How traffic flows</li><li>Where bottlenecks occur</li><li>How services interact</li><li>What happens when something fails</li></ul><p>If that mental model is missing, the system still runs, just poorly.</p><p>This is where teams get trapped in a dangerous middle ground:</p><ul><li>Too complex for their understanding</li><li>Not complex enough to justify the trade‑off</li></ul><p>In early teams, attention and clarity are limited resources. Misplaced complexity quietly drains both.</p><h3>Why Opinionated Platforms Exist</h3><p>Platforms like Render or Heroku aren’t “beginner tools.”</p><p>They are <strong>guardrails</strong>.</p><p>They intentionally limit how much you can misconfigure:</p><ul><li>Sensible defaults</li><li>Managed networking</li><li>Predictable deployments</li></ul><p>This doesn’t make them superior.</p><p>It makes them <em>safer</em> when deep infrastructure expertise isn’t present.</p><p>When a team understands infrastructure deeply, those guardrails may feel restrictive.</p><p>When they don’t, those same guardrails prevent self‑inflicted wounds.</p><h3>Capability Without Competence Is Risk</h3><p>Good engineering is not about how advanced your stack looks.</p><p>It’s about how well you understand the tools you’ve chosen.</p><p>Using AWS without that understanding often leads to:</p><ul><li>Performance issues under minimal load</li><li>Over‑engineered but brittle systems</li><li>Debugging sessions that feel like guesswork</li></ul><p>The issue isn’t stage alone.</p><p>It’s <strong>competence matching capability</strong>.</p><h3>Complexity Has a Compounding Effect</h3><p>Infrastructure decisions are sticky.</p><p>Once complexity enters the system:</p><ul><li>Onboarding new engineers becomes slower</li><li>Small changes take longer to ship</li><li>Debugging involves more layers</li><li>Fear of breaking things increases</li></ul><p>What started as “future-proofing” slowly becomes <strong>present-day friction</strong>.</p><h3>“But We’ll Need It Eventually” Isn’t a Reason</h3><p>Needing a tool in the future doesn’t justify using it poorly today.</p><p>Learning AWS gradually, intentionally, and with clear goals is very different from deploying it wholesale for the sake of optics.</p><p>Infrastructure should be introduced when:</p><ul><li>The team understands the failure modes</li><li>The product demands the flexibility</li><li>The complexity solves a real, present problem</li></ul><p>Anything else is experimentation, and experimentation in production is expensive.</p><h3>Engineering Maturity Is Knowing When Not to Use Something</h3><p>Junior thinking:</p><blockquote><em>“We should use AWS because it’s powerful.”</em></blockquote><p>Senior thinking:</p><blockquote><em>“What problem does this solve </em>right now<em>, and what does it cost us in focus?”</em></blockquote><p>Maturity in engineering often shows up as <strong>restraint</strong>, not ambition.</p><h3>Final Thought</h3><p>No one should be told what tools they’re allowed to use.</p><p>But every engineer should ask themselves <strong>why</strong> they’re using a tool, and whether they truly understand it.</p><p>Powerful platforms reward clarity and punish guesswork.</p><p>There’s no shame in choosing simplicity.</p><p>There <em>is</em> risk in choosing complexity for the thrill of it.</p><p>Just because you can use a powerful tool doesn’t mean you’re ready to, or that your product will benefit from it yet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f7974ca639e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React2Shell Explained: How a Critical React Server Components Vulnerability Exposed Next.js Apps]]></title>
            <link>https://medium.com/@mnawalali4/react2shell-explained-how-a-critical-react-server-components-vulnerability-exposed-next-js-apps-17888a52a74c?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/17888a52a74c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 11:36:06 GMT</pubDate>
            <atom:updated>2025-12-14T11:36:06.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZOnkvElSaZUGrbv_R89zw.png" /><figcaption>React2Shell exposed a critical remote code execution flaw in React Server Components used by Next.js App Router</figcaption></figure><p>At the start of December 2025, a set of critical security vulnerabilities, collectively nicknamed <a href="https://vercel.com/kb/bulletin/react2shell#understanding-react2shell"><strong>React2Shell</strong></a><strong>, </strong>were publicly disclosed in <strong>React Server Components (RSC)</strong> and <strong>Next.js</strong>. These weren’t just minor bugs, they exposed live web servers to remote attackers, in some cases without any authentication at all.</p><p>This article breaks down what these vulnerabilities actually are, what they could let attackers do, and why every modern React/Next.js app should take note of this event.</p><h3><strong>What Was the Root Cause?</strong></h3><h4>React Server Components &amp; the “Flight” Protocol</h4><p>React Server Components (RSC) are a way for React to run some UI code <em>on the server</em> instead of in the browser. They’re widely used in frameworks like <strong>Next.js App Router</strong>.</p><p>To make this work, React has a special internal communication system called the <strong>Flight protocol, </strong>it lets the client request components from the server and receive them in a structured format.</p><p>The React2Shell issue stemmed from <a href="https://nvd.nist.gov/vuln/detail/CVE-2025-55182"><strong>unsafe deserialisation</strong></a> in that protocol, meaning the server trusted data coming in and turned it into internal objects <em>without proper safety checks</em>.</p><h3>🔴 CVE-2025–55182, The “React2Shell” Vulnerability</h3><p>The main vulnerability, tracked as <strong>CVE-2025–55182, </strong>was rated <strong>Critical (CVSS 10.0)</strong>, the highest possible severity score.</p><h4>Why This Was So Dangerous</h4><ul><li><strong>Unauthenticated</strong>: Attackers did not need to sign in or prove they were legitimate.</li><li><strong>Remote</strong>: The bug could be triggered over the internet.</li><li><strong>Code Execution</strong>: It allowed attackers to run arbitrary commands on your production server.</li></ul><p>In simple terms, an attacker could send a malicious network request to a vulnerable server and cause that server to execute their own code. That could include reading environment variables, accessing your database, or even installing malware.</p><p>This wasn’t a theoretical or local issue, it was a remote execution hole in core React code used by millions of apps.</p><p>React2Shell wasn’t a Next.js bug <em>per se, </em>but because Next.js uses React Server Components by default in App Router projects, nearly all modern Next.js apps inherited the same flaw.</p><h3>Two Additional Exposures: CVE-2025–55184 &amp; CVE-2025–55183</h3><p>Shortly after React2Shell went public, researchers found two <em>more</em> important issues in the React Server Components codebase:</p><h4><a href="https://vercel.com/kb/bulletin/security-bulletin-cve-2025-55184-and-cve-2025-55183"><strong>CVE-2025–55184</strong></a><strong>, Denial of Service</strong></h4><p>This one lets an attacker send specially crafted requests to make a server <strong>enter an infinite loop</strong> or hang, effectively knocking it offline.</p><h4><a href="https://vercel.com/kb/bulletin/security-bulletin-cve-2025-55184-and-cve-2025-55183">CVE-2025–55183</a>, Source Code Exposure</h4><p>This vulnerability could allow an attacker to retrieve internal compiled server code, potentially exposing business logic or secrets embedded directly in code.</p><h3>What This Meant for Your App</h3><p>Here’s what developers needed to understand about their exposure, without diving into patching strategies:</p><p><strong>1. You Didn’t Need a Login to Be Hit</strong></p><p>Because the vulnerability lived in how React serialised/deserialised incoming data, an attacker simply needed network access.</p><p><strong>2. It Didn’t Matter What Your Code Looked Like</strong></p><p>You could be serving static pages, have no API routes, or use Server Functions rarely, if the server could talk Flight, the bug could be triggered.</p><p><strong>3. Attackers Were Already Hunting for This</strong></p><p>Public scanning and exploitation activity began within hours of disclosure. Security researchers and defenders observed attackers probing the internet for vulnerable endpoints. <a href="https://www.darkreading.com/vulnerabilities-threats/exploitation-activity-ramps-react2shell?">Dark Reading</a></p><p><em>Note: </em>If your app uses RSC or App Router, consider reviewing your deployments for exposure.</p><p><strong>Official References</strong></p><ul><li><strong>Vercel React2Shell Security Bulletin, </strong>official overview and explanation:<br> <a href="https://vercel.com/kb/bulletin/react2shell#understanding-react2shell">https://vercel.com/kb/bulletin/react2shell#understanding-react2shell</a></li><li><strong>Vercel Change log: CVE-2025–55182, </strong>short change log entry confirming the issue: <a href="https://vercel.com/changelog/cve-2025-55182">https://vercel.com/changelog/cve-2025-55182</a></li><li><strong>Vercel Bulletin: CVE-2025–55184 &amp; CVE-2025–55183</strong>, deeper details on DoS and source exposure: <a href="https://vercel.com/kb/bulletin/security-bulletin-cve-2025-55184-and-cve-2025-55183">https://vercel.com/kb/bulletin/security-bulletin-cve-2025-55184-and-cve-2025-55183</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17888a52a74c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From 25 Seconds to 500ms: The Performance Fix That Taught Me a Bigger Lesson]]></title>
            <link>https://medium.com/@mnawalali4/from-25-seconds-to-500ms-the-performance-fix-that-taught-me-a-bigger-lesson-09e1f636bd5a?source=rss-9f7e7fc44ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/09e1f636bd5a</guid>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Mohammad Nawal Ali]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 07:53:18 GMT</pubDate>
            <atom:updated>2025-12-13T07:53:18.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h14qwNEDvKUfjp4Z7BqnYg.png" /></figure><p>Performance issues tend to appear at the most inconvenient times, especially when an endpoint supports a highly used part of the product. Recently, I worked on improving a heavy API endpoint that powered a dynamic view showing hundreds of items at once.</p><p>The original version worked, but it wasn’t efficient. It returned <strong>700+ records</strong> with all their attached data in one go, resulting in a <strong>25-second</strong> response time. Not ideal for a real-time user interface.</p><p>Through investigation and targeted fixes, the endpoint now responds in <strong>~500ms</strong>, without adding any unnecessary architectural complexity.</p><p>This is the story of how we approached the problem, the strategies we used, and what we learned along the way.</p><h4>The Performance Problem</h4><p>The view needed to load a large set of time-based entries at once. Over time, more fields and related data were added to the endpoint, increasing its weight. The result was:</p><ol><li>A large response payload</li><li>High processing time on the server</li><li>A long wait for the user before anything appeared</li></ol><p>The core issue wasn’t that the endpoint returned many items; modern systems handle that well. The problem was <strong>how</strong> the data was being fetched and assembled.</p><h4>The Architectural Question</h4><p>During discussions, a natural question came up:</p><blockquote><strong>Should we introduce data redundancy or pre-computed fields to speed things up?</strong></blockquote><p>This kind of optimisation works well at massive scale or in event-sourced systems, but it also adds:</p><ul><li>Additional write-time complexity</li><li>Data synchronisation challenges</li><li>Maintenance overhead</li></ul><p>Before making such a decision, we needed evidence that the problem truly required deeper structural changes.</p><p>So instead of immediately modifying the data model, I decided to trace the flow of the endpoint.</p><h4>The Investigation: Finding the Real Bottleneck</h4><p>By walking through logs, inspecting the request lifecycle, and profiling the endpoint, a clear pattern emerged:</p><blockquote><strong>A large portion of time was spent repeatedly fetching related data, a textbook N+1 query pattern.</strong></blockquote><p>Even small queries add up when multiplied across hundreds of items.</p><p>This kind of issue often hides quietly until the dataset grows large enough for it to become noticeable.</p><h4><strong>The Optimisation Strategy</strong></h4><p><strong>1. Load Only What the UI Needs Initially</strong></p><p>The first pass of the UI only displays essential information. <br>Instead of constructing a fully detailed dataset for each item, we limited the initial response to the fields necessary for the UI.</p><p>This significantly reduced payload size and processing cost.</p><p><strong>2. A Dedicated “Details Fetch” for Deeper Information</strong></p><p>Rather than sending everything upfront, we introduced a clean separation:</p><ol><li><em>Initial request:</em> Lightweight summary of each item</li><li><em>On-click request:</em> Fetch detailed information only when a user selects an item</li></ol><p>This pattern aligns with modern API principles:</p><ul><li>Progressive data loading</li><li>Reducing unnecessary work</li><li>Faster perceived performance</li></ul><p><strong>3. Resolve N+1 Query Patterns with Smarter Data Loading</strong></p><p>Instead of fetching related information repeatedly inside loops, we restructured the backend logic so related data was efficiently loaded in a single pass.</p><p>This was the single biggest contributor to the performance jump.</p><p><strong>4. Remove Unnecessary Per-Item Computation</strong></p><p>Several computations were executing for every entry. We optimized these by:<br>1. Moving non-critical logic out of the request cycle <br>2. Streamlining how derived values were generated</p><p>Every small improvement compounded at scale.</p><p><strong>The Result: A Dramatic Improvement</strong></p><p>The outcome of these refinements was significant:</p><ul><li>Response time dropped from<strong> 25 seconds to roughly 500ms</strong></li><li>The UI became instantly usable</li><li>Server load reduced</li><li>No major structural changes or redundancy were needed</li><li>The codebase remained simple and flexible for future growth</li></ul><p>This reinforced an important principle:</p><ul><li>You don’t always need to add complexity to achieve performance.</li><li>Sometimes the biggest wins come from understanding how your existing system behaves.</li></ul><p><strong>What I Learned</strong></p><p><strong>1. Measure Before You Modify </strong><br>Performance problems are often symptoms, not causes. Profiling tools give clarity before big architectural changes.</p><p><strong>2. Avoid Premature Redundancy</strong> <br>Redundancy is powerful but should be introduced intentionally.</p><p><strong>3. Design Endpoints for Real User Needs </strong><br>Separate “summary view” and “details view” data. They serve different purposes.</p><p><strong>4. Eliminate N+1 Early </strong><br>These patterns grow quietly, then suddenly become expensive.</p><p><strong>Final Thoughts</strong></p><p>This optimisation journey was a reminder of how valuable it is to first <strong>understand </strong>a system before restructuring it. By focusing on targeted improvements, rather than reaching immediately for heavy changes, we delivered a significantly faster experience with far less complexity.</p><p>Sometimes, the best optimisations aren’t about doing <strong>more, </strong>they’re about doing<strong> less</strong>, but smarter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09e1f636bd5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>