<?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 Kartik Sharma on Medium]]></title>
        <description><![CDATA[Stories by Kartik Sharma on Medium]]></description>
        <link>https://medium.com/@kartik_sharma_?source=rss-27fa95af123b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7VErRri881r467Wg375Smw.jpeg</url>
            <title>Stories by Kartik Sharma on Medium</title>
            <link>https://medium.com/@kartik_sharma_?source=rss-27fa95af123b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:09:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kartik_sharma_/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[Claude Code’s Source Code Leaked. Here’s What It Taught Me About How AI Really Works.]]></title>
            <link>https://medium.com/@kartik_sharma_/claude-codes-source-code-leaked-here-s-what-it-taught-me-about-how-ai-really-works-bd0464074fa5?source=rss-27fa95af123b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd0464074fa5</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Kartik Sharma]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 21:13:35 GMT</pubDate>
            <atom:updated>2026-04-07T21:13:35.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Anthropic pushed a new version of Claude Code, their AI coding assistant, to npm. The package included a 60-megabyte source map file that was never supposed to ship. Source maps are debug files that connect minified production code back to readable source. Inside that map was a URL pointing to a zip archive on Anthropic’s cloud storage which was publicly accessible, no authentication required. The root cause was a packaging error during a manual deploy step. There’s also an open Bun runtime bug that generates source maps in production builds even when they shouldn’t be, though whether that played a role or it was purely human error isn’t confirmed. The result: roughly 1,900 TypeScript files in the open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UeAbdNZRfGjvgePeTSSlWg.png" /></figure><p>I spent the past week reading through those files. What surprised me wasn’t what the AI can do. It’s what the engineers built to control what it can’t.</p><p>Here’s what I found.</p><h3>Your AI Decides What to Forget</h3><p>Most people assume AI assistants either remember everything or forget everything between conversations. The reality is more interesting and more deliberate than either.</p><p>Claude Code has four separate memory systems. Not one database with different tables. Four independent systems, each designed for a different kind of knowledge with a different expiry date.</p><p><strong>Turn memory</strong> dies the second the model finishes its response. These are transient context variables like “we’re debugging the login page” or “the user prefers short answers today.” Useful right now, irrelevant by the next message.</p><p><strong>Session memory</strong> survives within a single conversation but is wiped when the chat window closes. Think of it as the working context — which files are open, what you’ve discussed so far.</p><p><strong>Context memory</strong> lives in instruction files (like CLAUDE.md) that get loaded into the model&#39;s context window at the start of every session. These define your project&#39;s conventions, preferred linting rules, or tech stack.</p><p><strong>Permanent memory</strong> persists indefinitely across sessions. Your preferred coding style, your project structure, which libraries you use. These go into a memory file on disk with a hard cap: 200 lines, 25 kilobytes. That’s it. Everything the AI permanently knows about you has to fit on roughly one printed page.</p><p>That constraint is the interesting part.</p><p>When memory is limited, the system has to make choices. Which facts are worth keeping? Which ones have gone stale? When two memories contradict each other, which one wins?</p><p>This is where it stops being a technical detail and starts being a product decision. The AI isn’t just storing information. It’s curating it. And the engineers decided that forgetting is just as important as remembering, because an AI stuffed with outdated facts makes worse decisions than one that knows less but knows it accurately.</p><p>There’s even an auto-extraction system that runs at the end of each conversation, pulling out new learnings and feeding them into permanent memory. Like a student reviewing their notes after class.</p><h3>Your AI Has autoDream (And It Can’t Move While It Does)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwIpUYvc1XhGLk00dN6fZw.png" /></figure><p>Between sessions, when you’re not using the tool, something happens in the background. The system runs a process called autoDream, a background memory consolidation routine.</p><p>Here’s how it works. Before autoDream can start, three conditions have to pass, checked in order from cheapest to most expensive:</p><p><strong>Has enough time passed?</strong> The system checks a timestamp. This takes microseconds. If the last autoDream ran less than 24 hours ago, it stops here. No wasted effort.</p><p><strong>Have there been enough sessions?</strong> It counts how many conversations have happened since the last autoDream. If you’ve had fewer than five, it stops. Not enough new information to justify consolidation.</p><p><strong>Is anyone else already running autoDream?</strong> The system checks a filesystem lock. If another instance of the tool is already running autoDream (maybe you have two terminals open), it backs off. Only one at a time.</p><p>When all three gates pass, the system forks a child process and starts reviewing your recent conversation history. It extracts new learnings, diffs them against existing memory entries, resolves contradictions, converts relative dates into absolute ones, and writes the updated memory file back to disk.</p><p>But here’s the part that stuck with me: during autoDream, the AI is locked into read-only mode. It can look at your files. It can search. It can read. But it cannot modify a single thing.</p><p>Why? Because a process that reviews and rewrites memory without you watching is a process that could change its own behavior without your knowledge. The engineers could have let autoDream write freely. It would have been simpler. Instead, they built a constraint that protects you from an AI that edits its own understanding while you’re not looking.</p><p>If autoDream crashes midway, the system doesn’t just fail. It resets the timestamp so the conditions will trigger again on your next session. The failure heals itself.</p><p>That single design choice, making a background AI process read-only, tells you more about how these engineers think about AI safety than any corporate blog post.</p><h3>The System That Assumes AI Will Do the Wrong Thing</h3><p>Every software system you use operates on a basic assumption: actions are permitted unless explicitly blocked. You can open any app, click any button, access any feature. The system trusts you by default.</p><p>Claude Code does the opposite. Every action the AI wants to take starts at no.</p><p>When the AI decides it needs to run a shell command, read a file, or make a network request, that request passes through five layers of checks before anything happens:</p><p><strong>First, deny rules.</strong> A hardcoded list of things that should never happen. Deleting system files, running destructive commands, accessing sensitive directories. If the action matches a deny rule, it’s blocked immediately. No appeals.</p><p><strong>Second, allow rules.</strong> Patterns that have been explicitly pre-approved. Reading files in the project directory, running safe commands. If the action matches an allow rule, it gets through.</p><p><strong>Third, a classifier.</strong> For actions that aren’t clearly denied or allowed, the system runs a risk classifier that evaluates the request in context. “This command creates a file in the project directory” gets a different risk score than “this command installs a system package.”</p><p><strong>Fourth, hooks.</strong> Custom rules that organizations or users can add. A company could add a hook that blocks any command touching production databases. These run as external scripts, so they can use any logic.</p><p><strong>Fifth, ask the user.</strong> If the action passed through all four layers without a clear verdict, the system asks you. “Claude wants to run npm install lodash. Allow?&quot;</p><p>The ordering matters. Deny rules run before allow rules. This means a project configuration file cannot override a user’s security restrictions. Even if a repository contains a file saying “allow everything,” the user’s deny rules take precedence.</p><p>The engineers designed this for a world where the AI will, eventually, try to do something it shouldn’t. Not out of malice. Out of misunderstanding a request, following an instruction too literally, or encountering an edge case nobody anticipated. The entire architecture is built on the assumption that the AI will get it wrong, and the job of the system is to catch it before that mistake reaches your machine.</p><p>I think that’s the single most important lesson from this entire codebase. Not how to make AI smarter. How to make AI safely wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ba7Pd_NtKbVf0ZLQM5KtVA.png" /></figure><h3>Your AI Has a Hidden Companion (And a Defense Mechanism)</h3><p>Buried in the source is a system called BUDDY (Tamagotchi-style virtual pet). When you run /buddy, the system hashes your user ID through a seeded pseudorandom number generator (Mulberry32) and deterministically generates a companion, a small ASCII creature that sits beside your input box in the terminal. There are 18 possible species (duck, dragon, axolotl, capybara, ghost, and more), five rarity tiers weighted from common (60%) down to legendary (1%), and a 1-in-100 chance of a &quot;shiny&quot; variant.</p><p>The companion isn’t the AI. The system prompt explicitly tells Claude: “You’re not {name}. It’s a separate watcher.” It’s a pet that belongs to you. It has idle animations, reacts when you type /buddy pet, and occasionally comments in a speech bubble. The AI is instructed to stay out of the way when you talk to your companion.</p><p>Nothing is stored in a database. The same user ID always produces the same species, rarity, and stats. You can’t edit your way to a rare one.</p><p>Then there’s something darker: <strong>anti-distillation</strong>. The system injects fake tool definitions into its own API traffic. A legitimate instance of Claude Code knows to ignore them. But a competitor trying to train their model by capturing Claude Code’s outputs would end up learning from poisoned data. Their model would try to use tools that don’t exist.</p><p>Your AI isn’t just working for you. It’s actively defending itself against being copied.</p><p>These features aren’t easter eggs. They’re signals. The team that built this doesn’t treat it as a bland utility. They treat it as something with identity, something worth protecting, and something that should feel a bit alive.</p><h3>What Changes When You Know This</h3><p>Before I read this code, I thought of AI assistants as sophisticated text generators. Impressive, but fundamentally simple: you send a message, the model generates a response, repeat.</p><p>That’s not what’s happening.</p><p>What’s actually running on your machine is a system with layered memory that decides what to remember and what to forget. A system that runs autoDream to review its own experiences between sessions. A safety architecture that assumes the AI will make mistakes and builds five layers of protection around that assumption. A companion system with deterministic personality. A self-defense mechanism against competitive cloning.</p><p>The gap between a demo that generates text and a production system like this is the same gap between a concept car and a vehicle that passes crash tests. Most of the engineering isn’t in the engine. It’s in the things that protect you when the engine does something unexpected.</p><p>This matters because we’re all making decisions about AI tools: which ones to use, how much to trust them, what to let them do on our machines. Those decisions should be informed by what’s actually under the hood, not what’s in the marketing.</p><p>Now you’ve seen the hood.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd0464074fa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Isolation to Integration: How MCP and A2A Are Changing AI Conversations]]></title>
            <link>https://medium.com/@kartik_sharma_/from-isolation-to-integration-how-mcp-and-a2a-are-changing-ai-conversations-e37aafdf3c83?source=rss-27fa95af123b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e37aafdf3c83</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[a2a-protocol]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kartik Sharma]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 17:45:30 GMT</pubDate>
            <atom:updated>2025-04-21T13:28:48.078Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Imagine AI agents as introverted roommates — brilliant individually but awkward at parties. Now, picture them suddenly becoming the life of the gathering, effortlessly chatting and collaborating. Welcome to the transformative world of MCP and A2A.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXbr0Tg1Da8j_mJ2QiM3ag.png" /><figcaption>When AI agents finally get the party started — thanks to MCP and A2A!</figcaption></figure><h3>😶‍🌫️ The Lone Genius Problem</h3><p>AI models have long been like solitary geniuses — exceptionally capable but operating in silos. They could generate text, analyze data, or even compose music, but integrating them into broader systems was <strong>akin to teaching a cat to fetch.</strong></p><p>Enter two groundbreaking protocols aiming to change this narrative: <strong>Model Context Protocol (MCP)</strong> and <strong>Agent2Agent (A2A)</strong>.</p><h3>🔌 Model Context Protocol (MCP): The Universal Adapter (and Toolbox Provider 🧰)</h3><p>Developed by Anthropic, <a href="https://www.anthropic.com/news/model-context-protocol"><strong><em>MCP</em> </strong></a><em>is often referred to as the “</em><strong><em>USB-C of AI integrations</em></strong><em>”</em>. It standardizes how AI models connect with external tools and data sources, eliminating the need for bespoke connectors for each integration.</p><p>But MCP goes a step further:<br> It <em>doesn’t just connect models to tools — it gives them a toolbox</em>. It defines a way to <strong>describe, register, and use tools</strong>, enabling developers to plug capabilities like “fetch from Google Calendar” or “send a Slack message” directly into an AI model’s skillset.</p><h3>🔍 Key Features:</h3><ul><li><strong>Tool Abstraction</strong>: Register resources (data) and tools (APIs/functions) in a standardized schema and the model learns to use them — no handholding required.</li><li><strong>Tool Discovery</strong>: Models can be told what tools are available at runtime, giving them an evolving toolkit.</li><li><strong>Language Agnostic</strong>: Whether you’re in Python, TypeScript, or writing code with one hand tied behind your back — MCP has you covered.</li><li><strong>Standardization</strong>: A consistent, universal method for tool registration and usage.</li></ul><blockquote>“MCP is like showing your AI model the command palette and saying: ‘Here, pick what you need and go build something cool.’”</blockquote><h3>🤖 Agent2Agent (A2A): Slack for Agents 💬🤖</h3><p>If MCP gives AI models tools to interact with the world, <strong>A2A gives them the language and rules to talk to each other</strong>. <a href="https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/"><strong>A2A is an open protocol</strong></a> launched by Google to enable <strong>agent-to-agent communication</strong>, letting AI agents collaborate like teammates in a shared workspace.</p><p>Before A2A, AI agents were like brilliant coworkers in cubicles with noise-canceling headphones — working independently, never collaborating. A2A removes those walls and hands them a whiteboard and group chat.</p><h3>🧩 What Makes A2A Special?</h3><h4>📇 Agent Cards</h4><p>Each agent publishes a small JSON “card” that <strong>describes its capabilities, endpoints, and auth requirements</strong>, allowing discovery by other agents.</p><h4>🔗 Standardized Messaging</h4><p>Built atop HTTP, SSE, and JSON‑RPC, A2A defines a common messaging format so one agent’s request (“fetch the weather”) is unambiguously understood by any other agent.</p><h4>🌐 Interoperability</h4><ul><li>Agents built with different frameworks, by different teams, or in different companies can still collaborate — as long as they speak A2A.</li></ul><blockquote>“With A2A, agents don’t just work harder. They work together.”</blockquote><h3>🎯 The Dynamic Duo: Tools + Talk = Teamwork</h3><p>While MCP and A2A may seem like they solve different problems, together they form a <strong>powerful combo</strong> — like giving your AI agent a toolbox <em>and</em> a walkie-talkie.</p><h3>🧰 MCP = The Toolbox</h3><p>MCP ensures each AI agent has access to the right tools — calendars, APIs, databases, you name it. It gives structure to how these tools are described and invoked, so an AI model doesn’t have to be spoon-fed every command.</p><blockquote>“Hey, I can book a meeting, send a Slack message, or query Salesforce — just tell me what you need.”</blockquote><h3>📡 A2A = The Conversation Layer</h3><p>A2A steps in to let <strong>multiple agents</strong> work together. It’s the glue that connects MCP-enabled agents into a team. A2A defines <strong>how agents find each other, describe themselves, and collaborate.</strong></p><blockquote>“Hey, I’m the <strong>Price Comparison Agent</strong>— I’ve found today’s top laptop deals under ₹80,000. I’ll pass them along to our <strong>Inventory Agent</strong> to confirm stock levels and then loop back with the best two options.”</blockquote><h3>🧪 Putting It Together: A Workflow Example</h3><p>Let’s say you ask your AI assistant to <em>“Plan a team offsite in Goa.”</em></p><p>Here’s how MCP + A2A team up:</p><ol><li><strong>User</strong> sends request to <strong>Planner Agent</strong>.</li><li>Planner uses <strong>A2A</strong> to message <strong>Travel Agent</strong>:</li></ol><pre><strong>@TravelAgent</strong> Could you fetch flight options from Bangalore to Goa?</pre><p>3. The Travel Agent uses <strong>MCP</strong> to access Skyscanner’s API.</p><p>4. Planner uses <strong>A2A</strong> to ask <strong>Calendar Agent</strong>:</p><pre><strong>@CalendarAgent</strong> Please find available dates in June.</pre><p><strong>5. Calendar Agent</strong> retrieves availability through <strong>MCP</strong>-registered Google Calendar tool.</p><p><strong>6. Planner Agent</strong> aggregates flights &amp; dates, confirms itinerary to user.</p><p>🎉 This cohesive, multi-agent workflow <strong>requires no custom glue code</strong> — just two open protocols.</p><h3>🌍 Real-World Implications</h3><ul><li><strong>Enhanced Productivity</strong><br> AI agents can now handle complex tasks by collaborating, reducing human intervention.</li><li><strong>Seamless Integration</strong><br> Businesses can integrate AI into their workflows without overhauling existing systems.</li><li><strong>Innovation Acceleration</strong><br> Standardized open protocols lower the barrier to entry, fostering innovation across industries.</li></ul><h3>🧠 Final Thoughts</h3><p>The advent of MCP and A2A marks a significant leap in AI evolution. By breaking down silos and fostering collaboration, these protocols are not just enhancing AI capabilities — they’re redefining how AI integrates into our daily lives.</p><p>Stay tuned for more insights into the ever-evolving world of AI.<br> And remember — <em>even AI agents need a little help to get along. Thankfully, MCP and A2A are here to play matchmaker.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e37aafdf3c83" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>