<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AI and Coding Learnings | Shunyang Wang</title><link>https://shunyang.xyz/series/ai-and-coding-learnings/</link><atom:link href="https://shunyang.xyz/series/ai-and-coding-learnings/index.xml" rel="self" type="application/rss+xml"/><description>AI and Coding Learnings</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Mon, 25 May 2026 00:00:00 +0000</lastBuildDate><image><url>https://shunyang.xyz/media/icon_hua2ec155b4296a9c9791d015323e16eb5_11927_512x512_fill_lanczos_center_3.png</url><title>AI and Coding Learnings</title><link>https://shunyang.xyz/series/ai-and-coding-learnings/</link></image><item><title>A Chemist's Notes on Agentic Coding using Claude</title><link>https://shunyang.xyz/posts/llm_learning_notes/</link><pubDate>Mon, 25 May 2026 00:00:00 +0000</pubDate><guid>https://shunyang.xyz/posts/llm_learning_notes/</guid><description>&lt;blockquote>
&lt;p>&lt;em>Six weeks of token usage, in numbers.&lt;/em>
&lt;em>I&amp;rsquo;m a slow adopter. This is what catching up looks like.&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h2 id="where-i-started">Where I started&lt;/h2>
&lt;p>I&amp;rsquo;m a computational chemist at a pharma. I write code, but I&amp;rsquo;m slow to pick up new tools. This time I want that to change.&lt;/p>
&lt;p>The timeline:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>GPT era (late 2022 – mid 2023):&lt;/strong> I thought it was an ads event. Overpresented, underdelivering.&lt;/li>
&lt;li>&lt;strong>Mid 2023:&lt;/strong> Tried coding with it. Copy-paste from chat to IDE, paste back, ran it. Treated it like a slightly faster Stack Overflow.&lt;/li>
&lt;li>&lt;strong>Mid 2024 – early 2025:&lt;/strong> Started using LLMs for information search instead of Google. The switch was about a year behind when I should have made it.&lt;/li>
&lt;li>&lt;strong>Through 2025:&lt;/strong> Started reviewing what it wrote, line by line. Caught some things, missed others. Trust grew slowly.&lt;/li>
&lt;li>&lt;strong>Spring 2026 (now):&lt;/strong> Letting an agent take over most of the code-writing for a dozen active projects. Reviewing diffs, not lines. Weekly load grew about 12× in five weeks.&lt;/li>
&lt;/ul>
&lt;p>This essay is what a slow adopter looks like when the thing finally clicks.&lt;/p>
&lt;hr>
&lt;h2 id="why-i-care-about-token-usage">Why I care about token usage&lt;/h2>
&lt;p>It is obviously wrong to optimize for maximum tokens, but as a beginner I realized token use is a decent proxy for how familiar I am with the tool.&lt;/p>
&lt;p>More tokens per task usually means fewer back-and-forth turns, more self-evaluation, and more iteration. It pushed me to think about better harnessing and how to interact with the agent like a code reviewer.&lt;/p>
&lt;p>Through this journey, I learned how to set up tools, skills, and memories.&lt;/p>
&lt;hr>
&lt;h2 id="what-the-numbers-say">What the numbers say&lt;/h2>
&lt;p>Weekly volume, normalized to week 1 (laptop + cluster combined):&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img src="./weekly_load.png" alt="Weekly load (fold change vs W1), with the unlock that drove each week" loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;p>The eye goes to the spike on the right — week 5 was about &lt;strong>12× week 1&lt;/strong>. But the more interesting number is hidden in weeks 3 and 4: load stayed level &lt;em>while requests dropped&lt;/em> (3,167 → 1,719). I wasn&amp;rsquo;t running more turns. I was running heavier ones.&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img src="./tokens_per_request.png" alt="Tokens per request — content per call kept rising" loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;p>86K → 216K is a &lt;strong>2.5× fold change&lt;/strong> in payload per call. Output tokens per call grew 1.5× over the same window (512 → 778). Much denser sessions.&lt;/p>
&lt;p>What&amp;rsquo;s more, I slowly moved all work from my laptop to the cluster — long-running sessions under tmux or Zellij, with a sandbox where the agent could run autonomously without me re-approving every command.&lt;/p>
&lt;hr>
&lt;h2 id="six-weeks-six-unlocks">Six weeks, six unlocks&lt;/h2>
&lt;p>&lt;strong>W1&lt;/strong> — 186M tokens · 2,164 requests&lt;/p>
&lt;p>First cluster sessions. First three skill templates landed: experiment runs, cluster submission, PR descriptions. Earliest memory rules: file scope (don&amp;rsquo;t touch other users&amp;rsquo; code), review-figures-before-commit. The unlock was vocabulary — naming the rules the agent would follow.&lt;/p>
&lt;p>&lt;strong>W2&lt;/strong> — 544M tokens · 3,551 requests&lt;/p>
&lt;p>First two project repos shipped. No new infrastructure — pure use of W1 scaffolding. 3× the token volume of W1; the unlock was just committing to real projects.&lt;/p>
&lt;p>&lt;strong>W3&lt;/strong> — 382M tokens · 3,167 requests&lt;/p>
&lt;p>&amp;ldquo;No login-node abuse&amp;rdquo; memory written after a long BFS scan slowed the host. Slurm cluster reference memory added.&lt;/p>
&lt;p>&lt;strong>W4&lt;/strong> — 362M tokens · 1,719 requests&lt;/p>
&lt;p>Heavy iteration on existing projects. Set up repos and READMEs so projects could reference each other.&lt;/p>
&lt;p>&lt;strong>W5&lt;/strong> — 1,762M tokens · 8,168 requests&lt;/p>
&lt;p>Six new project repos shipped first commits in five days. First skill promotions — a job-resume skill and a figure-review skill, both graduated from feedback memories that kept firing. First three hooks landed: a Stop-event lint, a Stop-event commit-recommend, and a PreToolUse pre-commit hook that blocks &lt;code>git commit&lt;/code> when the staged diff touches numerical logic until the math is articulated in the message body. Multiagent workloads also drove the usage spike. The unlock was compounding — projects, skills, and hooks all landed the same week because the spine made each one cheap.&lt;/p>
&lt;p>&lt;strong>W6&lt;/strong> — 1,094M tokens · 5,063 requests&lt;/p>
&lt;p>Tightening week. Two new PreToolUse hooks finally landed: a Slurm-submission validator and a login-node-abuse blocker (promoted from the W3 memory to a skill). Four new diagnostic skills — status dashboards across projects, cluster shortcuts. Eleven new memory rules, most of them workflow tightenings after I ran the built-in &lt;code>/insights&lt;/code> command.&lt;/p>
&lt;p>Each week added something the next week built on. None of it was strategic — each piece came from a specific friction in the prior week that I got tired of.&lt;/p>
&lt;hr>
&lt;h2 id="what-changed">What changed&lt;/h2>
&lt;p>In the order I learned them. Not all stuck the first time.&lt;/p>
&lt;h3 id="1-build-infrastructure-before-features">1. Build infrastructure before features&lt;/h3>
&lt;p>Weeks 1–2 were 80% project work. By week 5 it was the inverse — and that&amp;rsquo;s when output went up. Hooks, memories, skills, scaffolding compound. New projects start at week-5 productivity.&lt;/p>
&lt;h3 id="2-solve-permissions-once">2. Solve permissions once&lt;/h3>
&lt;p>Every &amp;ldquo;do you want to run this?&amp;rdquo; is friction. The project&amp;rsquo;s permissions config ended up with &lt;strong>91 shell allowlist entries&lt;/strong> and &lt;strong>17 file-access entries&lt;/strong>. Plus a deny list covering 8 sibling user directories so I can&amp;rsquo;t edit colleagues&amp;rsquo; code by accident. Most operations now run without a prompt. Sandbox or running in a container is a better option, but both are limited by available resources.&lt;/p>
&lt;h3 id="3-solve-the-boring-plumbing">3. Solve the boring plumbing&lt;/h3>
&lt;p>Set up the cluster submission path so a sandboxed compute environment could submit jobs without a shared filesystem. Remote VS Code pointed at GPU nodes. Job logs streamed back to my laptop without manual &lt;code>rsync&lt;/code>. Each one removes ~5 minutes of friction × dozens of times per day.&lt;/p>
&lt;h3 id="4-ask-the-agent-to-ask-me-questions">4. Ask the agent to ask me questions&lt;/h3>
&lt;blockquote>
&lt;p>&lt;em>&amp;ldquo;Ask me three clarifying questions before you start.&amp;rdquo;&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;p>Highest-impact line I added to my prompts. Half the time the questions made me realize I didn&amp;rsquo;t know what I wanted.&lt;/p>
&lt;h3 id="5-plan-before-execute">5. Plan before execute&lt;/h3>
&lt;p>Plan mode. Reviewable artifact before any code is written. Saves the revert-and-retry cycle.&lt;/p>
&lt;h3 id="6-write-memories-with-reasoning-not-just-rules">6. Write memories with reasoning, not just rules&lt;/h3>
&lt;p>Every memory file has a &lt;code>Why:&lt;/code> line and a &lt;code>How to apply:&lt;/code> line. The agent learns the rule&amp;rsquo;s &lt;em>boundary&lt;/em>, not just the rule. Memories that say &amp;ldquo;do X&amp;rdquo; without saying why decay; memories that say &amp;ldquo;do X &lt;em>because&lt;/em> Y last quarter&amp;rdquo; survive.&lt;/p>
&lt;h3 id="7-promote-memories-to-skills-when-they-keep-firing">7. Promote memories to skills when they keep firing&lt;/h3>
&lt;p>A &amp;ldquo;resume the partial job, don&amp;rsquo;t re-run from scratch&amp;rdquo; memory became a &lt;code>/resume-job&lt;/code> invocable skill after the same procedure ran three times. Memory layer compounds &lt;em>through promotion&lt;/em> — not just by accumulation.&lt;/p>
&lt;h3 id="8-let-projects-talk">8. Let projects talk&lt;/h3>
&lt;p>One project consumes utility tools written in another. A third will feed its outputs back as priors into the first. The portfolio isn&amp;rsquo;t 12 independent projects — it&amp;rsquo;s a graph. Each project&amp;rsquo;s outputs become another&amp;rsquo;s inputs.&lt;/p>
&lt;h3 id="9-multiagent-for-parallel-branches">9. Multiagent for parallel branches&lt;/h3>
&lt;p>Background subagents for independent tasks (search this repo / draft this analysis / find this dataset). Subagent context shields the main session from large outputs. Three branches in flight without context contamination.&lt;/p>
&lt;hr>
&lt;h2 id="unexpected-side-effects">Unexpected side effects&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Negative results published in the repo.&lt;/strong> A full fine-tune on a published embedding model lost to a simpler baseline. Logged as &lt;code>Exp X.YZ NEGATIVE&lt;/code>, linked from the project&amp;rsquo;s manuscript. Failed runs that get &lt;em>committed&lt;/em> become next quarter&amp;rsquo;s prior, not buried compute.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Pre-commit quality gates.&lt;/strong> A hook that blocks &lt;code>git commit&lt;/code> when staged changes touch numerical logic, until I articulate the math in the commit body. Came after I caught the agent producing markdown with &lt;em>estimated&lt;/em> numbers that the actual data later contradicted by 50–100% per day. Wrong numbers don&amp;rsquo;t fail tests; they just ship. Now they fail commits instead.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Tracking my own learning.&lt;/strong> This essay exists. Tracking it makes the meta-improvements visible — like load-per-call rising while request count fell. Only see it if you look.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="infrastructure-inventory">Infrastructure inventory&lt;/h2>
&lt;p>&lt;em>As of May 2026:&lt;/em>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>25 memory files&lt;/strong> — autonomous-mode rules, cluster-resource defaults, scoring-API references&lt;/li>
&lt;li>&lt;strong>6 skills&lt;/strong> — domain-specific reasoning, cluster-submit, experiment-run, figure-review, resume-job, PR-description&lt;/li>
&lt;li>&lt;strong>3 hooks&lt;/strong> — numerical-review gate, cluster-job-ID capture, ruff lint&lt;/li>
&lt;li>&lt;strong>119 permission entries&lt;/strong> — 91 shell allowlist, 17 file-access, 11 deny rules (maybe there are smarter ways?)&lt;/li>
&lt;li>&lt;strong>36 documented patterns&lt;/strong> — from &amp;ldquo;Agent vs Pipeline&amp;rdquo; (#1) to &amp;ldquo;Memory→skill promotion&amp;rdquo; (#36)&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img src="./active_projects.png" alt="Active project count over the 6 weeks" loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;p>The portfolio plateaued at 12 once the infrastructure stopped being the bottleneck. Growth now is depth-per-project — one of the agents going Phase 1 → 6b in three days is what depth growth looks like when the spine is in place.&lt;/p>
&lt;hr>
&lt;h2 id="analogies-from-chemistry">Analogies from chemistry&lt;/h2>
&lt;p>&lt;strong>Reaction rate isn&amp;rsquo;t throughput.&lt;/strong> More turns per hour doesn&amp;rsquo;t help if half are clarifying questions. Spec quality is the rate-limiting step. So I ask the agent to ask me questions instead of letting it guess.&lt;/p>
&lt;p>&lt;strong>Catalysts beat reagents.&lt;/strong> A small piece of well-placed infrastructure accelerates everything downstream. A hook that blocks numerical commits costs nothing and prevents an entire failure mode.&lt;/p>
&lt;hr>
&lt;h2 id="for-a-chemist-starting-today">For a chemist starting today&lt;/h2>
&lt;ol>
&lt;li>One project. One &lt;code>CLAUDE.md&lt;/code>. One &lt;code>AGENTS.md&lt;/code>. Don&amp;rsquo;t scaffold for 12 on day one.&lt;/li>
&lt;li>Wait until you&amp;rsquo;ve corrected the agent on the same thing three times before writing the first memory. Earlier than that and the rules don&amp;rsquo;t generalize.&lt;/li>
&lt;li>Solve permissions early. Twenty allowlist entries on week one removes hundreds of prompts on week three.&lt;/li>
&lt;li>Tell the agent to ask you clarifying questions when you&amp;rsquo;re vague.&lt;/li>
&lt;li>Plan before execute.&lt;/li>
&lt;li>Track your weekly load. Mine grew 12× in five weeks; without a routine pull on usage telemetry I wouldn&amp;rsquo;t have noticed.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="whats-next">What&amp;rsquo;s next&lt;/h2>
&lt;p>Now I can easily use up my weekly quota, so I need to think about token efficiency.&lt;/p>
&lt;p>The thing that gets faster isn&amp;rsquo;t the adoption itself. It&amp;rsquo;s the time between &lt;em>seeing other people do it&lt;/em> and &lt;em>deciding to actually try it&lt;/em>.&lt;/p></description></item></channel></rss>