<?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 Grace Tang on Medium]]></title>
        <description><![CDATA[Stories by Grace Tang on Medium]]></description>
        <link>https://medium.com/@gracetang?source=rss-3e237a330d29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I5vkTAoV6VrX52MTHDaSPQ.jpeg</url>
            <title>Stories by Grace Tang on Medium</title>
            <link>https://medium.com/@gracetang?source=rss-3e237a330d29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:47:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gracetang/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[AI Architecture: Skills and Subagents]]></title>
            <link>https://medium.com/@gracetang/ai-architecture-skills-and-subagents-7537a388c1af?source=rss-3e237a330d29------2</link>
            <guid isPermaLink="false">https://medium.com/p/7537a388c1af</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Grace Tang]]></dc:creator>
            <pubDate>Tue, 26 May 2026 04:07:25 GMT</pubDate>
            <atom:updated>2026-05-26T05:02:27.986Z</atom:updated>
            <content:encoded><![CDATA[<h4>Moving from mega-prompts to modular AI agents</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIrzIzJAGXwzgeAGbD5hnQ.png" /></figure><p>Increasingly, we are moving away from long, monolithic prompts and toward modular, event-driven AI architectures. Today I’ll talk about two concepts needed to get the most out of multi-agent systems: Skills and Subagents.</p><p>Let’s break down how they work, how they differ, and how to build them.</p><h3>Skills vs Subagents</h3><ul><li>A <strong>skill</strong> is a reusable set of knowledge and/or instructions. The AI dynamically references a skill only when a specific task requires it.</li><li>A <strong>subagent</strong> is an entirely separate AI worker instance with its own isolated workspace and memory. If a task requires long contexts and heavy lifting, like scanning long sets of logs, scraping web docs, or running a large number of tests, the main AI can spawn a subagent to do the dirty work in a separate context. Once the subagent finishes, it hands over a clean summary, keeping your main context lean.</li></ul><h3>1. Building a Skill</h3><p>Skills live in Markdown files. The AI reads the names and descriptions of each skill and figures out when to load and use them. This way, you don’t need to add all your knowledge and instructions into your prompt or global context file.</p><p>Let’s pretend we’re building a customer service chatbot. We want to teach it our store’s return and refund rules. You can ask the AI to create a skill and tell it what your refund policy is. It should create a folder named .agent/skills/ in your project root and drop a folder in there with the skill name, e.g. return-policy, and inside that folder there will be a file called SKILL.md.</p><p>The skill’s name and description will be included in a small configuration block (aka the front matter) of the markdown file. This is what the AI will use to decide when it should use the skill.</p><pre>---<br>name: return-policy<br>description: This skill should be used for deciding how to handle returns and refunds.<br>---<br>## Execution Rules<br>1. Check the purchase date. If the item was bought more than 30 days ago, do not offer a cash refund; authorize store credit only.<br>2. For Electronics, check if the packaging is marked as &quot;Opened&quot;. If yes, apply a mandatory 15% restocking fee to the final refund calculation.<br>3. If a customer is returning an item without a receipt, look up the lowest historical sale price of that item over the past 90 days.<br>4. Output the result in a strict data block format: Base Item Price, Deductions (Fees), Final Approved Refund, and Payout Method (Cash/Store Credit). No conversational filler.</pre><h3>How it triggers</h3><p>Because the platform looks out for context clues, when you type: <em>“A customer brought back an opened tablet they bought 12 days ago. What can we give them?”</em> the AI connects the dots and opens the return policy skill blueprint behind the scenes, reads your constraints, and calculates the exact refund amount according to the rules you provided.</p><h3>2. Building a Subagent</h3><p>Subagents are similarly defined using YAML front matter right at the top of a text file, followed by instructions on what their job is.</p><p>Imagine your store’s website crashed during a major sale. You suddenly have an inbox filled with 200 angry emails about broken coupon codes, duplicate charges, and incorrect shipping addresses. You don’t want the main AI to paste 200 pages of raw customer rants directly into your main chat screen.</p><p>Instead, you deploy a dedicated Customer Service Subagent. Again, you can ask the AI to create a subagent that processes customer feedback emails. In addition to the name and description, you can also define which tools, skills, and model you want the subagent to use. For example, we can add the return-policyskill we just defined above, and we can direct the subagent to use a cheaper, faster model (Flash).</p><pre>---<br>name: ComplaintHandler<br>description: Use this subagent proactively whenever there is a large backlog of raw customer feedback emails, order disputes, or return requests to process.<br>tools: [Read, Search]<br>skills: [return-policy]<br>enable_write_tools: false<br>enable_mcp_tools: false<br>model: gemini-3.5-flash<br>---<br>You are a sandboxed Customer Service Representative subagent. Your sole objective is to comb through raw customer emails, categorize them by issue, and draft polite, professional resolutions.<br>Rules:<br>1. You operate in a parallel queue. Process each email one by one in your background session.<br>2. You must strictly enforce the instructions found in the &quot;return-policy&quot; skill whenever handling a customer request to return merchandise or receive cash back.<br>3. Bring your work back to the main manager as a clean, categorized summary table along with a batch file of the drafted replies for approval.<br></pre><h3>How it triggers</h3><p>Again, the main Manager AI knows when to delegate based on the name and description in the subagent’s front matter. If you say: <em>“We just got hit with a mountain of customer service emails from the website crash. Go through the inbox folder and get these sorted,”</em> the main AI reads the description for ComplaintHandler, realizes it’s the right worker for the job, and boots it up.</p><h3>Connecting the Dots</h3><p>Skills and Subagents interact under the hood when a complex task hits the system.</p><p>When you tell your main AI to process that folder of 200 customer service emails, the Complaint Handler Subagent starts working in the background. It reads Email #1 (a shipping complaint) and handles it. It reads Email #2 (a billing error) and logs it.</p><p>Then it hits Email #3: <em>“I want to return a designer sweater I bought 45 days ago without a receipt.”</em></p><p>The subagent recognizes a return request and dynamically triggers the return-policy skill that was added to its workspace configuration.</p><p>Via skills and subagents, you can write a playbook once, hand it to a team of background workers, and let them execute your rules reliably at scale while your main conversation stays clutter-free.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7537a388c1af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slowing the AI token burn: Part 2]]></title>
            <link>https://medium.com/@gracetang/slowing-the-ai-token-burn-part-2-afea90ee4a56?source=rss-3e237a330d29------2</link>
            <guid isPermaLink="false">https://medium.com/p/afea90ee4a56</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[gemini]]></category>
            <dc:creator><![CDATA[Grace Tang]]></dc:creator>
            <pubDate>Sun, 17 May 2026 01:30:27 GMT</pubDate>
            <atom:updated>2026-05-17T04:23:14.154Z</atom:updated>
            <content:encoded><![CDATA[<h4>5 more ways to work efficiently with AI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiYPwa-xVcQM4i_BfqFeKg.jpeg" /></figure><p>When I shared <a href="https://medium.com/@gracetang/slowing-the-ai-token-burn-35eb88627e0a">Slowing the AI token burn</a> (part 1) last week, my <a href="https://www.linkedin.com/posts/tsmgrace_most-ai-advice-tells-you-how-to-prompt-better-share-7459479617431691264-whLu?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAAATv6xgBQa5kq94Jp5ySkHFJoJKE-JQP25s">network shared many other great tips and feedback</a>. <em>Thank you </em><a href="https://www.linkedin.com/in/iamwilhelm/"><em>Wil Chung</em></a><em>, </em><a href="https://www.linkedin.com/in/amitray/"><em>Amit Ray</em></a><em>, </em><a href="https://www.linkedin.com/in/mjyzc/"><em>Maximilian Jackson</em></a><em>, Abhik Lahiri, </em><a href="https://www.linkedin.com/in/shashank-bhat/"><em>Shashank Bhat</em></a><em>, </em><a href="https://www.linkedin.com/in/daylonsoh/"><em>Daylon Soh</em></a><em>, </em><a href="https://www.linkedin.com/in/konmarzec/"><em>Konrad Marzec</em></a><em>, and </em><a href="https://www.linkedin.com/in/0303chelsea/"><em>Chelsea Baker</em></a><em>!</em></p><p>Furthermore, I learned that managing context bloat isn’t just about token burn, but also helps model accuracy, because conversation recall degrades as they get longer.</p><p>We sometimes treat context windows like infinite digital filing cabinets, but they’re really more like a cluttered desk: the more unnecessary docs we leave lying around, the harder it is to find what you need and focus on the immediate task.</p><p>Here are five more ways to clear the workspace.</p><h3>Keep global context files like CLAUDE.md lean</h3><p>If you are using developer tools like Claude Code, it’s easy to let global context files like CLAUDE.md, GEMINI.md, or AGENT.md balloon as we add more rules. But because the entire content of these files gets prepended to your prompt, this creates compounding token tax. Think of it as forcing your model to read a 10-page manual before answering a yes-or-no question.</p><p>To mitigate this, keep context files to the minimal set of guidelines that are needed universally, like core stack choices or guardrails. If a rule only applies to a specific workflow, put these in skills files instead.</p><p><em>Credit: Wil Chung</em></p><h3>Modularize with skills</h3><p>A skill is a discrete, task-specific file containing specialized instructions. Your agent only pulls in the relevant skill file when that specific action is triggered. Give your skill a concise name and description, so that your agent knows when it should invoke the skill.</p><p><strong>Example:</strong> Instead of keeping complex SQL formatting guidelines permanently active in your chat, save them as a separate “querying” skill. The agent will only load those formatting rules when it actively detects that you are asking for a database query.</p><p><em>Credit: Abhik Lahiri</em></p><h3>Delegate to subagents</h3><p>To keep your main context window clean, you can delegate certain tasks to specialized <a href="https://code.claude.com/docs/en/sub-agents.md">subagents</a> that have their own separate context window.</p><p>Use them especially when the task would otherwise flood your chat with long logs, search results, or verbose info that you won’t use again. The subagent will parse those in its own separate context, then return only the finished result, so that it doesn’t pollute your main context window with unnecessary clutter.</p><p>Using this architecture preserves your premium model’s primary context window, isolates conversational noise, and scales down your compute costs.</p><h3>Automate with scripts instead of chat</h3><p>If you need to process multiple files or perform repetitive tasks, consider if the task (or parts of it) can be completed using a script instead of an agent. Instead of asking the agent to execute a task over and over in the chat, ask the agent to write a script to execute the batch process, and then run the script directly on your machine for free.</p><p><strong>Example:</strong> Instead of asking the agent to “go through these 50 files and delete all extra whitespace,” ask it to “Write a Python script to delete all whitespace across all 50 files in my data folder.” You get the task done in a single prompt and run the processing locally for zero token cost.</p><p><em>Credit: Wil Chung, Amit Ray</em></p><h3>Keep the number of active documents to a minimum</h3><p>Because most AI models process their entire active context window with every new message, large files (like entire PDFs or large code repositories) consume tokens on every request, even if you only ask a simple question.</p><p>Once a task is complete, explicitly detach or delete the file from the active session. If the model doesn’t need to see it to write the next line of code, it shouldn’t be in the window.</p><p><em>Credit: Shashank Bhat</em></p><p>Optimizing your prompt architecture isn’t just about lowering your bill. When you force a model to navigate through thousands of lines of irrelevant information, its reasoning capabilities degrade. By enforcing a strict, modular context architecture, you aren’t just saving tokens, you are clearing a path for cleaner, more accurate outputs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afea90ee4a56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slowing the AI token burn]]></title>
            <link>https://medium.com/@gracetang/slowing-the-ai-token-burn-35eb88627e0a?source=rss-3e237a330d29------2</link>
            <guid isPermaLink="false">https://medium.com/p/35eb88627e0a</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-gemini]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Grace Tang]]></dc:creator>
            <pubDate>Sun, 10 May 2026 20:01:42 GMT</pubDate>
            <atom:updated>2026-05-17T01:31:32.516Z</atom:updated>
            <content:encoded><![CDATA[<h4>5 ways to stop hitting rate limits so quickly</h4><p>Have you been in a perfect flow state while vibe coding, only to hit a rate limit mid-task? Do you go through tokens like water? I know the feeling, so I researched a few ways to work more efficiently with AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f0-0fE1t8ZYGeZJD8Nj8Sw.jpeg" /></figure><h3><strong>Avoid long conversations</strong></h3><p>Here’s something I didn’t realize at first: each turn in a conversation re-sends your entire history.</p><p>That means token spend grows non-linearly with each exchange.</p><p>Tokens sent per turn:<br>Turn 1: ████ (400)<br>Turn 2: ████████ (800)<br>Turn 3: ████████████ (1,200)<br>…<br>Turn 10: ████████████████████████████████████████ (4,000)</p><p>Each █ = 100 tokens<br>Tokens spent in a 10 turn conversation = 400+800+1200+…+4000 = <strong>22000</strong></p><p>This means that it helps to start a new conversation as often as possible. If a conversation has grown too long, you can prompt for a summary e.g. “Summarize this conversation”, or “Summarize all my requirements so far”, then paste the result into a new chat.</p><p>That said, chat history is often cached for short periods of time e.g. Claude and Gemini both offer prompt caching that can reduce costs by up to 90% for repeated context.</p><h3>Front load your initial prompt</h3><p>One way to avoid multi-turn conversations is to include as much detail in your initial prompt as possible. For complex tasks, I find it helpful to plan my prompt in a separate document, as if I was writing a Product Requirements Document for an engineer. This forces me to think through and list all my requirements instead of correcting them on the fly.</p><h3>Be as concise as possible</h3><p>AI sometimes sounds almost human, so it’s natural for us to add filler words from natural conversations like “please”, or “I was wondering if you might be able to…” However, every word is a token, and cutting them from prompts helps conserve resources. Using point form or shorthand helps as well.</p><p>For example, instead of saying: “<em>I need you to analyze this customer feedback data. There are three things I’m looking for. First, what are the most common complaints? Second, what features do people ask for most often? Third, how does sentiment vary by region? Please structure your response as a table.”</em> (46 tokens)</p><p>You can just say: <em>“Analyze customer feedback. Output in a table: 1) Most common complaints, 2) most requested features, 3) sentiment by region” </em>(19 tokens)</p><h3>Match the model to the task</h3><p>For the longest time, I ignored the drop-downs that allowed me to select which model I wanted to use. However, this of course makes a huge difference, since cheaper models typically have higher rate limits.</p><p>Small models like Flash are faster and cheaper, good for simple questions and one-turn tasks, but weaker at multi-step reasoning and deep analysis, and more likely to <a href="https://tech.yahoo.com/ai/gemini/articles/gemini-3-flash-doesn-t-214500774.html?guccounter=1">hallucinate instead of saying “I don’t know”</a>.</p><p>Use large thinking/reasoning models only when you need them, for example, I use Gemini Pro for complex coding projects that take many iterations to get right. (Anecdotally, Flash tends to forget what you told it a few steps ago and repeat mistakes you already fixed).</p><h3>Route simpler tasks to free platforms</h3><p>In a rate-limited world, routing simple tasks to free platforms is an easy way to reserve your best tools for harder problems.</p><p>For factual questions, simple math problems, or even to summarize text, use Google Search’s AI mode.</p><p>If you just want to have a casual chat where memory and hallucinations aren’t a problem (e.g. not coding or deep research), <a href="http://deepseek.com/">Deepseek.com</a> and Quora’s <a href="http://poe.com/">Poe.com</a> have free use with generous caps.</p><p>That is, they have generous caps <em>for now</em>. Many platforms are <a href="https://techinnovatehub.medium.com/ai-companies-are-losing-billions-their-simple-plan-to-recover-pricier-subscriptions-becc9d9410df">operating at a loss</a> and will have to make a profit some day. So, best to be prepared and build these token-saving habits today.</p><p>Want 5 more ways to use AI more efficiently? See <a href="https://medium.com/p/afea90ee4a56">Part 2 of this post here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35eb88627e0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>