<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zernonia</title>
    <description>The latest articles on DEV Community by Zernonia (@zernonia).</description>
    <link>https://dev.to/zernonia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F400444%2F8626e93e-1c07-44f2-8eab-1f0bbd87bfed.jpeg</url>
      <title>DEV Community: Zernonia</title>
      <link>https://dev.to/zernonia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zernonia"/>
    <language>en</language>
    <item>
      <title>Which app made that beep? Tracing system sounds on macOS</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Fri, 04 Dec 2026 01:35:41 +0000</pubDate>
      <link>https://dev.to/zernonia/which-app-made-that-beep-tracing-system-sounds-on-macos-3987</link>
      <guid>https://dev.to/zernonia/which-app-made-that-beep-tracing-system-sounds-on-macos-3987</guid>
      <description>&lt;p&gt;"Which app made that last beep?" came in as a feature request for Stat Space, and I assumed it would take an afternoon. The Volume tab already knew which apps were playing audio, so I'd just keep a short list of who started playing and when.&lt;/p&gt;

&lt;p&gt;Then I triggered a beep and Core Audio told me, with complete confidence, that it came from &lt;code&gt;systemsoundserverd&lt;/code&gt;. It always does. This post is the investigation that followed, what actually works, and what I left out.&lt;/p&gt;

&lt;h2&gt;
  
  
  The obvious approach, and why it's wrong
&lt;/h2&gt;

&lt;p&gt;Core Audio exposes every audio client as a process object (&lt;code&gt;kAudioHardwarePropertyProcessObjectList&lt;/code&gt;), each with a PID, a bundle id and whether it's outputting right now. No permission needed. Watch those for output starting and you have a "who played a sound" log.&lt;/p&gt;

&lt;p&gt;I wrote a small spike, &lt;code&gt;spike-sounds&lt;/code&gt;, that registers listeners on the process list and on each process object, then logs PID, bundle id, executable path and the frontmost app whenever output starts or stops. Then I triggered every kind of sound I could think of from another shell. On macOS 26.6.2 on Apple Silicon, this is what Core Audio reported:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What made the sound&lt;/th&gt;
&lt;th&gt;Core Audio says it was&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NSBeep()&lt;/code&gt;, &lt;code&gt;NSSound.beep()&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemsoundserverd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;AudioServicesPlayAlertSound&lt;/code&gt;, &lt;code&gt;AudioServicesPlaySystemSound&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemsoundserverd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;osascript -e beep&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemsoundserverd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A notification with a sound (&lt;code&gt;display notification … sound name "Glass"&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemsoundserverd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;afplay&lt;/code&gt;, &lt;code&gt;NSSound(named:).play()&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The app itself&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Anything that plays its own audio is attributed correctly. But the sounds people actually ask about, the alert beep and the notification ping, all go through macOS's system sound server, and Core Audio sees only the server. For notifications it's worse than it looks: even systemsoundserverd's client is NotificationCenter, not the app that posted the notification.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdnjiyuu229ynryuqrmo2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdnjiyuu229ynryuqrmo2.jpg" alt="Diagram showing Xcode's NSBeep and Slack's notification sound both routed through systemsoundserverd, so Core Audio attributes both to systemsoundserverd, while systemsoundserverd's and NotificationCenter's log lines name the real app" width="799" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Core Audio only sees the process rendering the sound; the logs name who asked for it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There was also noise. &lt;code&gt;corespeechd&lt;/code&gt; (bundle id &lt;code&gt;com.apple.CoreSpeech&lt;/code&gt;) started output alongside every single sound on the device: beeps, &lt;code&gt;afplay&lt;/code&gt;, notifications. Left alone, it would appear next to every entry as "Siri", so it's ignored.&lt;/p&gt;

&lt;h2&gt;
  
  
  A listener that never fires
&lt;/h2&gt;

&lt;p&gt;The spike turned up a second problem, one that was already a bug in the shipped app. The natural property to watch on a process object is &lt;code&gt;kAudioProcessPropertyIsRunningOutput&lt;/code&gt;. On macOS 26, listeners on it (and on &lt;code&gt;kAudioProcessPropertyIsRunningInput&lt;/code&gt;) never fire. Only &lt;code&gt;kAudioProcessPropertyIsRunning&lt;/code&gt; notifies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// IsRunningOutput / IsRunningInput don't notify; IsRunning does.&lt;/span&gt;
&lt;span class="nc"&gt;AudioObjectAddPropertyListenerBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;isRunningAddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;UInt32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyIsRunningOutput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="c1"&gt;// output started if `out != 0` and it was 0 before&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Volume tab had been listening to the output property only, so its Playing state silently didn't update until the process list itself changed. That got fixed in the same change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking for the real requester
&lt;/h2&gt;

&lt;p&gt;So where does the real caller live? I considered correlating with the frontmost app, and the spike logged it for exactly that reason. It wasn't needed, and it would be wrong anyway: the whole point is catching the background app that pinged while you were typing somewhere else.&lt;/p&gt;

&lt;p&gt;The answer was in the unified log. &lt;code&gt;systemsoundserverd&lt;/code&gt; logs every request it accepts, at Default level, readable without root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; Incoming Request : actionID N, inClientPID &amp;lt;pid&amp;gt;(&amp;lt;name&amp;gt;), …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the caller's PID and process name. For notification sounds the client is NotificationCenter, but NotificationCenter logs its own line (subsystem &lt;code&gt;com.apple.unc&lt;/code&gt;, category &lt;code&gt;sound&lt;/code&gt;) naming the app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Playing notification sound { nam: Glass } for &amp;lt;bundle id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details make this usable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timing.&lt;/strong&gt; Both lines arrive in &lt;code&gt;log stream&lt;/code&gt; about 5 to 10 ms before Core Audio reports systemsoundserverd's output starting. Close enough to pair them reliably.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistence.&lt;/strong&gt; They don't come back from &lt;code&gt;log show&lt;/code&gt;. These messages aren't persisted, so you can't look up "who beeped two minutes ago" after the fact. It has to be a live stream, running before the sound plays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One more quirk: the process name in the request line is truncated by the kernel to 16 characters, so NotificationCenter shows up as &lt;code&gt;NotificationCent&lt;/code&gt;. The code checks for that prefix.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a live log stream costs
&lt;/h2&gt;

&lt;p&gt;Stat Space has a strict idle budget (under 0.3% CPU and 25 MB at 1-second sampling, popover closed), so "keep a &lt;code&gt;log&lt;/code&gt; process running" needed numbers before it went anywhere near the app.&lt;/p&gt;

&lt;p&gt;The trick is that &lt;code&gt;log stream --predicate&lt;/code&gt; filters inside &lt;code&gt;logd&lt;/code&gt;, not in the child process. The child does nothing until a matching message shows up. Measured over 30 seconds, the filtered child used 0.01 s of CPU, essentially zero, and 3 to 5 MB of memory in its own process. The predicate is narrow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(process == "systemsoundserverd" AND eventMessage CONTAINS "Incoming Request") OR
(process == "NotificationCenter" AND category == "sound"
  AND eventMessage BEGINSWITH "Playing notification sound")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it runs as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/usr/bin/log stream --style ndjson --timeout 10m --predicate &lt;span class="s1"&gt;'&amp;lt;the predicate above&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxrwq1pb5vkzxffxix7j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxrwq1pb5vkzxffxix7j.jpg" alt="Terminal running a filtered log stream in NDJSON as a normal user, printing systemsoundserverd Incoming Request lines for Xcode and NotificationCent and a NotificationCenter line for a Slack Glass notification, with 0.01 s CPU over 30 s and 3 to 5 MB memory" width="799" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The filtered stream stays silent until a system sound plays, because logd does the filtering.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;NDJSON gives one JSON object per line, so parsing is a matter of reading &lt;code&gt;eventMessage&lt;/code&gt; and pulling out the PID or bundle id. The &lt;code&gt;--timeout 10m&lt;/code&gt; is a safety net: the app restarts the stream when it times out, so if Stat Space ever crashes, the orphaned &lt;code&gt;log&lt;/code&gt; process ends on its own within ten minutes instead of living forever. If &lt;code&gt;log&lt;/code&gt; can't start, or exits quickly three times in a row, the feature degrades instead of failing: those sounds are listed as "System sound" with no app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting the two sources together
&lt;/h2&gt;

&lt;p&gt;The final design uses two event sources and matches them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Core Audio listeners&lt;/strong&gt;: the process list, plus &lt;code&gt;kAudioProcessPropertyIsRunning&lt;/code&gt; on each process object. No polling. An app that plays its own audio is recorded directly as itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The log stream&lt;/strong&gt;: when systemsoundserverd starts output, the matching request line supplies the real app. For a notification, NotificationCenter's line supplies the app and the sound name.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Events are matched if they land within 1.5 seconds of each other, in either order. The log usually wins the race by a few milliseconds, but it isn't guaranteed. If Core Audio fires first, a placeholder "System sound" row goes in and is filled in when the hint arrives. If no hint arrives at all, the placeholder stays. Requests that Stat Space made itself are recognized by PID and dropped.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnbbspt1dp60q4bsw2sjy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnbbspt1dp60q4bsw2sjy.jpg" alt="Timeline showing the systemsoundserverd log line for Xcode arriving at 0 ms, the Core Audio listener reporting systemsoundserverd output about 7 ms later, and the two matched into a Recent sounds entry for Xcode via system sound" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The log hint usually arrives 5 to 10 ms before Core Audio reports output, and the two are paired within 1.5 seconds.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The result goes into a fixed 10-slot ring buffer, newest first, with rows like "Slack · notification · Glass" or "Xcode · via system sound". Repeated starts from the same app within 2 seconds (several helper processes, a stutter) collapse into one entry, and helpers are grouped into their parent app the same way the volume mixer groups them.&lt;/p&gt;

&lt;p&gt;As for when it runs: only while the Volume tab is open, or with the popover closed if you turn on the section's "Remember" chip, which is off by default. No root, no private framework, no polling.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I left out
&lt;/h2&gt;

&lt;p&gt;Two cases aren't covered, and I decided that was fine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Apps that already have input running.&lt;/strong&gt; A call app with the microphone open that starts playing output doesn't flip &lt;code&gt;IsRunning&lt;/code&gt;, because the process was already running. No listener fires, so its sounds aren't listed. The app's own call audio is the main thing you'd miss, and you already know where that's coming from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other users' sessions.&lt;/strong&gt; Sounds from a different macOS user logged in at the same time aren't seen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And one thing I explicitly chose not to build: frontmost-app guessing as a fallback. A wrong answer delivered confidently is worse than "System sound".&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell someone trying this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Core Audio's process objects tell you who is &lt;em&gt;rendering&lt;/em&gt; audio, not who &lt;em&gt;asked&lt;/em&gt; for it. For anything routed through a system daemon, those are different processes.&lt;/li&gt;
&lt;li&gt;When an Apple daemon does work on someone's behalf, check its Default-level log lines. They often name the client, and you don't need root to read them.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;log show&lt;/code&gt; and &lt;code&gt;log stream&lt;/code&gt; don't see the same things. If a message isn't persisted, only a live stream will catch it.&lt;/li&gt;
&lt;li&gt;A filtered &lt;code&gt;log stream&lt;/code&gt; is far cheaper than it sounds, because the filtering happens in &lt;code&gt;logd&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Spike first. The &lt;code&gt;IsRunningOutput&lt;/code&gt; bug only surfaced because the spike logged every listener callback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recent sounds now sits at the bottom of the &lt;a href="https://statspace.app/features/volume-mixer" rel="noopener noreferrer"&gt;Volume tab&lt;/a&gt; in Stat Space, next to the per-app volume sliders (which have their own &lt;a href="https://statspace.app/guides/per-app-volume-mac" rel="noopener noreferrer"&gt;how-to&lt;/a&gt;). Stat Space is a lean menu bar system monitor for Apple Silicon, free with a one-time Pro upgrade, at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/which-app-made-that-beep-macos" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>swift</category>
      <category>coreaudio</category>
      <category>debugging</category>
    </item>
    <item>
      <title>How I keep a Mac system monitor under 0.3% CPU</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Thu, 03 Dec 2026 01:30:24 +0000</pubDate>
      <link>https://dev.to/zernonia/how-i-keep-a-mac-system-monitor-under-03-cpu-3n3l</link>
      <guid>https://dev.to/zernonia/how-i-keep-a-mac-system-monitor-under-03-cpu-3n3l</guid>
      <description>&lt;p&gt;The first rule I wrote down for Stat Space wasn't a feature. It was a number: &lt;strong&gt;under 0.3% of one core and under 25 MB at idle&lt;/strong&gt;, on an M1, sampling every second with the popover closed. A system monitor that shows up in its own top-apps list has failed at the one thing it's for.&lt;/p&gt;

&lt;p&gt;This post is how that budget is actually met: what runs, what doesn't, and the measurement that keeps me honest. None of it is exotic. Most of it is saying no to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the budget, not the features
&lt;/h2&gt;

&lt;p&gt;The budget lives in the project's agent handover file and the spec, above any feature list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under 0.3% CPU and under 25 MB at idle (M1, 1 s sampling, popover closed).&lt;/li&gt;
&lt;li&gt;Under 2% CPU with the popover open on Home.&lt;/li&gt;
&lt;li&gt;No allocations in the sampling hot path. Every series is a fixed-size ring buffer.&lt;/li&gt;
&lt;li&gt;A status item redraws only when its displayed value changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One detail I got wrong at first: "25 MB" of what? Raw RSS counts shared AppKit and SwiftUI framework pages, which is around 70 MB for &lt;em&gt;any&lt;/em&gt; AppKit app before you write a line of code. That number measures macOS, not me. So the gate is &lt;code&gt;phys_footprint&lt;/code&gt;, the value Activity Monitor shows in its Memory column. I logged that under "Decided" in the spec so I wouldn't relitigate it later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing samples unless something needs it
&lt;/h2&gt;

&lt;p&gt;The single biggest win is not sampling. Every data source is a pull-based &lt;code&gt;Sampler&lt;/code&gt; with one method, &lt;code&gt;sample(at:into:history:)&lt;/code&gt;, and a &lt;code&gt;Scheduler&lt;/code&gt; decides when to call it. The scheduler doesn't have a list of "things to monitor". It has a &lt;code&gt;Demand&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;Demand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Sendable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Equatable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;baseInterval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;     &lt;span class="c1"&gt;// user setting: 1, 2 or 5 s&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;popoverOpen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;menuBar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SamplerSet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;     &lt;span class="c1"&gt;// feeding a menu bar item&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;visible&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SamplerSet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;     &lt;span class="c1"&gt;// the open tab, or Home's pins&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SamplerSet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;// rules, alerts, agent watch, CLI&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app recomputes demand whenever the menu bar layout, the popover, pins, rules or alerts change. A pure function then maps each sampler plus demand to an interval, or &lt;code&gt;nil&lt;/code&gt; for off. A few rows of that policy:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sampler&lt;/th&gt;
&lt;th&gt;Popover open&lt;/th&gt;
&lt;th&gt;Menu bar shows it&lt;/th&gt;
&lt;th&gt;Only a background rule needs it&lt;/th&gt;
&lt;th&gt;Nobody needs it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CPU, memory, network, disk, GPU&lt;/td&gt;
&lt;td&gt;1 s&lt;/td&gt;
&lt;td&gt;user setting&lt;/td&gt;
&lt;td&gt;5 s or slower&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Processes&lt;/td&gt;
&lt;td&gt;2 s&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;10 s&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ports&lt;/td&gt;
&lt;td&gt;3 s&lt;/td&gt;
&lt;td&gt;15 s&lt;/td&gt;
&lt;td&gt;15 s&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sensors, power&lt;/td&gt;
&lt;td&gt;2 s&lt;/td&gt;
&lt;td&gt;5 s&lt;/td&gt;
&lt;td&gt;10 s&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wi-Fi&lt;/td&gt;
&lt;td&gt;2 s&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;never&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So if you only show CPU and memory in the menu bar, the process walk, the port scan, the sensor reads and per-app network don't run at all. Closing a tab suspends its samplers, and they get a chance to drop caches and handles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftddgow4ozms7twghf383.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftddgow4ozms7twghf383.jpg" alt="Diagram of Stat Space's scheduler: a Demand struct with only CPU and memory in the menu bar feeds one DispatchSourceTimer with 10% leeway, which runs CPU and memory every second while network, processes, ports and sensors stay off" width="799" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;With only CPU and memory in the menu bar, every other sampler is off.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There's also a "lite" mode for the cases where something runs in the background. Agent watch and orphan sweep only care about your own command-line processes, so with the popover closed the process sampler reads usage just for those and skips app grouping, with an occasional full pass so CPU deltas have a fresh baseline when you open the popover.&lt;/p&gt;

&lt;h2&gt;
  
  
  One timer, with leeway
&lt;/h2&gt;

&lt;p&gt;All of those samplers hang off a single &lt;code&gt;DispatchSourceTimer&lt;/code&gt;. It ticks at the shortest active interval, and on each tick runs whichever samplers are due. When demand drops to nothing, the timer is cancelled entirely.&lt;/p&gt;

&lt;p&gt;The part that matters for idle cost is the leeway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Generous leeway (10%, at least 100 ms) lets macOS coalesce our wakeups.&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;leeway&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DispatchTimeInterval&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;milliseconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iv&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;repeating&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;leeway&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;leeway&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A menu bar number doesn't need to update at exactly 1.000 s. Telling the kernel it can slide the wakeup lets it batch ours with everyone else's, which is the cheapest CPU time there is. The tick also tolerates firing a little early (a 150 ms slack) so a coalesced wakeup still counts.&lt;/p&gt;

&lt;p&gt;Long-term history follows the same idea. A separate recorder samples once a minute on the same queue, so 30 days of history costs one wakeup a minute and never changes what the live samplers do.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Snapshot, overwritten in place
&lt;/h2&gt;

&lt;p&gt;There is exactly one live &lt;code&gt;Snapshot&lt;/code&gt; struct, owned by a &lt;code&gt;Store&lt;/code&gt; and confined to the sampling queue. Samplers write into it in place. Arrays inside it (processes, ports, apps) are refilled with &lt;code&gt;removeAll(keepingCapacity: true)&lt;/code&gt;, so a steady-state tick reuses the same storage instead of reallocating.&lt;/p&gt;

&lt;p&gt;History is a set of fixed-size ring buffers, 300 points each:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="nd"&gt;@inline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__always&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;mutating&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;
    &lt;span class="n"&gt;head&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;head&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;head&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Storage is a &lt;code&gt;ContiguousArray&amp;lt;Float&amp;gt;&lt;/code&gt; allocated once at init. &lt;code&gt;append&lt;/code&gt; never grows it. Reads for sparklines walk it with a closure (&lt;code&gt;forEachRecent&lt;/code&gt;) rather than building an array; the one method that copies into a new array is labeled "UI use only".&lt;/p&gt;

&lt;p&gt;The crossing to the main thread matters too. With the popover closed, the menu bar gets a &lt;code&gt;Pulse&lt;/code&gt;: a struct of scalars. Per-core CPU goes into a &lt;code&gt;SIMD32&amp;lt;Float&amp;gt;&lt;/code&gt; instead of an array, because a fixed-size vector doesn't allocate and an &lt;code&gt;[Float]&lt;/code&gt; does. The full snapshot and history are only handed to the main thread while the popover is open.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F878xvivcgp524i8pqamv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F878xvivcgp524i8pqamv.jpg" alt="Diagram of a 300-point ring buffer with a head pointer that wraps, next to the Store's single Snapshot handing a scalar Pulse to the main thread when the popover is closed and the full Snapshot when it is open" width="799" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;History lives in fixed-size ring buffers, and only scalars cross to the main thread while the popover is closed.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The menu bar is Core Graphics, the popover is temporary
&lt;/h2&gt;

&lt;p&gt;The menu bar items are plain &lt;code&gt;NSStatusItem&lt;/code&gt;s with images drawn by Core Graphics. No SwiftUI, no &lt;code&gt;MenuBarExtra&lt;/code&gt;. Each item's renderer builds a small value describing what it would draw, compares it with the last one, and returns nothing if they match:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;renderIfChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;MenuBarRender&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;currentRender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;lastRender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;lastRender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a plain number item shows 4% for ten seconds, that's ten comparisons and zero redraws.&lt;/p&gt;

&lt;p&gt;SwiftUI lives only inside the popover, and only while it's open. The panel, the hosting view and the popover's model are created on open, and closing releases all three, so the popover-closed path holds no SwiftUI state at all. Opening is a little more work each time. I'll take that over a view hierarchy sitting in memory all day for a window you look at a few times an hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Port scanning without a port-scanning bill
&lt;/h2&gt;

&lt;p&gt;The Ports tab lists every listening TCP socket with the process and project behind it, without root. The API is libproc: &lt;code&gt;proc_pidinfo(PROC_PIDLISTFDS)&lt;/code&gt; to get a process's file descriptors, then &lt;code&gt;proc_pidfdinfo(PROC_PIDFDSOCKETINFO)&lt;/code&gt; on each socket fd to see whether it's a TCP listener.&lt;/p&gt;

&lt;p&gt;Doing that for every fd of every process every few seconds adds up. Two rules make it cheap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cache by fd count.&lt;/strong&gt; &lt;code&gt;PROC_PIDLISTFDS&lt;/code&gt; is one syscall per pid and always runs. The per-fd socket calls run only for pids that are new or whose fd count changed since the last scan. Otherwise the cached sockets are reused. A full rescan every 60 s catches the rare case of a socket swapped for another at an unchanged count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remember EPERM.&lt;/strong&gt; Other users' processes (root daemons, mostly) refuse &lt;code&gt;PROC_PIDLISTFDS&lt;/code&gt; with &lt;code&gt;EPERM&lt;/code&gt;. The scanner marks those pids as denied and skips them until they exit, instead of asking again every scan.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pid reuse is handled by keying the cache on start time as well as pid. The fd buffer is one raw allocation that grows only if a process has more fds than it holds, and stays grown. When you do want root-owned listeners, 1.4.0 added an opt-in "System ports" view that asks for your password once and runs a read-only &lt;code&gt;lsof&lt;/code&gt;, as a snapshot that never refreshes on its own, so the idle budget doesn't move. More on the feature at &lt;a href="https://statspace.app/features/ports" rel="noopener noreferrer"&gt;https://statspace.app/features/ports&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Apple Silicon bug that makes CPU numbers 41x wrong
&lt;/h2&gt;

&lt;p&gt;This one is worth a section because almost everyone hits it. &lt;code&gt;proc_pid_rusage&lt;/code&gt; gives you &lt;code&gt;ri_user_time&lt;/code&gt; and &lt;code&gt;ri_system_time&lt;/code&gt;. On Intel those are nanoseconds. On Apple Silicon they are mach absolute-time ticks, which run at 24 MHz. &lt;code&gt;mach_timebase_info&lt;/code&gt; reports 125/3 on M1, so if you treat ticks as nanoseconds your CPU percentages come out about 41.7 times too small.&lt;/p&gt;

&lt;p&gt;It's a nasty bug because the numbers look plausible. A busy process shows 2% instead of 80%, and nothing crashes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fadthm6wrtsu5krxgkkie.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fadthm6wrtsu5krxgkkie.jpg" alt="Worked example of the Apple Silicon mach_timebase_info bug: 19,200,000 ticks read as nanoseconds gives 1.9% CPU, while multiplying by 125/3 gives 800,000,000 ns, or 80% CPU" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The same rusage delta, read as nanoseconds and correctly converted from 24 MHz ticks.&lt;/em&gt; Every path in Stat Space that reads CPU time goes through one helper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;ticksToNanos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;ticks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;UInt64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;UInt64&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;tb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;timebase&lt;/span&gt;                       &lt;span class="c1"&gt;// mach_timebase_info, read once&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numer&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;tb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;denom&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ticks&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;wide&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ticks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;multipliedFullWidth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;UInt64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;UInt64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;denom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dividingFullWidth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wide&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quotient&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 128-bit intermediate is there so long-running totals can't overflow. The same conversion applies to &lt;code&gt;pti_total_user&lt;/code&gt; / &lt;code&gt;pti_total_system&lt;/code&gt; from &lt;code&gt;proc_pidinfo(PROC_PIDTASKINFO)&lt;/code&gt;, the fallback when rusage isn't readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring from the outside
&lt;/h2&gt;

&lt;p&gt;Budgets that aren't measured are wishes. There are two measurements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The self-cost probe.&lt;/strong&gt; Stat Space samples its own &lt;code&gt;proc_pid_rusage&lt;/code&gt; and shows its CPU and memory in the popover footer, always. It runs at 1 s while the popover is open and every 5 s otherwise. If it ever costs too much, the user sees it before I do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The idle-cost benchmark.&lt;/strong&gt; A script launches the bundled app with default menu bar items and the popover closed and waits out a warm-up. Then a separate tool, &lt;code&gt;pulse-bench&lt;/code&gt;, reads the app's rusage every second for 60 s from &lt;em&gt;another process&lt;/em&gt;. It prints mean, p95 and max for CPU, RSS and &lt;code&gt;phys_footprint&lt;/code&gt;, and exits non-zero when mean CPU or max memory is over budget. Because it measures from outside, it catches costs the app can't see in itself, like work done by its own run loop or framework threads.&lt;/p&gt;

&lt;p&gt;Inside the app, the scheduler also keeps a cheap cost breakdown: two clock reads around each sampler run, reported as each sampler's share of one core. When the benchmark fails, that table usually says which sampler did it.&lt;/p&gt;

&lt;p&gt;I'll be honest about the CI part. GitHub's macOS runners are virtualized and noisy: the same commit has measured 0.26% and 0.81% on them. So the CI job gates at a looser 0.6% to catch large regressions, also captures a 10 s call-tree profile of the idle app, and the real 0.3% / 25 MB gate is run on M1 hardware before a release. macOS minutes are expensive too, so that job runs on demand before tagging rather than on every push. A benchmark that flaps gets ignored, and an ignored benchmark is worse than none.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell someone building one
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Write the budget first and make it a failing test, not a goal.&lt;/li&gt;
&lt;li&gt;Make "off" the default state of every sampler. Derive what runs from what's visible.&lt;/li&gt;
&lt;li&gt;One timer, generous leeway. Let the kernel batch you.&lt;/li&gt;
&lt;li&gt;Allocate at init, reuse forever. Fixed-size buffers, &lt;code&gt;keepingCapacity&lt;/code&gt;, scalars across threads.&lt;/li&gt;
&lt;li&gt;Cache the expensive per-process facts and only resolve new pids.&lt;/li&gt;
&lt;li&gt;Convert mach ticks on Apple Silicon. Then check it again.&lt;/li&gt;
&lt;li&gt;Gate memory on &lt;code&gt;phys_footprint&lt;/code&gt;, not RSS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to see where this ended up, the lightweight monitor roundup at &lt;a href="https://statspace.app/best/lightweight-system-monitor-mac" rel="noopener noreferrer"&gt;https://statspace.app/best/lightweight-system-monitor-mac&lt;/a&gt; compares it with the alternatives.&lt;/p&gt;

&lt;p&gt;Stat Space is the menu bar monitor I built around these rules: free, with a one-time Pro upgrade, for Apple Silicon. It shows its own cost in the footer so you can check every number in this post yourself. It's at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;https://statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/system-monitor-under-0-3-percent-cpu" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>swift</category>
      <category>applesilicon</category>
      <category>performance</category>
    </item>
    <item>
      <title>How to identify malware in Activity Monitor on a Mac</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Wed, 02 Dec 2026 01:28:25 +0000</pubDate>
      <link>https://dev.to/zernonia/how-to-identify-malware-in-activity-monitor-on-a-mac-35j4</link>
      <guid>https://dev.to/zernonia/how-to-identify-malware-in-activity-monitor-on-a-mac-35j4</guid>
      <description>&lt;p&gt;You can't identify malware in Activity Monitor by its name. Most cryptic names there (&lt;code&gt;rapportd&lt;/code&gt;, &lt;code&gt;trustd&lt;/code&gt;, &lt;code&gt;mds_stores&lt;/code&gt;, &lt;code&gt;corespeechd&lt;/code&gt;) are macOS daemons, and real malware often picks a dull, plausible name on purpose. What gives it away is everything around the name: where the executable lives, who signed it, what keeps restarting it, how much CPU it uses when you're not doing anything, and where it connects.&lt;/p&gt;

&lt;p&gt;All of that can be checked in a few minutes with Activity Monitor and four Terminal commands: the process's path from &lt;strong&gt;Open Files and Ports&lt;/strong&gt;, its signature with &lt;code&gt;codesign&lt;/code&gt; and &lt;code&gt;spctl&lt;/code&gt;, the launch agents in three folders, and its network connections with &lt;code&gt;lsof&lt;/code&gt;. If the binary is signed by Apple or a known developer, lives where its app lives, and was installed by something you recognise, it's almost certainly fine.&lt;/p&gt;

&lt;p&gt;I build Stat Space, a system monitor, so I read a lot of process lists. Below is the order I check things in, with real output from my Mac so you know what normal looks like.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most odd names are macOS
&lt;/h2&gt;

&lt;p&gt;Activity Monitor shows a few hundred processes on an idle Mac, and most of them are Apple's. A few that regularly get mistaken for something worse:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Process&lt;/th&gt;
&lt;th&gt;What it actually is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;launchd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PID 1, the parent of everything. See &lt;a href="https://statspace.app/processes/launchd" rel="noopener noreferrer"&gt;launchd&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;syspolicyd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gatekeeper, checking apps before they run. See &lt;a href="https://statspace.app/processes/syspolicyd" rel="noopener noreferrer"&gt;syspolicyd&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;trustd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Certificate and code-signature checks. See &lt;a href="https://statspace.app/processes/trustd" rel="noopener noreferrer"&gt;trustd&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rapportd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Handoff and device-to-device communication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mds_stores&lt;/code&gt;, &lt;code&gt;mdworker&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Spotlight indexing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;corespeechd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Siri and dictation listening&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If a name you don't recognise shows up, look it up first. The &lt;a href="https://statspace.app/processes" rel="noopener noreferrer"&gt;Mac processes directory&lt;/a&gt; covers the common ones, with what each does and whether it's safe to quit. Searching the exact name plus "mac" settles most of the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signals that actually matter
&lt;/h2&gt;

&lt;p&gt;None of these alone proves anything, but two or three together deserve a proper look:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Steady high CPU while the Mac is idle&lt;/strong&gt;, from a process you didn't start. Cryptominers are the most common Mac malware that shows up this way: one unfamiliar process sitting at 100% or more, every time you look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A random-looking or misspelled name&lt;/strong&gt;, like a string of letters, or an Apple-ish name such as &lt;code&gt;com.apple.updater&lt;/code&gt; that isn't actually Apple's.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An odd location.&lt;/strong&gt; Executables running from &lt;code&gt;/tmp&lt;/code&gt;, &lt;code&gt;/private/var/tmp&lt;/code&gt;, &lt;code&gt;/Users/Shared&lt;/code&gt;, a hidden folder (one starting with a dot), or a randomly named folder in &lt;code&gt;~/Library/Application Support&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No real signature.&lt;/strong&gt; Unsigned or ad-hoc signed, with no Team ID, for something that claims to be an app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A launch agent you didn't install&lt;/strong&gt; that keeps it running, so it comes back after you quit it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network connections to hosts you can't explain&lt;/strong&gt;, especially from something that has no reason to be online.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: find out where it lives
&lt;/h2&gt;

&lt;p&gt;In Activity Monitor, double-click the process (or select it and click the &lt;strong&gt;ⓘ&lt;/strong&gt; button) and open the &lt;strong&gt;Open Files and Ports&lt;/strong&gt; tab. The first lines are usually the executable itself and the frameworks it loaded. Note the path.&lt;/p&gt;

&lt;p&gt;From Terminal, &lt;code&gt;ps&lt;/code&gt; gives you the full path, the parent and the owner in one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps -o pid,ppid,user,%cpu,comm -p &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;pid&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  PID  PPID USER      %CPU COMM
  799     1 you        0.0 /Applications/Raycast.app/Contents/MacOS/Raycast
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A path inside &lt;code&gt;/Applications/SomeApp.app&lt;/code&gt; or &lt;code&gt;/System&lt;/code&gt; is what you want to see. Use &lt;code&gt;ps -axo pid,%cpu,comm -r | head&lt;/code&gt; to list the top CPU users with their paths if you're hunting for the busy one. The &lt;a href="https://statspace.app/guides/high-cpu-usage-mac" rel="noopener noreferrer"&gt;high CPU guide&lt;/a&gt; covers walking the parent chain.&lt;/p&gt;

&lt;p&gt;One caution about locations: a legitimate app can also run code from &lt;code&gt;~/Library/Application Support&lt;/code&gt;. On my Mac, Google's updater runs from there on a schedule. The location is a reason to look closer, not a verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: check the signature
&lt;/h2&gt;

&lt;p&gt;Every app that ships properly on macOS is code-signed. Two commands tell you by whom and whether Gatekeeper accepts it. Point them at the &lt;code&gt;.app&lt;/code&gt; bundle if there is one, otherwise at the executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codesign -dv --verbose=2 /path/to/App.app
spctl -a -vv /path/to/App.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's an Apple app, Calculator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Identifier=com.apple.calculator
Authority=macOS Software Signing
Authority=Apple Code Signing Certification Authority
Authority=Apple Root CA
TeamIdentifier=not set

/System/Applications/Calculator.app: accepted
source=Apple System
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apple's own code shows &lt;code&gt;TeamIdentifier=not set&lt;/code&gt;; that's normal for Apple and only for Apple. A third-party app from a known developer, notarized by Apple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Identifier=com.raycast.macos
Authority=Developer ID Application: Raycast Technologies Inc (SY64MV22J9)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Notarization Ticket=stapled
TeamIdentifier=SY64MV22J9

/Applications/Raycast.app: accepted
source=Notarized Developer ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And an ad-hoc signed command-line tool, in this case &lt;code&gt;7zz&lt;/code&gt; installed by Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Identifier=7zz
CodeDirectory v=20400 ... flags=0x20002(adhoc,linker-signed)
Signature=adhoc
TeamIdentifier=not set

/opt/homebrew/Cellar/sevenzip/26.03/bin/7zz: rejected
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last one is the important nuance. &lt;strong&gt;Ad-hoc and "rejected" are normal for command-line tools.&lt;/strong&gt; Every Homebrew binary I checked is ad-hoc signed, and anything you compile yourself is too. What should worry you is an &lt;em&gt;app&lt;/em&gt;, or something pretending to be one, that's ad-hoc, unsigned (&lt;code&gt;code object is not signed at all&lt;/code&gt;) or signed by a developer name that doesn't match what it claims to be.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuulhhru6atsbyh2313vc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuulhhru6atsbyh2313vc.jpg" alt="Three rows comparing codesign and spctl results: Calculator signed by macOS Software Signing and accepted as Apple System, Raycast signed by Developer ID and accepted as Notarized Developer ID, and Homebrew's 7zz ad-hoc signed and rejected, with a note that ad-hoc is normal for CLI tools but not for apps" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What the signature tells you. The Team ID ties a binary to a specific developer account Apple knows about.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: find what keeps starting it
&lt;/h2&gt;

&lt;p&gt;If you quit something and it comes back, launchd is restarting it because a launch agent or daemon asks it to. They live in three folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each &lt;code&gt;.plist&lt;/code&gt; names what it runs. &lt;code&gt;plutil -p&lt;/code&gt; prints it readably:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;plutil -p ~/Library/LaunchAgents/com.example.agent.plist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at &lt;code&gt;ProgramArguments&lt;/code&gt; (or &lt;code&gt;Program&lt;/code&gt;) for the path, then run Step 2 on that path. On my Mac the user folder has entries from Google, Steam and Epic Games, each named after its company and pointing into that company's own folders. That's what normal looks like. A plist with a random name, or one pointing into &lt;code&gt;/tmp&lt;/code&gt; or &lt;code&gt;/Users/Shared&lt;/code&gt;, is not.&lt;/p&gt;

&lt;p&gt;Also check &lt;strong&gt;System Settings › General › Login Items &amp;amp; Extensions&lt;/strong&gt;. It lists apps that open at login and, under &lt;strong&gt;App Background Activity&lt;/strong&gt; (called &lt;strong&gt;Allow in the Background&lt;/strong&gt; before macOS 26), everything allowed to run in the background, with a toggle for each. macOS also sends a notification when a new background item is added, so if you got one you didn't expect, this is where to look. The &lt;a href="https://statspace.app/processes/launchd" rel="noopener noreferrer"&gt;launchd page&lt;/a&gt; explains how to unload a job safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: see who it talks to
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;lsof&lt;/code&gt; lists a process's network connections with their remote addresses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof -a -i -P -n -p &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;pid&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COMMAND  PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google  1073 you  21u IPv6 0x…  0t0 TCP [2001:…]:63647-&amp;gt;[2404:6800:4001:c01::53]:443 (ESTABLISHED)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-a&lt;/code&gt; makes &lt;code&gt;lsof&lt;/code&gt; combine the conditions (network &lt;em&gt;and&lt;/em&gt; this PID). You'll often see &lt;code&gt;lsof -i -P -n | grep &amp;lt;pid&amp;gt;&lt;/code&gt; suggested, which works but also matches the PID's digits in ports and addresses. And check the right process: Chrome's main process had no sockets at all on my Mac, because its network helper does the talking.&lt;/p&gt;

&lt;p&gt;An IP address on its own tells you little. Look it up (&lt;code&gt;host &amp;lt;ip&amp;gt;&lt;/code&gt; or a whois site), and judge it against what the app does: a chat app talking to its own servers on port 443 is expected, a background process you can't name talking to a bare IP on an unusual port isn't. For live traffic per process, &lt;a href="https://statspace.app/guides/which-app-is-using-network-mac" rel="noopener noreferrer"&gt;this network guide&lt;/a&gt; walks through Activity Monitor's Network tab and &lt;code&gt;nettop&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What macOS already does for you
&lt;/h2&gt;

&lt;p&gt;macOS has malware protection built in, and it's worth knowing what it covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gatekeeper&lt;/strong&gt; checks apps from the internet before their first launch: is it signed, is it notarized, has Apple revoked it. That's the work &lt;a href="https://statspace.app/processes/syspolicyd" rel="noopener noreferrer"&gt;syspolicyd&lt;/a&gt; is doing when it spikes after a download.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XProtect&lt;/strong&gt; is Apple's signature-based scanner. It checks apps on first launch, scans in the background, and updates silently. &lt;code&gt;xprotect version&lt;/code&gt; in Terminal shows the installed version on macOS 15 and later (5377 on my Mac today).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notarization&lt;/strong&gt; means Apple scanned the app before it was distributed, and can revoke it later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These catch known malware well. They don't judge adware-style apps you installed yourself, or a tool you approved by right-clicking past a warning.&lt;/p&gt;

&lt;h2&gt;
  
  
  If something does look wrong
&lt;/h2&gt;

&lt;p&gt;Don't start by force-killing it. If it's backed by a launch agent it will just come back, and you lose the chance to see where it came from.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Note the PID, path, parent and launch agent from the steps above.&lt;/li&gt;
&lt;li&gt;Disconnect from the network if it's actively connecting somewhere you don't like.&lt;/li&gt;
&lt;li&gt;Get a second opinion from a reputable tool. &lt;strong&gt;Malwarebytes for Mac&lt;/strong&gt; has a free scanner. Objective-See's free, open-source tools are made for exactly this: &lt;strong&gt;KnockKnock&lt;/strong&gt; lists everything set to launch persistently, &lt;strong&gt;BlockBlock&lt;/strong&gt; alerts when something installs a new launch item, and &lt;strong&gt;LuLu&lt;/strong&gt; is an outbound firewall that asks before apps connect.&lt;/li&gt;
&lt;li&gt;Remove the app the normal way, then remove its launch agent, then restart and confirm it's gone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If what you found was a cryptominer or something that asked for your password, change passwords for the accounts you used on that Mac afterward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seeing this in Stat Space
&lt;/h2&gt;

&lt;p&gt;Stat Space doesn't scan for malware, and I'd be suspicious of a system monitor that claimed to. What it does is put the evidence above in one place. In the Apps tab, expanding a process shows its signer (Apple, Mac App Store, Developer ID name, ad-hoc or unsigned), Team ID, notarization and its open files and sockets, and a Startup items list shows what's in the three LaunchAgents and LaunchDaemons folders. With Pro, "Who's phoning home" lists the remote hosts each app is talking to. It's read-only: it shows you, and blocking is left to a firewall like LuLu.&lt;/p&gt;

&lt;p&gt;Stat Space is a lean menu bar system monitor for Apple Silicon, free with a one-time Pro upgrade, at &lt;a href="https://statspace.app/" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/identify-malware-activity-monitor-mac" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>activitymonitor</category>
      <category>security</category>
    </item>
    <item>
      <title>Docker Desktop using too much memory on Mac? What the VM is holding</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Tue, 01 Dec 2026 01:29:48 +0000</pubDate>
      <link>https://dev.to/zernonia/docker-desktop-using-too-much-memory-on-mac-what-the-vm-is-holding-34hc</link>
      <guid>https://dev.to/zernonia/docker-desktop-using-too-much-memory-on-mac-what-the-vm-is-holding-34hc</guid>
      <description>&lt;p&gt;On a Mac with Apple Silicon, Docker Desktop doesn't run containers on macOS. It runs a small Linux virtual machine, and the containers run inside that. With the default setup the VM is started through Apple's Virtualization framework, so in Activity Monitor it shows up as &lt;strong&gt;com.apple.Virtualization.VirtualMachine&lt;/strong&gt; (recent macOS versions may label it along the lines of "Virtual Machine Service for Docker"), often at 4, 6 or 8 GB.&lt;/p&gt;

&lt;p&gt;That number is how much of the VM's RAM Linux has touched, not how much your containers need. Linux uses spare memory as file cache, the cache stays after builds and test runs finish, and the VM doesn't promptly hand freed pages back to macOS. So the process grows toward the &lt;strong&gt;Memory limit&lt;/strong&gt; in &lt;strong&gt;Docker Desktop › Settings › Resources&lt;/strong&gt; and stays there.&lt;/p&gt;

&lt;p&gt;If it's hurting (memory pressure yellow or red, swap climbing), the fix is that limit plus Resource Saver. If it isn't, a large VM process on its own is not a problem. The rest of this post is how to tell which, and what each lever does.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually inside that number
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz43j0x6xc2owju1qpm25.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz43j0x6xc2owju1qpm25.jpg" alt="Diagram of the Docker VM process memory: the Mac sees one com.apple.Virtualization.VirtualMachine process; inside, container memory measured by docker stats is a small part, next to the Linux kernel and Docker engine, the guest page cache, and memory freed in the guest but not returned to macOS, all capped by the Memory limit" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;docker stats sees the containers. Activity Monitor sees the whole VM, cache included.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From the Mac's side the VM is one process, and its memory is every guest page that has been backed by real RAM. Inside, that splits into roughly four parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Container memory&lt;/strong&gt;: your Postgres, Node app and Redis. This is what &lt;code&gt;docker stats&lt;/code&gt; shows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The guest kernel and Docker's own services&lt;/strong&gt;: the Linux kernel, &lt;code&gt;dockerd&lt;/code&gt;, &lt;code&gt;containerd&lt;/code&gt;, BuildKit. A few hundred MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page cache&lt;/strong&gt;: every file the guest has read or written recently. Image layers it unpacked, &lt;code&gt;node_modules&lt;/code&gt; it scanned, database files, build output. Linux keeps all of it in RAM because RAM nobody is using is wasted. On a normal Linux box that's harmless. In a VM it means the host pays for the guest's cache.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory freed in the guest but still held on the Mac&lt;/strong&gt;. When a build finishes and its processes exit, Linux marks those pages free. Unless the VM software actively reclaims them, the Mac never finds out, so the pages stay resident in the VM process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Parts 3 and 4 are why an idle Docker can look as large as a busy one. Run a big image build once and the VM can sit near its limit for the rest of the day.&lt;/p&gt;

&lt;p&gt;Swap inside the VM is separate. Docker Desktop's &lt;strong&gt;Swap&lt;/strong&gt; setting is swap for the Linux guest, stored in the VM's disk image. It doesn't show up in &lt;code&gt;sysctl vm.swapusage&lt;/code&gt; on the Mac.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure it from both sides
&lt;/h2&gt;

&lt;p&gt;Start with the containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stats --no-stream --format &lt;span class="s2"&gt;"table {{.Name}}\t{{.MemUsage}}\t{{.CPUPerc}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;MEM USAGE / LIMIT&lt;/code&gt; is per container. The usage figure subtracts the container's inactive file cache, and the limit is the whole VM's memory unless you set a per-container limit, so don't read it as "this container may use 8 GB of my Mac".&lt;/p&gt;

&lt;p&gt;Then look at what Linux in the VM thinks. A container sees the VM's kernel, so &lt;code&gt;free&lt;/code&gt; inside any container reports the whole VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --rm alpine free -m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;buff/cache&lt;/code&gt; column is the page cache from part 3. A large number there next to a small "used" is the usual picture. Note that &lt;code&gt;free&lt;/code&gt; counts a page as free once Linux releases it, while the Mac may still be holding it, so the VM process can be larger than &lt;code&gt;used&lt;/code&gt; plus &lt;code&gt;buff/cache&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then the Mac's side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pgrep -fl Virtualization.VirtualMachine
footprint &lt;span class="nv"&gt;$(&lt;/span&gt;pgrep -f Virtualization.VirtualMachine&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;footprint&lt;/code&gt; reports the same phys_footprint value Activity Monitor uses in its Memory column. Use it, or Activity Monitor, rather than &lt;code&gt;ps&lt;/code&gt; RSS, which leaves out compressed pages. If you run more than one VM tool, &lt;code&gt;pgrep&lt;/code&gt; returns more than one PID; the &lt;a href="https://statspace.app/processes/virtualization-vm" rel="noopener noreferrer"&gt;com.apple.Virtualization.VirtualMachine page&lt;/a&gt; has a way to tell which VM belongs to which app.&lt;/p&gt;

&lt;p&gt;Finally, the question that matters: is the Mac short of memory? Check &lt;strong&gt;Memory Pressure&lt;/strong&gt; at the bottom of Activity Monitor's Memory tab, and swap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sysctl vm.swapusage
memory_pressure -Q
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Green pressure and little swap means the VM is big but not in anyone's way. The &lt;a href="https://statspace.app/guides/memory-pressure-mac" rel="noopener noreferrer"&gt;memory pressure guide&lt;/a&gt; explains the colours, and the &lt;a href="https://statspace.app/guides/high-swap-usage-mac" rel="noopener noreferrer"&gt;swap guide&lt;/a&gt; covers when swap is worth worrying about.&lt;/p&gt;

&lt;h2&gt;
  
  
  The settings that shrink it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Memory limit
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Settings › Resources&lt;/strong&gt; (under &lt;strong&gt;Advanced&lt;/strong&gt; in recent versions) has a &lt;strong&gt;Memory limit&lt;/strong&gt; slider. It's a hard ceiling for the VM: the guest is created with that much RAM, and the process can't grow past it. Recent versions default to up to half of your Mac's memory, which is generous for most projects on a 16 GB Mac.&lt;/p&gt;

&lt;p&gt;To pick a value, run your normal stack, check &lt;code&gt;docker stats&lt;/code&gt;, and leave a gigabyte or two above the total for the engine, builds and some cache. Click &lt;strong&gt;Apply &amp;amp; restart&lt;/strong&gt;; the VM restarts, so running containers stop. If containers start getting killed with exit code 137 (out of memory), you went too low.&lt;/p&gt;

&lt;p&gt;A lower limit doesn't make Linux cache less eagerly; it just gives it less room. That's the point. Cache in a 4 GB VM costs at most 4 GB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Saver
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Resource Saver&lt;/strong&gt; stops the VM when no containers have run for a while, and starts it again on the next &lt;code&gt;docker&lt;/code&gt; command. When the VM is stopped, its memory goes back to macOS, cache and all. It's on by default in recent Docker Desktop versions and lives in &lt;strong&gt;Settings › Resources&lt;/strong&gt; too, with a configurable idle timeout. Where exactly it sits, and the default timeout, have moved between versions, so search Settings for "Resource Saver" if it isn't where you expect.&lt;/p&gt;

&lt;p&gt;This is the main way Docker Desktop gives memory back. If you leave Docker running all day with nothing in it, check this is on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stopping things
&lt;/h3&gt;

&lt;p&gt;Stopping containers frees their memory inside the VM but doesn't necessarily shrink the process on the Mac, for the reasons above. To get memory back right now, stop the VM: quit Docker Desktop from its menu bar icon, or let Resource Saver do it. Don't force-quit the VM process. That's pulling the plug on every running container.&lt;/p&gt;

&lt;h3&gt;
  
  
  A note on the VM backend
&lt;/h3&gt;

&lt;p&gt;In &lt;strong&gt;Settings › General&lt;/strong&gt;, recent Docker Desktop versions let you choose the virtual machine manager: Apple Virtualization framework, Docker's own &lt;strong&gt;Docker VMM&lt;/strong&gt; (on Apple Silicon, in newer releases), or the legacy QEMU option. Everything above applies to all of them, but the process name changes. With Docker VMM the VM doesn't run inside Apple's Virtualization process, so look for it under Docker's own process names instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's not only memory: disk
&lt;/h2&gt;

&lt;p&gt;The page cache is in RAM, but the images and volumes behind it live in Docker's disk image on your Mac, which grows and doesn't shrink on its own. See what's there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker system df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;docker system prune&lt;/code&gt; removes stopped containers, unused networks, dangling images and build cache; add &lt;code&gt;-a&lt;/code&gt; to remove every image no container uses, and &lt;code&gt;--volumes&lt;/code&gt; only if you're sure no volume holds data you want. Smaller images also mean less for the guest to cache. The &lt;a href="https://statspace.app/guides/free-up-space-developers-mac" rel="noopener noreferrer"&gt;developer disk space guide&lt;/a&gt; has the rest, including where Docker's disk image lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other VM tools show up the same way
&lt;/h2&gt;

&lt;p&gt;Docker Desktop isn't the only thing that runs &lt;code&gt;com.apple.Virtualization.VirtualMachine&lt;/code&gt;. Anything built on Apple's Virtualization framework does:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Where its memory is set&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Docker Desktop&lt;/td&gt;
&lt;td&gt;Settings › Resources&lt;/td&gt;
&lt;td&gt;Resource Saver stops the idle VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OrbStack&lt;/td&gt;
&lt;td&gt;Its Settings (memory limit)&lt;/td&gt;
&lt;td&gt;Advertises returning unused memory to macOS dynamically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Colima&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;colima start --memory 4&lt;/code&gt; (GiB)&lt;/td&gt;
&lt;td&gt;Uses Apple's framework with &lt;code&gt;--vm-type vz&lt;/code&gt;; &lt;code&gt;colima stop&lt;/code&gt; frees it all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;memory:&lt;/code&gt; in the instance's &lt;code&gt;lima.yaml&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Same framework with &lt;code&gt;vmType: vz&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UTM&lt;/td&gt;
&lt;td&gt;Edit the VM › System › Memory&lt;/td&gt;
&lt;td&gt;Only in Apple Virtualization mode; QEMU mode runs as QEMU processes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;OrbStack and Colima are the common alternatives to Docker Desktop on a Mac, and the &lt;code&gt;docker&lt;/code&gt; CLI works with both. I use Colima on this Mac (its default profile here is set to 4 CPUs, 8 GiB and &lt;code&gt;vmType: vz&lt;/code&gt;), and the same rules hold: the VM is as big as its limit lets Linux make it. Which tool suits you depends on licensing, features and taste more than memory, but if the VM's footprint is your main complaint, a tool that reclaims guest memory, or a lower limit in the one you have, both help.&lt;/p&gt;

&lt;p&gt;Two VM tools running at once means two VM processes, each with its own cache. That's an easy way to lose 10 GB on a 16 GB Mac without noticing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I watch for
&lt;/h2&gt;

&lt;p&gt;The question I actually care about isn't "how big is the VM" but "is it why my Mac is slow". So I watch memory pressure and swap, not the process size. A VM at its 6 GB limit with green pressure is fine. Swap climbing every time a build runs means the limit is too high for the RAM I have, or something else needs closing.&lt;/p&gt;

&lt;p&gt;Stat Space shows both in the menu bar and keeps per-minute history of pressure and swap for 30 days, so I can see whether they climb when a Docker build runs. Its Apps tab groups the VM process and &lt;code&gt;com.docker.backend&lt;/code&gt; under Docker as one row. With Pro, the &lt;a href="https://statspace.app/features/ports" rel="noopener noreferrer"&gt;Ports tab&lt;/a&gt; also replaces &lt;code&gt;com.docker.backend&lt;/code&gt; with the container name and image behind each published port, for Docker and OrbStack. Stat Space is a lean menu bar system monitor for Apple Silicon, free with a one-time Pro upgrade, at &lt;a href="https://statspace.app/" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/docker-desktop-memory-mac" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>developers</category>
      <category>applesilicon</category>
      <category>macos</category>
    </item>
    <item>
      <title>Per-app volume on macOS without an audio driver</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Mon, 30 Nov 2026 01:18:25 +0000</pubDate>
      <link>https://dev.to/zernonia/per-app-volume-on-macos-without-an-audio-driver-fnb</link>
      <guid>https://dev.to/zernonia/per-app-volume-on-macos-without-an-audio-driver-fnb</guid>
      <description>&lt;p&gt;macOS still ships with exactly one volume slider. If Slack's notification ping is louder than the call you're on, your options are to turn everything down or go dig for a setting inside Slack.&lt;/p&gt;

&lt;p&gt;For years, fixing that meant installing a virtual audio device that all of your sound flows through. While building Stat Space, a menu bar system monitor for Apple Silicon, I wanted a volume mixer that installs nothing and costs nothing when you're not using it. Since macOS 14.2 that's possible with public API: Core Audio process taps. This post is how they work, how I used them, and the parts the docs don't mention.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who's playing, with no permission at all
&lt;/h2&gt;

&lt;p&gt;Before touching anyone's audio, you need to know which apps are using it. Core Audio exposes every client process as an audio object. &lt;code&gt;kAudioHardwarePropertyProcessObjectList&lt;/code&gt; on the system object gives you the list, and each process object has a PID, a bundle id and whether it is doing output or input IO right now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioHardwarePropertyProcessObjectList&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;pid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pid_t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyPID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;UInt32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyIsRunningOutput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;inp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;UInt32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyIsRunningInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;bundle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyBundleID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This needs no permission, which is also how a "mic in use by Zoom" banner can work without asking for the microphone. (If you only need the basics, I wrote up the &lt;a href="https://statspace.app/guides/per-app-volume-mac" rel="noopener noreferrer"&gt;ways to set per-app volume on a Mac&lt;/a&gt; separately.)&lt;/p&gt;

&lt;p&gt;The raw list isn't what a person wants to see, though. Chrome plays audio from &lt;code&gt;Google Chrome Helper.app&lt;/code&gt; nested inside &lt;code&gt;Google Chrome.app&lt;/code&gt;, Electron apps do the same, and Safari's audio comes from WebKit's GPU process, which lives outside any app bundle. So each process is grouped into its owner: the outermost &lt;code&gt;.app&lt;/code&gt; bundle on its executable path wins, and for system-path processes like WebKit's XPC services, the bundle of the responsible process. A command-line tool's responsible process is the terminal that started it, so &lt;code&gt;afplay&lt;/code&gt; run from Terminal stays &lt;code&gt;afplay&lt;/code&gt; instead of turning into "Terminal".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fooi6iim76y8wuxhtnbrf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fooi6iim76y8wuxhtnbrf.jpg" alt="Table mapping Core Audio process objects to apps: Google Chrome Helper to Google Chrome, Slack Helper (Renderer) to Slack, com.apple.WebKit.GPU to Safari via the responsible process, and afplay staying afplay" width="799" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Helpers, Electron renderers and WebKit's GPU process are grouped into the app that owns them.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Taps and aggregate devices
&lt;/h2&gt;

&lt;p&gt;A process tap is a Core Audio object that captures the output of one or more processes. You describe it with a &lt;code&gt;CATapDescription&lt;/code&gt; and create it with &lt;code&gt;AudioHardwareCreateProcessTap&lt;/code&gt;, which Apple introduced in macOS 14.2. A tap alone doesn't produce any samples you can read. Apple's sample code shows the pattern: put the tap into an aggregate device and the tap shows up as an input stream, "just like a microphone".&lt;/p&gt;

&lt;p&gt;That gives you the shape of a per-app volume control:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a tap over the app's process objects, with &lt;code&gt;muteBehavior = .mutedWhenTapped&lt;/code&gt;. While the tap is being read, the app's own output is silenced.&lt;/li&gt;
&lt;li&gt;Create a private aggregate device whose main sub-device is the real output (your speakers or headphones) and whose tap list holds the new tap.&lt;/li&gt;
&lt;li&gt;Run an IOProc on the aggregate device that reads the tapped samples, multiplies them by the gain, and writes them to the output.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CATapDescription&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stereoMixdownOfProcesses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;processObjects&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isPrivate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;muteBehavior&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mutedWhenTapped&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;tapID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AudioObjectID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;AudioHardwareCreateProcessTap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;tapID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;kAudioAggregateDeviceMainSubDeviceKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;outputUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kAudioAggregateDeviceIsPrivateKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kAudioAggregateDeviceTapAutoStartKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kAudioAggregateDeviceSubDeviceListKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;kAudioSubDeviceUIDKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;outputUID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;kAudioAggregateDeviceTapListKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;kAudioSubTapDriftCompensationKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                       &lt;span class="n"&gt;kAudioSubTapUIDKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuidString&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F344e24yc9vxt76t7aus1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F344e24yc9vxt76t7aus1.jpg" alt="Flow diagram of per-app volume with Core Audio process taps: Slack's process objects feed a muted-when-tapped process tap, which is an input stream on a private aggregate device whose main sub-device is the speakers, where an IOProc applies the gain before output" width="799" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The tap silences the app's original output, and the aggregate device's IOProc replays it at the chosen gain.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mute is just a gain of zero. Routing an app to a different output is the same tap with a different main sub-device: the app is silenced on the default output and replayed on, say, the external speakers while your call stays on headphones. Boost above 100% works too, up to 150% in Stat Space, with samples clipped at full scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  The IOProc is the hot path
&lt;/h2&gt;

&lt;p&gt;The IOProc runs on Core Audio's real-time thread, so the usual rules apply: no allocation, no locks, no Swift runtime surprises. The main actor and the IOProc share three floats in a manually allocated buffer: the target gain, the peak level since the UI last read it, and the gain currently applied. Each buffer ramps from the applied gain to the target, so dragging a slider doesn't click.&lt;/p&gt;

&lt;p&gt;A few things I only found by testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The aggregate's inputs include the sub-device's.&lt;/strong&gt; If your output is a headset, the aggregate also exposes its microphone streams, followed by the tap. Leave them enabled and tapping opens the mic, and Bluetooth headphones drop into their low-quality headset mode. Setting &lt;code&gt;kAudioDevicePropertyIOProcStreamUsage&lt;/code&gt; to enable only the last input stream (the tap) avoids both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buffer size matters for CPU.&lt;/strong&gt; Asking for a 1,024-frame buffer instead of the device's default of 512 halves the IO wakeups and measured about 20% less CPU per tap. That's around 21 ms at 48 kHz, which nobody notices for playback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mono outputs exist.&lt;/strong&gt; If the output has a single channel, write the average of left and right instead of only the left.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Permission and the purple dot
&lt;/h2&gt;

&lt;p&gt;Taps need the "System Audio Recording" permission (TCC service &lt;code&gt;kTCCServiceAudioCapture&lt;/code&gt;) and an &lt;code&gt;NSAudioCaptureUsageDescription&lt;/code&gt; string in Info.plist. Apple's docs say the system prompts the first time you start recording from an aggregate device that contains a tap. Without the permission, the tap delivers silence. With a muting tap, that means the app goes quiet, so a muting tap must never be created before access is granted.&lt;/p&gt;

&lt;p&gt;There's no public API to check that permission ahead of time. Stat Space &lt;code&gt;dlopen&lt;/code&gt;s the private TCC framework for &lt;code&gt;TCCAccessPreflight&lt;/code&gt; and &lt;code&gt;TCCAccessRequest&lt;/code&gt;. If that fails to load, it falls back to letting the first tap trigger the system prompt. One trap: calling either function without the usage string in Info.plist aborts the process.&lt;/p&gt;

&lt;p&gt;I didn't want the Volume tab to throw a scary system dialog the moment you open it. So opening the tab asks for nothing. The first time you move a slider, the tab shows a card explaining why the permission is needed, and only its Allow button raises the prompt.&lt;/p&gt;

&lt;p&gt;Then there's the purple dot. macOS shows its audio-recording indicator in the menu bar while any tap runs. It's correct, since a tap is technically recording, but it alarms people. That's another reason to run taps only when they're doing something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping the cost near zero
&lt;/h2&gt;

&lt;p&gt;Stat Space has an idle budget of under 0.3% CPU and 25 MB at 1-second sampling with the popover closed, so the mixer had to fit inside it. The rule I landed on: &lt;strong&gt;a tap exists only for an app whose volume isn't 100%, is muted or rerouted, and only while it plays.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concretely:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;What runs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tab closed, no app changed&lt;/td&gt;
&lt;td&gt;Nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tab open&lt;/td&gt;
&lt;td&gt;Core Audio listeners, a 2 Hz UI refresh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Some app changed, popover closed&lt;/td&gt;
&lt;td&gt;The same listeners, no refresh loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;That app is playing&lt;/td&gt;
&lt;td&gt;One tap + aggregate device for it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It stopped playing&lt;/td&gt;
&lt;td&gt;The tap stays 20 s, then is torn down&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvar13givlt8z949uvtd3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvar13givlt8z949uvtd3.jpg" alt="Timeline for Slack set to 40%: Core Audio listeners always on, a process tap created when Slack starts playing after a brief full-volume blip, kept through a second ping, then torn down after a 20 second grace period" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A tap lives only while a changed app plays, plus a 20-second grace period.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The 20-second grace exists because apps pause and resume constantly: videos, a notification sound every few seconds. Tearing the tap down on every gap would make each resume start at full volume. Keeping it forever would leave the IO cycle and its CPU running while the app is silent.&lt;/p&gt;

&lt;p&gt;Measured on an M1 Pro, one active tap costs about 0.3% CPU in Stat Space plus 1 to 3% in &lt;code&gt;coreaudiod&lt;/code&gt;. That's why "only while it plays" matters. Ten apps sitting at 80% that aren't making noise cost nothing beyond a few Core Audio listeners.&lt;/p&gt;

&lt;p&gt;The honest trade-off: there's no driver in the signal path, so when an app at 30% starts a sound, it plays at full volume for the roughly 50 ms before the tap takes over. The grace period hides this for apps that play in bursts, but the first sound after a long silence can blip.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remembering volumes, and setting them before an app plays
&lt;/h2&gt;

&lt;p&gt;Settings live in a small store keyed by the owner's bundle id (or &lt;code&gt;proc:&amp;lt;name&amp;gt;&lt;/code&gt; for a command-line tool). Only non-default entries are kept, so an empty store means there's no reason for anything to run in the background. At launch, remembered volumes resume only if access was already granted. Launch never prompts.&lt;/p&gt;

&lt;p&gt;Early versions only gave an app a slider while it was playing, which is useless when the thing you want to tame is the next Slack ping. Now the list shows every app with a Core Audio process object, playing or not, plus every saved setting even if the app isn't running. Idle rows are dimmed but work. Moving one only saves the setting, and the tap is still created when the app starts playing, so the cost model doesn't change. The limit: an app that has never opened audio has no process object yet, so it can't be listed until it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gotcha: listeners that never fire
&lt;/h2&gt;

&lt;p&gt;Core Audio lets you add a property listener on each process object. The obvious choice is &lt;code&gt;kAudioProcessPropertyIsRunningOutput&lt;/code&gt;, so you hear about an app starting output. I did exactly that, and for a while the Playing state in the tab only updated when the process list itself changed.&lt;/p&gt;

&lt;p&gt;It turned out that on macOS 26, listeners on &lt;code&gt;kAudioProcessPropertyIsRunningOutput&lt;/code&gt; and &lt;code&gt;kAudioProcessPropertyIsRunningInput&lt;/code&gt; never fire. Only &lt;code&gt;kAudioProcessPropertyIsRunning&lt;/code&gt; notifies. The fix is to listen to &lt;code&gt;IsRunning&lt;/code&gt; and then read &lt;code&gt;IsRunningOutput&lt;/code&gt; when it fires:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;processObjects&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// IsRunningOutput / IsRunningInput don't notify; IsRunning does.&lt;/span&gt;
    &lt;span class="n"&gt;listeners&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kAudioProcessPropertyIsRunning&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// in the callback: re-read kAudioProcessPropertyIsRunningOutput per object&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Callbacks also arrive in bursts (one app starting playback flips several helper processes), so they're coalesced with a 50 ms delay before refreshing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this compares to the driver approach
&lt;/h2&gt;

&lt;p&gt;Driver-based mixers came first because nothing else was possible. They are not wrong, they're just a different trade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Background Music&lt;/strong&gt; (free, open source) installs a virtual audio device and sets itself as your default output, so all system audio passes through it. The project still labels itself alpha, and its README notes that macOS counts its virtual input device as a microphone. In exchange, it works on macOS versions far older than 14.2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SoundSource&lt;/strong&gt; from Rogue Amoeba used ACE, their audio capture engine, for years. ACE wasn't actually a kernel extension, but on Apple Silicon Macs it still needed Reduced Security mode and the kernel-extension checkbox to load. As of late 2024 Rogue Amoeba replaced it with a new backend, ARK, installed as a plug-in with just an administrator password, no security policy changes and no restart. Current SoundSource needs macOS 14.5 or later. It does far more than volume: per-app EQ, effects and Audio Unit hosting.&lt;/p&gt;

&lt;p&gt;The tap approach wins on install and idle cost: nothing to install, nothing in the signal path for apps you haven't touched. It loses on reach (macOS 14.2+), on that first-50-ms blip, and on the purple dot, which a driver doesn't trigger. If you need per-app EQ, a dedicated audio tool is still the better choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Process taps turned a feature that used to require a system-level install into a few hundred lines of Core Audio. Most of the work wasn't the audio. It was deciding when &lt;em&gt;not&lt;/em&gt; to run a tap.&lt;/p&gt;

&lt;p&gt;The mixer is free in Stat Space, alongside the rest of the system monitor. If you'd like to see it, or the &lt;a href="https://statspace.app/features/volume-mixer" rel="noopener noreferrer"&gt;volume mixer&lt;/a&gt; page for details, it's at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;. There's also a &lt;a href="https://statspace.app/best/per-app-volume-apps-mac" rel="noopener noreferrer"&gt;comparison of per-app volume apps&lt;/a&gt; if you want the other options side by side.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/per-app-volume-macos-core-audio-process-taps" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>swift</category>
      <category>coreaudio</category>
      <category>applesilicon</category>
    </item>
    <item>
      <title>How I built a native Mac app with Claude Code: spec, spikes, budget</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Sun, 29 Nov 2026 01:17:06 +0000</pubDate>
      <link>https://dev.to/zernonia/how-i-built-a-native-mac-app-with-claude-code-spec-spikes-budget-30bh</link>
      <guid>https://dev.to/zernonia/how-i-built-a-native-mac-app-with-claude-code-spec-spikes-budget-30bh</guid>
      <description>&lt;p&gt;The build plan in my spec said six weeks for the core and about ten for full launch scope. Stat Space 1.0 shipped on day three. As I write this the repo has 143 commits, and 137 of them carry a &lt;code&gt;Co-Authored-By: Claude&lt;/code&gt; trailer.&lt;/p&gt;

&lt;p&gt;That ratio is the reason for this post. Stat Space is a native menu bar system monitor for Apple Silicon: AppKit, Core Graphics, a SwiftUI popover, private frameworks loaded at runtime, a CLI and an MCP server. It's not a CRUD app, and Claude Code wrote most of it. What made that work wasn't a clever prompt. It was a handful of boring artifacts I wrote before any code, and a few guardrails the agent couldn't talk its way around.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxhcwagj3s3eo14swq6ee.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxhcwagj3s3eo14swq6ee.jpg" alt="Five-step workflow for building Stat Space with Claude Code: spec and design docs, AGENTS.md handover, four spikes with pass or fail output, the app shell, and the pulse-bench benchmark gate that exits 1 over 0.3% CPU or 25 MB" width="799" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The order that made it work: docs, handover, spikes, app, and a benchmark that fails the build.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Write the spec before the code
&lt;/h2&gt;

&lt;p&gt;Before there was a single Swift file, the repo had three documents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docs/SPEC.md&lt;/code&gt;: scope, pricing tiers, architecture, data sources for every metric, a week-by-week build plan, risks, and open questions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs/DESIGN.md&lt;/code&gt;: the chosen popover design, a graphite side rail with a pinnable Home.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs/design/popover-reference.dc.html&lt;/code&gt;: an interactive HTML mock of the popover, explicitly marked "reference only; build natively".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The mock was the most useful of the three for UI work. "Make it look like the reference" is unambiguous in a way that a paragraph about spacing never is.&lt;/p&gt;

&lt;p&gt;The spec also has a running "Decided" section. Every time a scope or design question got settled, the decision went there with a date. That turned out to matter more than the plan itself, because it's how a decision made on Tuesday survives into Friday's session without me re-explaining it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The handover file
&lt;/h2&gt;

&lt;p&gt;The fourth document was &lt;code&gt;AGENTS.md&lt;/code&gt;, and &lt;code&gt;CLAUDE.md&lt;/code&gt; is a one-liner that points to it. I wrote it as if I were handing the project to a contractor who would never be able to ask me a question. It says what to read and in what order, then lists the non-negotiables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Lean first. Idle budget: &amp;lt; 0.3% CPU and &amp;lt; 25 MB on M1 at 1s sampling,
  popover closed. A CI benchmark enforces it; never merge a regression.
- Samplers run only when something visible or an active rule needs them.
- No allocations in the sampling hot path; fixed-size ring buffers.
- SwiftUI only inside the popover, created on open, torn down on close.
- Private frameworks are dlopen'ed; the feature hides itself if loading fails.
- Dependencies: Sparkle and system SQLite only. Ask before adding anything else.
- Kill actions: only dev-tool processes parented to launchd, always confirm.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also has naming rules ("Stat Space" in UI, &lt;code&gt;StatSpace&lt;/code&gt; in identifiers, &lt;code&gt;statspace&lt;/code&gt; for the CLI), Swift 6 strict concurrency, and "samplers are pull-based, no Combine".&lt;/p&gt;

&lt;p&gt;None of these are rules a model would follow by default. Left alone, it would reach for a third-party package, a &lt;code&gt;Timer&lt;/code&gt; per metric, or SwiftUI in the menu bar, because those are the common patterns. Written down once, they get read every session, and I stopped repeating myself. When scope changed, the instruction was to update the spec in the same change, so the handover never drifted from reality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spikes before the app shell
&lt;/h2&gt;

&lt;p&gt;The last section of &lt;code&gt;AGENTS.md&lt;/code&gt; is "Start here (week 1 spikes)": build these as small standalone targets before the app, and report results. Each one tested an assumption that, if wrong, would change the product:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spike&lt;/th&gt;
&lt;th&gt;Risk it tested&lt;/th&gt;
&lt;th&gt;How it reports&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;spike-nstat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Per-app network via the private NetworkStatistics framework, the main Pro feature&lt;/td&gt;
&lt;td&gt;Generates known traffic for about 20 s and checks how much is attributed to the right PIDs. Prints &lt;code&gt;GATE: PASS&lt;/code&gt; or &lt;code&gt;GATE: FAIL&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;spike-grouping&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Folding helpers, XPC services and Electron renderers into their parent app&lt;/td&gt;
&lt;td&gt;Prints every app group with its members, counts of ungrouped and unreadable processes, and full vs incremental resolve cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;spike-ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Listening ports traced to a project folder and launcher, without root&lt;/td&gt;
&lt;td&gt;Starts two &lt;code&gt;python3 -m http.server&lt;/code&gt; listeners from a temp project, one on loopback and one on &lt;code&gt;0.0.0.0&lt;/code&gt;, and passes only if both are found with the right project and exposure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;spike-selfcost&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whether the sampling design fits the idle budget at all&lt;/td&gt;
&lt;td&gt;Runs the real scheduler with CPU, memory and network at 1 s and measures its own CPU and memory against the budget&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two choices made these work well with an agent. First, every spike prints markdown with an explicit pass or fail line, so "did it work?" is a fact in the output, not the agent's opinion of its own code. Second, the spec had a written gate: if per-app network failed, Pro would be reshuffled around other features. That gave the spike real stakes and a clear decision for me, not the model, to make. It passed, so we built the shell on top.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiwq105jm6jjf0y1l69ca.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiwq105jm6jjf0y1l69ca.jpg" alt="Four week-1 spikes for Stat Space: spike-nstat for per-app network (GATE: PASS), spike-grouping for folding helpers into apps, spike-ports for tracing listening ports to projects without root (RESULT: PASS), and spike-selfcost for the idle budget" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Each spike tested one assumption that would have changed the product if it were wrong.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The spikes are still in the repo, and &lt;code&gt;scripts/run-spikes.sh&lt;/code&gt; reruns all four. They paid off again later. When a user asked "which app made that last beep?", I had Claude write a fifth spike, &lt;code&gt;spike-sounds&lt;/code&gt;. It found that Core Audio's &lt;code&gt;kAudioProcessPropertyIsRunningOutput&lt;/code&gt; never fires its listener on macOS 26, only &lt;code&gt;kAudioProcessPropertyIsRunning&lt;/code&gt; does, which also explained a bug where the Volume tab's playing state didn't update until the process list changed. That's a finding I'd much rather get from a 150-line probe than from a week of confused UI debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  A budget the agent can't argue with
&lt;/h2&gt;

&lt;p&gt;The idle budget is the product's main promise: a monitor that shows up in its own top-apps list has failed. So it's enforced by code, not by asking nicely.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pulse-bench&lt;/code&gt; measures another process from the outside. It samples &lt;code&gt;proc_pid_rusage&lt;/code&gt; every second, converts CPU time from Mach ticks with &lt;code&gt;mach_timebase_info&lt;/code&gt; (on Apple Silicon those fields are not nanoseconds), prints a report and exits 1 when the mean CPU or peak memory is over budget. &lt;code&gt;scripts/benchmark.sh&lt;/code&gt; launches the bundled app in a benchmark mode with no onboarding, on an isolated socket so it doesn't fight my running copy, waits 15 seconds, and measures for 60. When the app gets &lt;code&gt;SIGTERM&lt;/code&gt; it writes a per-sampler cost table, so a failure comes with "processes and observers are where the time goes", not just a number.&lt;/p&gt;

&lt;p&gt;This changed the dynamic more than anything else. When a change pushed the app over budget, the agent didn't get to explain why it was probably fine. The benchmark failed, the cost table showed which sampler was responsible, and the next change fixed it. The biggest structural change for staying under budget is now a line in the spec: with the popover closed, process sampling runs in a lite mode that reads usage only for your own command-line processes, with a full pass every 30 seconds.&lt;/p&gt;

&lt;p&gt;The budget also had to be honest. The first memory gate used raw RSS, which counts shared AppKit and SwiftUI framework pages, around 70 MB for any AppKit app. No amount of optimization would pass that, and an agent will happily burn hours on an impossible target. I changed the gate to &lt;code&gt;phys_footprint&lt;/code&gt;, the number Activity Monitor shows as Memory, and recorded it under "Decided". Changing a budget is a human call. The agent's job is to meet it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tests, and where CI runs them
&lt;/h2&gt;

&lt;p&gt;The test target has 282 test functions covering the resolvers (lineage, app grouping), process features like the orphan rules, IPC, the CLI and MCP server, alerts, history and more. The package also builds on Linux, and every push runs &lt;code&gt;swift build&lt;/code&gt; and &lt;code&gt;swift test&lt;/code&gt; in a &lt;code&gt;swift:6.1&lt;/code&gt; container on a Linux runner. Swift 6 strict concurrency catches a whole class of mistakes before tests even run.&lt;/p&gt;

&lt;p&gt;The loop since 1.0 has been short: I hit something annoying, describe it, Claude fixes it and adds a test. The test is the part I insist on, because it's what keeps the same bug from coming back three sessions later when the context is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually did
&lt;/h2&gt;

&lt;p&gt;Claude wrote most of the code. My part was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reading diffs.&lt;/strong&gt; The ones that deserve the closest read are anything that can kill a process, touch the Keychain, or change the sampling path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running it on my own Mac every day.&lt;/strong&gt; Tests check what I thought to test. Daily use finds the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deciding scope.&lt;/strong&gt; What's Free and what's Pro, what gets cut, and judgment calls like "a finished agent session's leftovers only count after 10 minutes idle". That rule is marked as an owner call in a code comment, so the next session knows not to "improve" it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeping the docs true.&lt;/strong&gt; User requests go into &lt;code&gt;docs/TODO.md&lt;/code&gt; and only move into the spec once decided.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent was also better than me at some digging. Reading Claude Code's sign-in from the Keychain for usage limits caused a macOS permission prompt. Claude worked out that Claude Code writes that item with &lt;code&gt;/usr/bin/security&lt;/code&gt;, so the item trusts that tool, and reading it the same way doesn't prompt. I wouldn't have found that quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;p&gt;Some honest lessons, in rough order of how much they cost me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Noisy CI made the budget soft.&lt;/strong&gt; GitHub's macOS runners are shared VMs. The same commit measured 0.26% and 0.81% idle CPU on different runs. CI now allows 0.6% to catch large regressions, and the real 0.3% gate runs on M1 hardware. Then macOS runner minutes, which bill at ten times Linux, pushed the full macOS job to manual dispatch. So "CI enforces the budget on every push" is no longer true. I run the benchmark before every release instead. If you build a budget into CI, plan for the noise from day one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The local and CI compilers disagreed.&lt;/strong&gt; On day one, CI's Swift 6.1 flagged strict-concurrency errors the local build didn't, and Swift 6.1 also hit a compiler crash on a method-reference binding setter that needed a workaround. Pin the toolchain early, and have CI print unique compile errors so the agent can read them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimizations interact.&lt;/strong&gt; The lite process mode that saved CPU also skipped processes inside app bundles while the popover was closed. Claude Code run by the Claude desktop app lives inside one. The Agents tab read that as the session ending and offered to clean up its MCP servers while it was still running. Nothing was killed, because every kill requires a confirmation, which is exactly why that rule was in &lt;code&gt;AGENTS.md&lt;/code&gt;. Liveness now comes from the full process table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day one was messy.&lt;/strong&gt; The early history is a run of &lt;code&gt;WIP: ... [skip ci]&lt;/code&gt; commits, each a large batch of modules landing before CI was green. It worked out, but smaller, buildable steps would have made review easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you try this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Write the spec, the design reference and a handover file before code. Put constraints in the handover, not in your head.&lt;/li&gt;
&lt;li&gt;Turn every risky assumption into a spike that prints pass or fail.&lt;/li&gt;
&lt;li&gt;Make your quality bar a program with an exit code. Agents respond to failing checks far better than to reminders.&lt;/li&gt;
&lt;li&gt;Keep a dated "Decided" log so decisions survive between sessions.&lt;/li&gt;
&lt;li&gt;You still own the judgment calls, and the diffs that can hurt someone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is Stat Space, a menu bar monitor that groups processes into apps, traces ports to projects, watches your coding agents, and ships &lt;a href="https://statspace.app/features/cli-mcp" rel="noopener noreferrer"&gt;a CLI and an MCP server&lt;/a&gt; so Claude Code can ask what's running. It's free to try at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;, with an optional one-time Pro upgrade.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/building-a-mac-app-with-claude-code" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aicoding</category>
      <category>claudecode</category>
      <category>swift</category>
      <category>macos</category>
    </item>
    <item>
      <title>Reading Apple Silicon temperatures, watts and clocks without sudo</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Sun, 29 Nov 2026 01:17:05 +0000</pubDate>
      <link>https://dev.to/zernonia/reading-apple-silicon-temperatures-watts-and-clocks-without-sudo-1658</link>
      <guid>https://dev.to/zernonia/reading-apple-silicon-temperatures-watts-and-clocks-without-sudo-1658</guid>
      <description>&lt;p&gt;Run &lt;code&gt;powermetrics&lt;/code&gt; on a Mac and the first thing it tells you is &lt;code&gt;powermetrics must be invoked as the superuser&lt;/code&gt;. For a one-off check that's fine. For a menu bar app that wants to show CPU temperature and package watts all day, asking for root is a non-starter: no one should hand a system monitor a privileged daemon just to read a thermometer.&lt;/p&gt;

&lt;p&gt;While building Stat Space I wanted temperatures, power per rail, CPU and GPU clocks, and fan speeds, all as a normal user process. It's possible. Here's what each number actually comes from, how I load the private parts safely, and the things that differ between M1 and M4 that will bite you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three sources, two of them private
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Where it comes from&lt;/th&gt;
&lt;th&gt;Private?&lt;/th&gt;
&lt;th&gt;Root?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Temperatures&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;IOHIDEventSystemClient&lt;/code&gt; (HID temperature services)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU, GPU, ANE, DRAM watts&lt;/td&gt;
&lt;td&gt;IOReport "Energy Model" group&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU cluster and GPU clocks&lt;/td&gt;
&lt;td&gt;IOReport performance-state residency + pmgr tables in the IORegistry&lt;/td&gt;
&lt;td&gt;Yes (IOReport)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fans, voltages, system power&lt;/td&gt;
&lt;td&gt;AppleSMC via IOKit&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Read: no. Write: yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU utilization&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;IOAccelerator&lt;/code&gt; "PerformanceStatistics"&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ahnb7ftcvu6qudcc9y3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ahnb7ftcvu6qudcc9y3.jpg" alt="Diagram of the three no-root sensor sources on Apple Silicon: IOHIDEventSystemClient for temperatures, IOReport for CPU, GPU, ANE and DRAM watts and clocks, and AppleSMC for fans and whole-Mac power, all feeding one Snapshot" width="799" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Three doors, no root: two private frameworks loaded with dlopen, and the public AppleSMC user client.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;None of this is new territory. Open-source tools like Stats and macmon use these routes too, and the macmon project in particular showed that IOReport gives you powermetrics-style power numbers without sudo. What I want to share is the shape of a version that's safe to ship and cheap to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule one: dlopen everything private
&lt;/h2&gt;

&lt;p&gt;Private APIs can change or disappear in any macOS update. If you link them directly and a symbol goes away, your app doesn't launch. So nothing private is linked. Each source resolves its symbols at runtime with &lt;code&gt;dlopen&lt;/code&gt; / &lt;code&gt;dlsym&lt;/code&gt;, and its initializer is failable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;init&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/usr/lib/libIOReport.dylib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;RTLD_NOW&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;sym&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dlsym&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;unsafeBitCast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kc"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;copyChannels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sym&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"IOReportCopyChannelsInGroup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;CopyChannelsFn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kc"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;createSamples&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sym&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"IOReportCreateSamples"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;CreateSamplesFn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kc"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="cm"&gt;/* … */&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;// …&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If any symbol is missing, &lt;code&gt;init&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, the sampler reports &lt;code&gt;isAvailable == false&lt;/code&gt;, the scheduler never runs it, and the snapshot's capability flags tell the UI to hide that feature. A user on some future macOS where IOReport broke would see no power readings, not a crash. Sensors that don't resolve are hidden too, never shown as 0, because a 0 °C CPU is worse than no reading.&lt;/p&gt;

&lt;p&gt;The function pointers are declared as &lt;code&gt;@convention(c)&lt;/code&gt; typealiases using raw pointers for every CF object. That keeps the signatures trivially representable, and ownership is handled explicitly with &lt;code&gt;Unmanaged&lt;/code&gt; (&lt;code&gt;takeRetainedValue&lt;/code&gt; for Copy/Create functions, &lt;code&gt;takeUnretainedValue&lt;/code&gt; for Get functions).&lt;/p&gt;

&lt;h2&gt;
  
  
  Temperatures: IOHIDEventSystemClient
&lt;/h2&gt;

&lt;p&gt;Apple Silicon exposes its thermal sensors as HID services. The symbols live in IOKit but aren't in the public headers, so they're looked up the same way. The flow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;IOHIDEventSystemClientCreate&lt;/code&gt;, then &lt;code&gt;IOHIDEventSystemClientSetMatching&lt;/code&gt; with &lt;code&gt;PrimaryUsagePage: 0xff00&lt;/code&gt; (Apple vendor) and &lt;code&gt;PrimaryUsage: 5&lt;/code&gt; (temperature sensor).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IOHIDEventSystemClientCopyServices&lt;/code&gt; once, and read each service's &lt;code&gt;Product&lt;/code&gt; property for its name.&lt;/li&gt;
&lt;li&gt;Per read: &lt;code&gt;IOHIDServiceClientCopyEvent&lt;/code&gt; with event type 15 (temperature), then &lt;code&gt;IOHIDEventGetFloatValue&lt;/code&gt; with field &lt;code&gt;15 &amp;lt;&amp;lt; 16&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;svc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CFArrayGetValueAtIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;copyEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;svc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;Unmanaged&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;AnyObject&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromOpaque&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isFinite&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sanity bound matters. You will occasionally get garbage, and throwing out anything non-finite, non-positive or over 150 °C is cheaper than explaining a 4,000 °C spike in a chart.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sensor names are the hard part
&lt;/h3&gt;

&lt;p&gt;What comes back is a list of product names like &lt;code&gt;pACC MTR Temp Sensor0&lt;/code&gt;, &lt;code&gt;eACC MTR Temp Sensor3&lt;/code&gt;, &lt;code&gt;GPU MTR Temp Sensor1&lt;/code&gt;, &lt;code&gt;PMU tdie&lt;/code&gt;, &lt;code&gt;NAND CH0 temp&lt;/code&gt;, &lt;code&gt;gas gauge battery&lt;/code&gt;. Which ones exist, and how many, depends on the chip. There's no "CPU temperature" sensor. You decide what "CPU temperature" means.&lt;/p&gt;

&lt;p&gt;Stat Space maps names with a prefix table. Each entry has a group, a display name, an optional role (cpu, gpu, ssd, battery) and a priority:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"pACC MTR Temp Sensor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"group"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"CPU"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"CPU P-core"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cpu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PMU tdie"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"group"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SoC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SoC die"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cpu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GPU MTR Temp Sensor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"group"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GPU"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GPU"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"gpu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CPU summary is the mean of the best-priority sensors present: the P-core and E-core cluster sensors if the chip has them, the PMU die sensors only as a fallback. The longest matching prefix wins. Because the table will be wrong on some chip I haven't seen, it ships embedded but can be overridden by a JSON file in Application Support, so fixing a new Mac is a data change, not a release.&lt;/p&gt;

&lt;p&gt;If you're comparing numbers between apps, this is why they disagree: different apps average different sensors. Neither is lying. There's a guide on what the readings mean at &lt;a href="https://statspace.app/guides/apple-silicon-normal-temperature" rel="noopener noreferrer"&gt;https://statspace.app/guides/apple-silicon-normal-temperature&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Power: IOReport energy deltas
&lt;/h2&gt;

&lt;p&gt;IOReport is the kernel's reporting framework, and it's where powermetrics-style numbers come from. Power isn't reported directly. Energy is. The steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;IOReportCopyChannelsInGroup("Energy Model")&lt;/code&gt; once.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IOReportCreateSubscription&lt;/code&gt; once. The subscription lives as long as the process.&lt;/li&gt;
&lt;li&gt;Every sample: &lt;code&gt;IOReportCreateSamples&lt;/code&gt;, then &lt;code&gt;IOReportCreateSamplesDelta(previous, current)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Walk the delta's channels, read each with &lt;code&gt;IOReportSimpleGetIntegerValue&lt;/code&gt;, convert to joules, divide by elapsed seconds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first call only primes the baseline and returns nothing. That also means after a suspend (nothing on screen needs power), the baseline is dropped and the next sample primes again, rather than dividing a ten-minute energy delta by a two-second interval.&lt;/p&gt;

&lt;p&gt;Channels are classified by name once, and only again if the channel count changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;*CPU Energy&lt;/code&gt; is CPU. The suffix match covers Ultra chips, which report one per die as &lt;code&gt;DIE_n_CPU Energy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GPU Energy&lt;/code&gt; is GPU. Some chips have only a channel called &lt;code&gt;GPU&lt;/code&gt;, so that's a fallback, used only when &lt;code&gt;GPU Energy&lt;/code&gt; is absent.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ANE*&lt;/code&gt; is the Neural Engine, &lt;code&gt;DRAM*&lt;/code&gt; is memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Units come from &lt;code&gt;IOReportChannelGetUnitLabel&lt;/code&gt; (mJ, µJ, nJ). When the label is missing, macOS reports mJ on M1 through M4, so that's the default. Package power is CPU + GPU + ANE + DRAM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcl10mrb24cnopuekx78r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcl10mrb24cnopuekx78r.jpg" alt="IOReport Energy Model example: a priming sample, a second sample 2 seconds later, and per-channel energy deltas for CPU, GPU, ANE and DRAM converted to watts, summing to 6.4 W package power" width="799" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Watts are energy deltas divided by elapsed time; the first sample only primes the baseline.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Whole-Mac power is a different number
&lt;/h3&gt;

&lt;p&gt;IOReport gives you the SoC's rails. The whole Mac (display, SSD, everything) is a separate SMC key, &lt;code&gt;PSTR&lt;/code&gt;. Stat Space 1.4.0 added it as its own menu bar item after a user asked for it, since the existing item showed processor power only. &lt;code&gt;PSTR&lt;/code&gt; isn't readable on every Mac, so the app probes it once at startup and hides the option where it fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clocks: residency times a frequency table
&lt;/h2&gt;

&lt;p&gt;There's no "current CPU MHz" value either. IOReport's "CPU Stats / CPU Complex Performance States" channels report how long each cluster spent in each state: IDLE, OFF, then a list of DVFS (frequency/voltage) states. The GPU has the same under "GPU Stats / GPU Performance States".&lt;/p&gt;

&lt;p&gt;The frequencies for those states live in the IORegistry, on the &lt;code&gt;pmgr&lt;/code&gt; service: &lt;code&gt;voltage-states1-sram&lt;/code&gt; for the E-cluster, &lt;code&gt;voltage-states5-sram&lt;/code&gt; for the P-cluster, &lt;code&gt;voltage-states9&lt;/code&gt; for the GPU. They're arrays of (frequency, voltage) pairs. The average active clock over an interval is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MHz = Σ (residency in state i × frequency of state i) / Σ residency in active states
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F133xuz8qp09ai3n4thqj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F133xuz8qp09ai3n4thqj.jpg" alt="Worked example of the P-cluster clock: IDLE and OFF residency dropped, active DVFS states at 600, 1260, 2064 and 3228 MHz weighted by milliseconds of residency, averaging about 3,074 MHz" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The average active clock weights each DVFS state's frequency by how long the cluster spent in it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Pitfalls I hit here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Skip the idle states.&lt;/strong&gt; Leading &lt;code&gt;IDLE&lt;/code&gt;, &lt;code&gt;OFF&lt;/code&gt; and &lt;code&gt;DOWN&lt;/code&gt; states are dropped before indexing into the frequency table, otherwise every index is off by one or two.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Units changed on M4.&lt;/strong&gt; The pmgr tables are in Hz on earlier chips and kHz on the M4 family. The code checks the magnitude of the largest entry to decide.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate views.&lt;/strong&gt; &lt;code&gt;ECPM&lt;/code&gt; / &lt;code&gt;PCPM&lt;/code&gt; channels are the clusters' power-manager views of the same thing. Count them and you double the weight. Only &lt;code&gt;ECPU*&lt;/code&gt;, &lt;code&gt;PCPU*&lt;/code&gt; and &lt;code&gt;GPUPH&lt;/code&gt; are used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Idle means no clock.&lt;/strong&gt; If a cluster was idle the whole interval there's no meaningful average, so it's &lt;code&gt;nil&lt;/code&gt;, not 0.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fans and the SMC: public, but fiddly
&lt;/h2&gt;

&lt;p&gt;The SMC isn't private in the &lt;code&gt;dlopen&lt;/code&gt; sense. It's an IOKit user client you open with &lt;code&gt;IOServiceOpen&lt;/code&gt; on &lt;code&gt;AppleSMC&lt;/code&gt;, then call with a parameter block that has to match the C &lt;code&gt;SMCKeyData_t&lt;/code&gt; exactly: 80 bytes. Swift lays out nested structs by size, not stride, so I needed explicit padding to put the &lt;code&gt;result&lt;/code&gt; field at the right offset, and an assertion that the struct is 80 bytes.&lt;/p&gt;

&lt;p&gt;Each key is four characters packed into a big-endian &lt;code&gt;UInt32&lt;/code&gt; (&lt;code&gt;F0Ac&lt;/code&gt; is fan 0 actual RPM, &lt;code&gt;F0Mn&lt;/code&gt; / &lt;code&gt;F0Mx&lt;/code&gt; its min and max). On Apple Silicon, &lt;code&gt;flt&lt;/code&gt; values are little-endian Float32, while integer and fixed-point types are big-endian. Mix those up and you get nonsense values that look like real numbers.&lt;/p&gt;

&lt;p&gt;Reading works as a normal user. Writing doesn't: forcing a fan speed needs root, and on Apple Silicon also needs a test-mode key set to take manual control from the system's thermal daemon. That's why fan control is the one root component in Stat Space, an opt-in helper installed only when you turn it on (&lt;a href="https://statspace.app/features/fan-control" rel="noopener noreferrer"&gt;https://statspace.app/features/fan-control&lt;/a&gt;). Fanless Macs simply have no fan keys, and the fan UI hides.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sampling cost: the sensor list is not free
&lt;/h2&gt;

&lt;p&gt;The surprise for me was how expensive temperatures are. Each HID temperature read is a kernel round trip of roughly a millisecond, and a chip can expose dozens of sensors. A full pass costs tens of milliseconds, every time. At 1 s sampling that alone would blow a 0.3% idle CPU budget.&lt;/p&gt;

&lt;p&gt;So sensors have a lite mode, used whenever nothing on screen shows the full sensor list (for example, only the menu bar temperature or a background alert needs it):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep only the best-priority CPU and GPU sensors, the ones that feed the summary values.&lt;/li&gt;
&lt;li&gt;Read at most four of them per tick, in rotation. The rest keep their last value, so the mean stays whole.&lt;/li&gt;
&lt;li&gt;Read the fans, skip the SMC voltage list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sensors and power also run slower than CPU: every 2 s with the popover open, 5 s for a menu bar item, 10 s if only a background feature needs them, and off otherwise. Temperatures don't change fast enough to justify more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd pass on
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;powermetrics&lt;/code&gt; needs root; IOReport, HID sensors and SMC reads don't.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dlopen&lt;/code&gt; every private symbol and make each feature disappear cleanly when loading fails.&lt;/li&gt;
&lt;li&gt;Treat sensor names as data. Ship a table, let it be updated without a release.&lt;/li&gt;
&lt;li&gt;Power is energy over time. Prime the baseline, and re-prime after any pause.&lt;/li&gt;
&lt;li&gt;Check units every chip generation. M4 changed the frequency tables.&lt;/li&gt;
&lt;li&gt;Budget the reads. A thermometer that costs a percent of CPU is heating the thing it measures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stat Space is the menu bar monitor where I put all of this together: a free, lean system monitor for Apple Silicon with a one-time Pro upgrade. If you just want to know how hot your Mac is right now, the guide at &lt;a href="https://statspace.app/guides/check-mac-temperature" rel="noopener noreferrer"&gt;https://statspace.app/guides/check-mac-temperature&lt;/a&gt; covers that, and the app is at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;https://statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/apple-silicon-sensors-without-root" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>applesilicon</category>
      <category>swift</category>
      <category>hardware</category>
    </item>
    <item>
      <title>My AI agent said it was done. My Mac's fans disagreed.</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Sat, 28 Nov 2026 07:24:24 +0000</pubDate>
      <link>https://dev.to/zernonia/my-ai-agent-said-it-was-done-my-macs-fans-disagreed-3h8a</link>
      <guid>https://dev.to/zernonia/my-ai-agent-said-it-was-done-my-macs-fans-disagreed-3h8a</guid>
      <description>&lt;p&gt;Claude Code had finished. The terminal was quiet, the diff looked fine, and my MacBook was hot enough that I moved it off my lap. The fans were going like it was rendering video, and CPU and memory were still pinned.&lt;/p&gt;

&lt;p&gt;Activity Monitor didn't help much. It showed a wall of &lt;code&gt;node&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; and helper processes, none of them obviously mine, none of them saying where they came from. So I did what I'd do with any bug: I asked Claude to help me find the root cause, and we walked the process tree together.&lt;/p&gt;

&lt;p&gt;The answer was boring and a little embarrassing. An &lt;em&gt;earlier&lt;/em&gt; agent session, one I'd closed hours before, had started Docker containers and a handful of microservices to test its changes. When that session ended, nobody stopped them. They had been running all afternoon, using CPU and memory and heating the whole machine, while I blamed the session in front of me.&lt;/p&gt;

&lt;p&gt;Killing them fixed it that night. But this wasn't a one-off, and it isn't specific to Claude Code. Any agent that can run shell commands can do this. This post is about why it happens, how to find the leftovers yourself, and what I built so I don't have to do it by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the servers outlive the agent
&lt;/h2&gt;

&lt;p&gt;To check its own work, an agent does what you'd do: &lt;code&gt;npm run dev&lt;/code&gt;, &lt;code&gt;vite&lt;/code&gt;, &lt;code&gt;tsc --watch&lt;/code&gt;, &lt;code&gt;docker compose up -d&lt;/code&gt;, maybe a Python API on :8000. Some of those it tracks as background tasks. Some of them detach from it on purpose.&lt;/p&gt;

&lt;p&gt;Then the session ends, and three different things can happen to what it started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The process was a direct child and gets cleaned up.&lt;/strong&gt; This is the case everyone assumes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The process was a child, but the parent exits without killing it.&lt;/strong&gt; On Unix, a process doesn't die when its parent does. It's re-parented to PID 1, which on macOS is &lt;code&gt;launchd&lt;/code&gt;, and it keeps running with its parent PID now set to 1. If there's no terminal hangup to deliver a &lt;code&gt;SIGHUP&lt;/code&gt;, or the process ignores it (&lt;code&gt;nohup&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;disown&lt;/code&gt;, a tool that daemonizes itself), nothing ever tells it to stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The process was never the agent's child at all.&lt;/strong&gt; &lt;code&gt;docker compose up -d&lt;/code&gt; asks the Docker daemon to start containers. On a Mac those run inside Docker's Linux VM, so they don't even show up as processes in Activity Monitor. You see the VM using CPU, not the containers inside it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The second case is the one that makes debugging annoying. Once a process has been re-parented, the parent chain is gone. &lt;code&gt;ps&lt;/code&gt; can tell you it belongs to &lt;code&gt;launchd&lt;/code&gt;, but not that a Claude Code session in &lt;code&gt;~/code/api&lt;/code&gt; started it four hours ago. The evidence has already been erased by the time you go looking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz3vv9oilelxopye3rhkx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz3vv9oilelxopye3rhkx.jpg" alt="Process tree before and after a Claude Code session ends: next dev on :3000, tsc --watch and uvicorn on :8000 move from under claude to directly under launchd (PID 1), while a postgres container keeps running in the Docker VM" width="799" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When the agent exits, its servers are re-parented to launchd and the container keeps running in Docker's VM.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding leftovers yourself
&lt;/h2&gt;

&lt;p&gt;You don't need any tools for this. Here's the sequence I ended up with.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What's still listening
&lt;/h3&gt;

&lt;p&gt;Leftover servers usually hold a port, so start there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof -nP -iTCP -sTCP:LISTEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-n&lt;/code&gt; and &lt;code&gt;-P&lt;/code&gt; skip DNS and port-name lookups, which makes it fast and shows &lt;code&gt;:3000&lt;/code&gt; instead of a service name. Anything on 3000, 5173, 8000 or 8080 you didn't start is a suspect. To see which project a PID belongs to, ask for its working directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof -a -p &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;PID&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; -d cwd -Fn &lt;span class="o"&gt;|&lt;/span&gt; tail -1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Orphans: your dev tools whose parent is PID 1
&lt;/h3&gt;

&lt;p&gt;This is the most useful single check. Normal processes have a real parent (your shell, your editor). Processes whose parent PID is 1 are either real launchd jobs or something that lost its parent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pgrep -u &lt;span class="s2"&gt;"$USER"&lt;/span&gt; -P 1 -lf &lt;span class="s1"&gt;'node|vite|tsc|python|ruby|bun|deno'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more detail, including how long each one has been running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps -u &lt;span class="s2"&gt;"$USER"&lt;/span&gt; -o pid,ppid,etime,rss,command &lt;span class="o"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;'NR==1 || $2==1'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; grep -Ev &lt;span class="s1"&gt;'\.app/|/System/|/usr/(libexec|sbin)/'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;etime&lt;/code&gt; is elapsed time and &lt;code&gt;rss&lt;/code&gt; is resident memory in kilobytes. The &lt;code&gt;grep&lt;/code&gt; drops GUI apps, their helpers and macOS's own agents, which are legitimately launched by launchd.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs30nveultgo6k6hp6qfm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs30nveultgo6k6hp6qfm.jpg" alt="Terminal output of lsof listing listeners on ports 3000, 8000 and 5432, pgrep finding next dev, tsc --watch and uvicorn with parent PID 1, and docker ps showing api-db-1 created 5 hours ago" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Three commands find most leftovers: what's listening, what has parent PID 1, and which containers are older than your session.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The parent chain, while it still exists
&lt;/h3&gt;

&lt;p&gt;For a process that hasn't been orphaned yet, walk up to see who started it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;pid&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;PID&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"$pid"&lt;/span&gt; -gt 1 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  ps -o &lt;span class="nv"&gt;pid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;,ppid=,command= -p &lt;span class="s2"&gt;"$pid"&lt;/span&gt;
  &lt;span class="nv"&gt;pid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;ps -o &lt;span class="nv"&gt;ppid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; -p &lt;span class="s2"&gt;"$pid"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tr -d &lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;claude&lt;/code&gt;, &lt;code&gt;codex&lt;/code&gt; or &lt;code&gt;cursor-agent&lt;/code&gt; in that chain, an agent started it. If the chain stops immediately at PID 1, see step 2.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Containers
&lt;/h3&gt;

&lt;p&gt;Because containers don't show up as Mac processes, ask Docker directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps --format &lt;span class="s1"&gt;'table {{.Names}}\t{{.Ports}}\t{{.RunningFor}}'&lt;/span&gt;
docker stats --no-stream
docker compose down   &lt;span class="c"&gt;# from the project folder&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;RunningFor&lt;/code&gt; is the giveaway. A database container "Up 5 hours" when you've only been working for one means someone else started it, and that someone was probably your previous agent session.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Stopping things safely
&lt;/h3&gt;

&lt;p&gt;Send &lt;code&gt;SIGTERM&lt;/code&gt; first so servers get a chance to shut down cleanly, and only use &lt;code&gt;kill -9&lt;/code&gt; on what ignores it. Before you kill anything with parent PID 1, check that it's actually a dev tool you recognize. Plenty of legitimate user agents (sync clients, password managers) also run under launchd.&lt;/p&gt;

&lt;p&gt;There's a more complete walkthrough, including a &lt;code&gt;SessionEnd&lt;/code&gt; hook that records what was listening when a session ended, in &lt;a href="https://statspace.app/guides/clean-up-after-claude-code" rel="noopener noreferrer"&gt;how to clean up after a Claude Code session&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it before the evidence disappears
&lt;/h2&gt;

&lt;p&gt;The manual method works, but it has a timing problem: by the time you notice the heat, the parent chain is already gone. So when I built Stat Space, a menu bar system monitor for Apple Silicon, I wanted it to remember the chain &lt;em&gt;while it still existed&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The Agents tab does that. Each tick that processes are sampled, it looks for agent root processes (Claude Code, Codex, Cursor, Aider, Gemini CLI and opencode are matched by binary name and command-line patterns) and records every descendant it ever sees, keyed by PID &lt;em&gt;and&lt;/em&gt; start time. When the agent exits and its children get re-parented to launchd, the app still knows which session they came from.&lt;/p&gt;

&lt;p&gt;The start time matters more than it looks. PIDs get reused, so "PID 48211 was a child of Claude Code" is only true for the process that had that PID when the app saw it. Every lookup and every kill checks that the start time still matches.&lt;/p&gt;

&lt;p&gt;A remembered descendant only becomes a &lt;em&gt;leftover&lt;/em&gt; if three things are true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;its session has ended,&lt;/li&gt;
&lt;li&gt;it's a dev tool (a fixed list: &lt;code&gt;node&lt;/code&gt;, &lt;code&gt;vite&lt;/code&gt;, &lt;code&gt;next-server&lt;/code&gt;, &lt;code&gt;uvicorn&lt;/code&gt;, &lt;code&gt;cargo&lt;/code&gt;, &lt;code&gt;gopls&lt;/code&gt; and about a hundred more, plus interpreters running a known tool script like &lt;code&gt;node .../.bin/vite&lt;/code&gt;) or it owns a listening port,&lt;/li&gt;
&lt;li&gt;it has sat under 2% CPU for 10 minutes since the session ended.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last rule came from using it. Without it, a session that just finished showed a "Clean up" button for processes still winding down, which is noise. Now a finished session with real leftovers looks like &lt;em&gt;Claude Code finished · left :3000 and :5555 running&lt;/em&gt;, with one button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxaa5j9mkdh1d3u9edza2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxaa5j9mkdh1d3u9edza2.jpg" alt="Stat Space Agents tab showing a finished Claude Code session in ~/code/web that left next dev on :3000, prisma studio on :5555, tsc --watch and vitest running, with a Clean up button and the confirmation dialog listing the four processes" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Agents tab lists what a finished session left behind and asks before stopping anything.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Orphans the app never saw being born
&lt;/h2&gt;

&lt;p&gt;Not every orphan comes from a session the app watched. Maybe it started before Stat Space did, or the terminal was closed hours ago. The orphan sweep handles those, and it's deliberately conservative. A process is listed only if it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;has parent PID 1 and belongs to the current user,&lt;/li&gt;
&lt;li&gt;is a dev tool by the same matcher, and isn't inside an &lt;code&gt;.app&lt;/code&gt; bundle or a system path,&lt;/li&gt;
&lt;li&gt;is at least a minute old,&lt;/li&gt;
&lt;li&gt;and wasn't started by launchd on purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last check is the subtle one. A &lt;code&gt;node&lt;/code&gt; process run by your own LaunchAgent also has parent PID 1, and it's not an orphan. macOS tracks a "responsible process" for every PID, and a launchd job is responsible for itself, while a process orphaned from a terminal still names the terminal app as responsible. So if Stat Space has seen a dev tool with a real parent before, it knows it was orphaned. If it's first seen already under launchd, it's only listed when its responsible process isn't itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kill safety
&lt;/h2&gt;

&lt;p&gt;Showing leftovers is easy. Stopping them without ever stopping the wrong thing is the part I spent the most care on. Every kill path in the app (orphan sweep, agent cleanup, killing whatever is on a port) goes through one last check that refuses:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Refused&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PID 0 or 1, root-owned, or a system path&lt;/td&gt;
&lt;td&gt;system processes are never touched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;another user's process&lt;/td&gt;
&lt;td&gt;not yours to kill&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Finder, Dock, WindowServer, loginwindow and friends&lt;/td&gt;
&lt;td&gt;you own them, but killing them is never what you meant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stat Space itself&lt;/td&gt;
&lt;td&gt;obviously&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then it asks you. "Kill 3 orphans?" is a real confirmation, not a toast after the fact. It sends &lt;code&gt;SIGTERM&lt;/code&gt;, waits two seconds, and sends &lt;code&gt;SIGKILL&lt;/code&gt; only to processes that are still alive &lt;em&gt;and&lt;/em&gt; still have the same start time.&lt;/p&gt;

&lt;p&gt;That confirmation earned its keep once already. A sampling optimization skipped processes inside app bundles while the popover was closed, and Claude Code run by the Claude desktop app lives inside one. The Agents tab read that as the session exiting and offered to clean up its MCP servers, while the session was still running. Nothing was killed, because nothing is killed without asking, and session liveness now comes from the full process table. Confirm-before-kill is the rule I'd least want to give up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Letting the agent check its own mess
&lt;/h2&gt;

&lt;p&gt;The part I find most satisfying: the agent can now do the root-cause hunt itself. Stat Space ships a small &lt;code&gt;statspace&lt;/code&gt; CLI, and the same binary runs as an MCP server over stdio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --scope user statspace -- /Applications/StatSpace.app/Contents/Helpers/statspace --mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The relevant tools are &lt;code&gt;agent_sessions&lt;/code&gt; (running and recently ended sessions, their child processes, ports and leftovers), &lt;code&gt;orphans&lt;/code&gt;, &lt;code&gt;list_ports&lt;/code&gt;, &lt;code&gt;whats_on_port&lt;/code&gt;, &lt;code&gt;kill_port&lt;/code&gt; and &lt;code&gt;cleanup_agent_leftovers&lt;/code&gt;. The destructive ones don't trust the model. Called without &lt;code&gt;confirm: true&lt;/code&gt;, they return a description of what &lt;em&gt;would&lt;/em&gt; be killed plus "Nothing has been killed yet. Ask the user to confirm", and the same kill-safety check applies when they do run.&lt;/p&gt;

&lt;p&gt;So "what did my last session leave running?" gets a straight answer, and so does "is anything already on :3000?" before the agent starts yet another server on :3001. In a terminal, &lt;code&gt;statspace agents&lt;/code&gt;, &lt;code&gt;statspace orphans&lt;/code&gt; and &lt;code&gt;statspace cleanup &amp;lt;session&amp;gt;&lt;/code&gt; do the same. More on the setup in &lt;a href="https://statspace.app/guides/mcp-server-for-mac-system-info" rel="noopener noreferrer"&gt;the MCP server guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What it doesn't do: stop Docker containers. The Pro tier maps published ports to container names through the Docker Engine API, so you can see that :5432 is &lt;code&gt;api-db-1&lt;/code&gt;, but &lt;code&gt;docker compose down&lt;/code&gt; is still yours to run. Containers have volumes and state, and I'd rather the app tell you than guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd take away from this
&lt;/h2&gt;

&lt;p&gt;Even if you never install anything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Parent PID 1 plus a dev-tool command line is the signature of a leftover.&lt;/strong&gt; One &lt;code&gt;pgrep -P 1&lt;/code&gt; finds most of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check ports and containers, not just processes.&lt;/strong&gt; On a Mac, containers are invisible to Activity Monitor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capture lineage early.&lt;/strong&gt; Once a process is re-parented, nothing on the system remembers who started it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell your agent to clean up&lt;/strong&gt;, in &lt;code&gt;CLAUDE.md&lt;/code&gt; or your equivalent, and check anyway. An interrupted session never reaches its cleanup step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stat Space is the tool I built after that hot evening: a lean menu bar monitor with the Agents tab, orphan sweep, ports and the MCP server in the free version. It's at &lt;a href="https://statspace.app" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt; if you want it, and the &lt;a href="https://statspace.app/features/agents" rel="noopener noreferrer"&gt;Agents feature page&lt;/a&gt; has the details.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/ai-agent-left-servers-running" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aicoding</category>
      <category>claudecode</category>
      <category>macos</category>
      <category>developertools</category>
    </item>
    <item>
      <title>WindowServer high CPU with an external monitor on Mac</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Sat, 28 Nov 2026 07:24:23 +0000</pubDate>
      <link>https://dev.to/zernonia/windowserver-high-cpu-with-an-external-monitor-on-mac-1iac</link>
      <guid>https://dev.to/zernonia/windowserver-high-cpu-with-an-external-monitor-on-mac-1iac</guid>
      <description>&lt;p&gt;If WindowServer jumps to 30, 50 or 80% CPU the moment you plug in an external monitor, nothing is broken. WindowServer is the process that draws your screens, and its cost scales with three things: how many pixels it composites, how many times a second it does it, and how much on screen is changing. An external display can raise the first two at once.&lt;/p&gt;

&lt;p&gt;The biggest single cause is a &lt;strong&gt;scaled resolution&lt;/strong&gt;. When you pick a "Looks like" size that isn't exactly half the panel's pixels, macOS renders a larger image at 2x and then shrinks it to fit. On a 4K monitor set to look like 2560 × 1440, that's a 5120 × 2880 frame, about 1.8 times the pixels the panel actually has. Add a 120 or 144 Hz refresh rate and a browser tab with an animation, and WindowServer has real work to do every frame.&lt;/p&gt;

&lt;p&gt;The fixes, in order of how much they usually help: use the monitor's default or an exact-2x resolution, lower the refresh rate if you don't need it, find the app that's animating, and turn on Reduce transparency. The rest of this post is how each of those works and how to measure it, so you're not guessing. For the basics of the process itself, see the &lt;a href="https://statspace.app/processes/windowserver" rel="noopener noreferrer"&gt;WindowServer process page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What WindowServer actually does
&lt;/h2&gt;

&lt;p&gt;Apps don't draw directly to the screen. Each app renders its own windows into buffers, and WindowServer (it lives in &lt;code&gt;SkyLight.framework&lt;/code&gt; and runs as the &lt;code&gt;_windowserver&lt;/code&gt; user) composites them: stacks the windows, adds shadows, blurs whatever sits behind the menu bar and sidebars, draws the cursor, runs Spaces and Mission Control animations, and hands a finished frame to each display.&lt;/p&gt;

&lt;p&gt;You can confirm it's the real one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps -o user,pid,%cpu,command -p &lt;span class="nv"&gt;$(&lt;/span&gt;pgrep -x WindowServer&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USER            PID  %CPU COMMAND
_windowserver   394  20.5 /System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer -daemon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things make its numbers confusing. First, its CPU is the &lt;em&gt;sum&lt;/em&gt; of what everything else on screen is asking for, so the cause is almost never WindowServer itself. Second, much of the compositing happens on the GPU, so its CPU column only shows part of the cost. While I wrote this on an M1 Pro, with only the built-in display, Chrome open and a terminal streaming output, &lt;code&gt;top&lt;/code&gt; showed WindowServer between about 20 and 35%. That's normal for a busy desktop. What isn't normal is a high number when nothing on screen is moving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an external monitor costs so much
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scaled resolutions render more pixels than the panel has
&lt;/h3&gt;

&lt;p&gt;macOS draws its interface at 2x on Retina-class screens. When the "Looks like" size is exactly half the panel's resolution, the 2x image matches the panel one to one. When it isn't, macOS renders at 2x of the size you picked and downsamples the result. The bigger the "Looks like" size, the bigger the hidden frame.&lt;/p&gt;

&lt;p&gt;For a common 27-inch 4K panel (3840 × 2160, 8.3 million pixels):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Looks like&lt;/th&gt;
&lt;th&gt;macOS renders&lt;/th&gt;
&lt;th&gt;Pixels per frame&lt;/th&gt;
&lt;th&gt;vs the panel&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1920 × 1080&lt;/td&gt;
&lt;td&gt;3840 × 2160&lt;/td&gt;
&lt;td&gt;8.3 MP&lt;/td&gt;
&lt;td&gt;1.0x, no downsampling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2560 × 1440&lt;/td&gt;
&lt;td&gt;5120 × 2880&lt;/td&gt;
&lt;td&gt;14.7 MP&lt;/td&gt;
&lt;td&gt;1.8x, downsampled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3008 × 1692&lt;/td&gt;
&lt;td&gt;6016 × 3384&lt;/td&gt;
&lt;td&gt;20.4 MP&lt;/td&gt;
&lt;td&gt;2.5x, downsampled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3840 × 2160 (1x, not Retina)&lt;/td&gt;
&lt;td&gt;3840 × 2160&lt;/td&gt;
&lt;td&gt;8.3 MP&lt;/td&gt;
&lt;td&gt;1.0x, but blurry-looking text&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is why the 5K Studio Display and LG UltraFine 5K are the "Mac" monitors: at 5120 × 2880, looking like 2560 × 1440 is an exact 2x, so you get the space without the downsampling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fexl721bd8peeseedww40.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fexl721bd8peeseedww40.jpg" alt="Bar chart of pixels rendered per frame on a 4K monitor: looks like 1920x1080 renders 8.3 megapixels, 2560x1440 renders 14.7, 3008x1692 renders 20.4, while a 5K panel at 2560x1440 renders 14.7 with no downsampling; at 144 Hz the 2560x1440 case is 2.1 gigapixels per second versus 0.5 at 60 Hz for 1920x1080" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Pixels per frame, times frames per second. The scaled sizes are the ones that cost more than the panel.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Refresh rate multiplies everything
&lt;/h3&gt;

&lt;p&gt;A 144 Hz monitor can ask for 144 frames a second instead of 60. WindowServer only recomposites what changed, so a static screen at 144 Hz is cheap. But while anything moves (scrolling, a video, a spinner, a window being dragged) it does that work up to 2.4 times as often. The 14.7 MP frame from the table above at 144 Hz is about 2.1 billion pixels a second, against roughly 0.5 billion for a 1:1 4K frame at 60 Hz.&lt;/p&gt;

&lt;p&gt;Treat those as ceilings rather than measurements: the compositor redraws only damaged regions. But they show why the same desktop can be fine on the built-in screen and heavy on an external one.&lt;/p&gt;

&lt;h3&gt;
  
  
  More displays, more Spaces, more windows
&lt;/h3&gt;

&lt;p&gt;Each display is its own frame to build. Every window keeps a backing buffer on every Space it's on, which is also why WindowServer's memory can reach a few gigabytes with many windows on a large screen. Mirroring a display at a different resolution means rendering for both.&lt;/p&gt;

&lt;h3&gt;
  
  
  Things that redraw on their own
&lt;/h3&gt;

&lt;p&gt;The resolution sets the price per frame. These decide how many frames get drawn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A browser tab with animation.&lt;/strong&gt; Ads, animated backgrounds, a dashboard that repaints every second, a canvas game left in a background window that's still visible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparency and blur.&lt;/strong&gt; The menu bar, Dock, sidebars, Control Center and Notification Center blur whatever's behind them. When the content behind moves, the blur is recomputed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage Manager.&lt;/strong&gt; The thumbnails on the side are live. Its own process is &lt;a href="https://statspace.app/processes/windowmanager" rel="noopener noreferrer"&gt;WindowManager&lt;/a&gt;, but the compositing lands on WindowServer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moving wallpapers.&lt;/strong&gt; The aerial wallpapers in Sonoma and later animate on the desktop and lock screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screen sharing and recording.&lt;/strong&gt; Zoom, Teams, Meet in a browser, OBS and Screen Sharing all capture frames through WindowServer, often the whole display at full resolution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Menu bar apps that redraw constantly.&lt;/strong&gt; Every status item update is a redraw that WindowServer has to composite.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one includes system monitors, mine too, so it's worth being specific. A menu bar monitor that redraws every item every second costs WindowServer a little every second, forever. Stat Space draws its items with Core Graphics and compares what it would draw with what's already there. If the number hasn't changed, nothing is redrawn. If the item's width hasn't changed, its length isn't touched either, because each change round-trips to the system process that hosts status items. The honest caveat: a sparkline or line-chart item changes every sample by design, so it does redraw every tick. If you're chasing every last percent, plain text items redraw least. The &lt;a href="https://statspace.app/blog/system-monitor-under-0-3-percent-cpu" rel="noopener noreferrer"&gt;0.3% CPU post&lt;/a&gt; covers the rest of that design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure it before changing anything
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Read your display setup
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;system_profiler&lt;/code&gt; shows what each display is and how it's driven:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;system_profiler SPDisplaysDataType
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On my MacBook Pro with no monitor attached, the built-in screen looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Graphics/Displays:

    Apple M1 Pro:

      Chipset Model: Apple M1 Pro
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 16
      Displays:
        Color LCD:
          Display Type: Built-in Liquid Retina XDR Display
          Resolution: 3024 x 1964 Retina
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Connection Type: Internal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An external display adds a few more lines. The two that matter here are &lt;code&gt;Resolution&lt;/code&gt;, the panel's real pixels, and &lt;code&gt;UI Looks like&lt;/code&gt;, the size you picked and its refresh rate. A 4K monitor at a scaled setting reads something like this (an example, with the serial line removed; yours will include it, so redact it before posting the output anywhere):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        LG HDR 4K:
          Resolution: 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition)
          UI Looks like: 2560 x 1440 @ 60.00Hz
          Main Display: No
          Mirror: Off
          Online: Yes
          Connection Type: Thunderbolt/DisplayPort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The quick check: double the "Looks like" numbers. If that matches &lt;code&gt;Resolution&lt;/code&gt;, you're at 1:1. If it's bigger, macOS is rendering the larger frame and downsampling. &lt;strong&gt;System Settings › Displays&lt;/strong&gt; shows the same thing as the selected thumbnail, and the refresh rate is in the menu below it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watch WindowServer, CPU and GPU
&lt;/h3&gt;

&lt;p&gt;In Activity Monitor's CPU tab, sort by &lt;code&gt;% CPU&lt;/code&gt; and find WindowServer. Then add the GPU side: &lt;strong&gt;View › Columns › % GPU&lt;/strong&gt; adds a GPU column, and &lt;strong&gt;Window › GPU History&lt;/strong&gt; (&lt;code&gt;⌘4&lt;/code&gt;) opens a live GPU graph. Leave both open and work for a minute. A WindowServer that's busy while the GPU graph is busy is compositing. A WindowServer at 60% with a flat GPU graph and nothing moving is worth a restart and a cable or dock check.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://statspace.app/guides/high-cpu-usage-mac" rel="noopener noreferrer"&gt;high CPU guide&lt;/a&gt; covers the general method with &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;ps&lt;/code&gt; if you'd rather stay in Terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find the app that's driving it
&lt;/h3&gt;

&lt;p&gt;Because WindowServer works on behalf of other apps, the fastest diagnosis is subtraction: hide or quit apps one at a time and watch its CPU. A big drop names the culprit. Hiding an app with &lt;code&gt;⌘H&lt;/code&gt; is a quick, reversible test, since a hidden window has nothing to composite. Start with the browser, then anything with video, then Electron apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to bring it down
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use an exact-2x or default resolution.&lt;/strong&gt; In &lt;strong&gt;System Settings › Displays&lt;/strong&gt;, pick "Default" for the monitor, or a size that's exactly half its pixels (1920 × 1080 on 4K, 2560 × 1440 on 5K). If you need more space on a 4K panel, that's a fair trade, just a known one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower the refresh rate when you don't need it.&lt;/strong&gt; The &lt;strong&gt;Refresh rate&lt;/strong&gt; menu under the display in System Settings. 60 Hz is plenty for documents and code; keep 120 or 144 for games and smooth scrolling if you value them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close or minimize animated tabs.&lt;/strong&gt; Especially dashboards, ads and anything with a canvas. A tab that's hidden behind another window is still drawn if any of it is visible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn on Reduce transparency.&lt;/strong&gt; &lt;strong&gt;System Settings › Accessibility › Display › Reduce transparency.&lt;/strong&gt; This removes most of the blur work. Reduce motion in the same pane shortens Spaces and Mission Control animations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a still wallpaper&lt;/strong&gt; instead of an aerial one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try Stage Manager off&lt;/strong&gt; for a day if you use it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fewer windows, fewer Spaces.&lt;/strong&gt; Hundreds of open Finder or browser windows across many desktops each hold a buffer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop sharing when you're done.&lt;/strong&gt; A meeting app that's still capturing your screen after the call is a common leftover.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If none of that moves the number and WindowServer stays high on a static screen, the usual suspects are a flaky dock or adapter, a display that keeps renegotiating its connection, or a macOS bug fixed in a point release. Unplug the monitor and see if the number falls back; if it does, try a different cable or a direct connection. The broader &lt;a href="https://statspace.app/guides/why-is-my-mac-slow" rel="noopener noreferrer"&gt;why is my Mac slow&lt;/a&gt; checklist is the next step if it isn't the display at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Stat Space helps
&lt;/h2&gt;

&lt;p&gt;Two parts of Stat Space are useful for this. The &lt;a href="https://statspace.app/features/devices" rel="noopener noreferrer"&gt;Devices tab&lt;/a&gt; lists each display with its pixels, looks-like size and refresh rate, and you can expand a display to change either without opening System Settings, which makes trying 60 Hz against 144 Hz a two-click experiment. The Apps tab groups helpers under their app, so all of Chrome's renderers show as Chrome and the app that's keeping WindowServer busy is one row instead of twenty.&lt;/p&gt;

&lt;p&gt;Stat Space is a lean menu bar system monitor for Apple Silicon, free with a one-time Pro upgrade, and it shows its own CPU and memory in the popover footer so you can check what it costs WindowServer and everything else. It's at &lt;a href="https://statspace.app/" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://statspace.app/blog/windowserver-high-cpu-external-monitor" rel="noopener noreferrer"&gt;statspace.app&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>macos</category>
      <category>activitymonitor</category>
      <category>performance</category>
      <category>applesilicon</category>
    </item>
    <item>
      <title>Idea to Production in 2 days, thanks to...</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Wed, 18 May 2022 02:25:36 +0000</pubDate>
      <link>https://dev.to/zernonia/idea-to-production-in-2-days-thanks-to-372b</link>
      <guid>https://dev.to/zernonia/idea-to-production-in-2-days-thanks-to-372b</guid>
      <description>&lt;h1&gt;
  
  
  ...&lt;a href="https://v3.nuxtjs.org/"&gt;&lt;strong&gt;Nuxt 3&lt;/strong&gt;&lt;/a&gt;!
&lt;/h1&gt;

&lt;p&gt;If you are not familiar with Nuxt 3, it is build on top of the awesome Vue 3 + Vite (or Webpack if you like) + Typescript, which makes the process of development feels like a breeze. But before we jump right into the Nuxt awesomeness, let me show you the product I've built!&lt;/p&gt;

&lt;h1&gt;
  
  
  Showcase
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://tweetic.io"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jj7JwE5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q9vf7jp94mdolzg1ojjy.png" alt="Tweetic io cover" width="880" height="473"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Introducing &lt;a href="https://tweetic.io"&gt;Tweetic.io&lt;/a&gt;! It &lt;strong&gt;Convert Tweets to Static HTML&lt;/strong&gt;, where you can embed it on your landing page, blogs or anywhere you like.&lt;/p&gt;

&lt;p&gt;It was heavily inspired by Tweet embedded on &lt;a href="https://supabase.com"&gt;Supabase's&lt;/a&gt; landing page! I looked around the internet, but couldn't find any static tweet generator, thus created this tools!!!&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🤩 Free&lt;/li&gt;
&lt;li&gt;📖 &lt;a href="https://github.com/zernonia/tweetic"&gt;Open-Source&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🚀 API ready&lt;/li&gt;
&lt;li&gt;📋 Copy/Download Static HTML&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ok, enough showcasing, let's dive in to the real deal, Nuxt3!&lt;/p&gt;




&lt;h1&gt;
  
  
  Nuxt Features
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Auto Import
&lt;/h2&gt;

&lt;p&gt;Still wasting your time and effort naming every Vue component, then importing them one by one manually into your views components? Create view and import in Vue router one by one?&lt;/p&gt;

&lt;p&gt;Well, Nuxt auto-import components got you covered! Nuxt (even before Nuxt 3) has auto-import features that import all components in &lt;code&gt;./components&lt;/code&gt; folder, as well as creating routes based on your&lt;code&gt;./pages&lt;/code&gt; folder. &lt;/p&gt;

&lt;p&gt;Check out the &lt;code&gt;./pages/index.vue&lt;/code&gt; from Tweetic.io:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;setup&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"ts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c1"&gt;// No need to import anything because Nuxt 3 does it automatically!!&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mt-32 flex flex-col items-center overflow-hidden xl:overflow-visible"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      // some h1, h2

    &lt;span class="nt"&gt;&amp;lt;NuxtLink&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;"/thank-you"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col items-center mt-8 text-gray-400"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;thank you everyone...&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;Underline&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-16 -mt-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/Underline&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/NuxtLink&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col items-center space-y-4 md:relative mt-8 md:mt-32 w-full md:h-224"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"md:absolute flex items-center -top-20 left-10 text-gray-400"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Arrow&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/Arrow&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;Static HTML tweets&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;Tweet&lt;/span&gt;
        &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"md:absolute top-0 left-0"&lt;/span&gt;
        &lt;span class="na"&gt;url=&lt;/span&gt;&lt;span class="s"&gt;"https://twitter.com/zernonia/status/1513020247690809346"&lt;/span&gt;
        &lt;span class="na"&gt;layout=&lt;/span&gt;&lt;span class="s"&gt;"supabase"&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;gt;&amp;lt;/Tweet&amp;gt;&lt;/span&gt;
      // more tweets
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But that's not all, now the latest Nuxt 3 has even more auto-import features!&lt;/p&gt;

&lt;p&gt;TS/JS files in &lt;code&gt;plugins&lt;/code&gt; and &lt;code&gt;composables&lt;/code&gt; are auto-imported, so you don't need to export them, and manually import them into &lt;code&gt;nuxt.config.ts&lt;/code&gt;, or your function script! You can look at all the plugins for Tweetic.io &lt;a href="https://github.com/zernonia/tweetic/tree/master/plugins"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this saves me soooooooo much time!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Server Engine (Nitro)
&lt;/h2&gt;

&lt;p&gt;Nuxt 3 is running on &lt;a href="https://v3.nuxtjs.org/guide/concepts/server-engine/"&gt;Nitro engine&lt;/a&gt;, which unlocks new full-stack capabilities to Nuxt server.  It generates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; server API by reading files in &lt;code&gt;server/api/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; server middleware from &lt;code&gt;server/middleware/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; server routes from &lt;code&gt;server/routes&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(YES everything is automatic again!!) &lt;/p&gt;

&lt;p&gt;Creating API endpoint is &lt;strong&gt;ridiculously easy&lt;/strong&gt;! You just need to &lt;code&gt;return&lt;/code&gt; a JSON data, and done! You have an API endpoint ready to go. Of course, we are free to create node based API as well if you choose to! &lt;/p&gt;

&lt;p&gt;Check out this super simple &lt;code&gt;server/api/hello.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;defineEventHandler&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;api&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;world!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now calling &lt;code&gt;http://localhost:3000/api/hello&lt;/code&gt; will return JSON &lt;code&gt;{ "api": "world" }&lt;/code&gt; 🌎 to you 🔥 &lt;/p&gt;

&lt;p&gt;Furthermore, the smoothest experience of using this new Nitro engine is when &lt;strong&gt;deploying the app&lt;/strong&gt;! Nitro has cross-platform support for Node.js, Browsers, service-workers and more. It support serverless deployment out-of-the-box too! &lt;/p&gt;

&lt;p&gt;Tweetic.io is deployed on &lt;a href="https://vercel.com"&gt;Vercel&lt;/a&gt; with zero configuration! Nitro will auto-detect the platform, and generate the appropriate output for you. &lt;a href="https://v3.nuxtjs.org/guide/deploy/presets#supported-hosting-providers"&gt;Here&lt;/a&gt; are the list of supported hosting providers! &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No need to mess with deployment, this is SMOOTH!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Fully Typed!!
&lt;/h2&gt;

&lt;p&gt;Nuxt 3 is fully typed and provides helpful shortcuts to ensure you have access to accurate type information when you are coding. If you are Typescript fans like me, you will be in love with coding once again! &lt;/p&gt;

&lt;p&gt;Nuxt 3 generates type-ready Vue components, so you can refers to &lt;code&gt;props&lt;/code&gt; and &lt;code&gt;emits&lt;/code&gt; easily without inspecting the components, or worried that you might be passing the wrong props into the components.&lt;/p&gt;

&lt;p&gt;Other than that, the response from &lt;code&gt;useFetch/useAsyncData&lt;/code&gt; provided by Nuxt 3 is also fully typed! You can use the response immediately without having to type cast it like using &lt;code&gt;fetch&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6h7LBhha--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652803972652/0AsFdzHs-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6h7LBhha--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652803972652/0AsFdzHs-.png" alt="image.png" width="412" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The one thing that literally blew my mind, is this....&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e3_J4PrR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652803827847/6YA1Oho-g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e3_J4PrR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652803827847/6YA1Oho-g.png" alt="Screenshot 2022-05-18 at 12.10.01 AM.png" width="412" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;... did you spot it?&lt;/p&gt;

&lt;p&gt;Is that Nuxt will auto suggest what Server API route is available to be called 🤯!!! &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is super DX in it's finest!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Super fast load time
&lt;/h2&gt;

&lt;p&gt;Last but not least, the lightning fast Vite load time! Vite has been well-known for it's blazing fast initial load time, as well as it's build time. Nuxt 3 uses &lt;a href="https://vitejs.dev"&gt;Vite&lt;/a&gt; to bundle the application.  &lt;/p&gt;

&lt;p&gt;For my tiny apps, it took &lt;strong&gt;1401 milliseconds&lt;/strong&gt; to start the dev server. That is blazingly fast compared to Nuxt 2 with webpack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GdmCGZE1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652804460381/BTDHdIBQQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GdmCGZE1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1652804460381/BTDHdIBQQ.png" alt="image.png" width="411" height="181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;npx nuxi init &amp;lt;your-app&amp;gt;&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Nuxt 3 really boosted my productivity, and my developing experience! I couldn't express enough how good the experience is, you just have to taste it on your own! 🍇&lt;/p&gt;

&lt;p&gt;So what are you waiting for? As Nuxt 3 is currently in the release candidate 3, I'm hopeful that the Nuxt environment will get richer with more awesome plugins and modules!&lt;/p&gt;

&lt;p&gt;While discussing a feature request for Nuxt 3 with my friend on Twitter, @&lt;a href="https://twitter.com/Atinux"&gt;Sébastien Chopin&lt;/a&gt; (CEO of NuxtLab) dropped by and take note of the thread that we were discussing! This indicates how proactive the team is, and how eager they are to build a product that will be loved by many!&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--w5gNp5iy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1042510623962275840/1Iw_Mvud_normal.jpg" alt="Sébastien Chopin profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Sébastien Chopin
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/atinux"&gt;@atinux&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/zernonia"&gt;@zernonia&lt;/a&gt; &lt;a href="https://twitter.com/chrisbbreuer"&gt;@chrisbbreuer&lt;/a&gt; &lt;a href="https://twitter.com/nuxt_js"&gt;@nuxt_js&lt;/a&gt; I really like this thread
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      21:17 PM - 17 May 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1526673182798794754" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1526673182798794754" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1526673182798794754" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
 

&lt;p&gt;If you haven't tried out Nuxt 3, now is a good time! Give yourself a taste of Super DX  (made possible by Nuxt teams and the communities!) and share with me &lt;strong&gt;1 thing&lt;/strong&gt; you like the most about Nuxt 3 in the comment section down below!&lt;/p&gt;

&lt;p&gt;Thank you for your attention! 💛  May God bless you! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I Design, You Build! - Frontend Challenge #4 (Supabase version)</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Sat, 16 Apr 2022 01:50:24 +0000</pubDate>
      <link>https://dev.to/zernonia/i-design-you-build-frontend-challenge-4-supabase-version-2afm</link>
      <guid>https://dev.to/zernonia/i-design-you-build-frontend-challenge-4-supabase-version-2afm</guid>
      <description>&lt;h2&gt;
  
  
  Appreciation ❤️
&lt;/h2&gt;

&lt;p&gt;I'm loving every submission here on &lt;code&gt;Dev.to&lt;/code&gt; from the previous challenges! Really thank you everyone that participated, or bookmarked it! &lt;/p&gt;




&lt;h2&gt;
  
  
  New Challenge (Supabase version)
&lt;/h2&gt;

&lt;p&gt;Let's step up from the plain 1 pager, and static data! It's time for &lt;code&gt;fetch&lt;/code&gt; challenge! Challenger (you) would need to fetch data from API, then display the dynamic content! 🤩  &lt;/p&gt;

&lt;p&gt;But why is it called &lt;a href="https://supabase.com" rel="noopener noreferrer"&gt;Supabase&lt;/a&gt; version? Because we are going to leverage Supabase's super powerful auto generated &lt;strong&gt;REST API/Graphql&lt;/strong&gt; endpoint to query data. Not only simple query, you can even apply &lt;a href="https://supabase.com/docs/reference/javascript/range" rel="noopener noreferrer"&gt;pagination&lt;/a&gt;/&lt;a href="https://supabase.com/docs/reference/javascript/using-filters" rel="noopener noreferrer"&gt;filters&lt;/a&gt; into the query without writing a single backend code!&lt;/p&gt;

&lt;p&gt;Do not worry 😉! I created a tool, called &lt;a href="https://www.supadb.dev/" rel="noopener noreferrer"&gt;SupaDB&lt;/a&gt; that allow user to access all the data provided for &lt;strong&gt;FREE&lt;/strong&gt;! Just simply sign up to obtain the Authorization key, and initiate Supabase client and you are ready!&lt;/p&gt;

&lt;p&gt;Target:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎯 Target : Fetch from provided API&lt;/li&gt;
&lt;li&gt;🎯 Target : Search games by name&lt;/li&gt;
&lt;li&gt;🎯 Target : Sort games by "Price", "Name"&lt;/li&gt;
&lt;li&gt;🎯 Target : Carousel item&lt;/li&gt;
&lt;li&gt;🎯 Target : Responsive design&lt;/li&gt;
&lt;li&gt;🎯 Target : External link to game's page on Steam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Extra:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌟 Extra : Loading state (loader/skeleton)&lt;/li&gt;
&lt;li&gt;🌟 Extra : Hover animation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📃 Supabase : &lt;a href="https://supabase.com/docs/reference/javascript/select" rel="noopener noreferrer"&gt;https://supabase.com/docs/reference/javascript/select&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📃 Icon : &lt;a href="https://icones.js.org/collection/all" rel="noopener noreferrer"&gt;https://icones.js.org/collection/all&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📃 Hosting : &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;https://vercel.com/&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠ It will defeat the purpose of learning if you just copy and paste someone else's answer 😭!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Prizes!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/5GoVLqeAOo6PK/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/5GoVLqeAOo6PK/giphy.gif" alt="Excited for prizes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the title mentioned, this is the Supabase version of "I Design, You Build" challenge, so there will be &lt;strong&gt;AWESOME SWAG&lt;/strong&gt; prizes to rewards 5 winners that has the best submission (I will be the judge 😉) &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;del&gt;The judging period will be 1 month time from the today!&lt;/del&gt;&lt;br&gt;
&lt;del&gt;Dateline for submission will be &lt;strong&gt;7 May 2022&lt;/strong&gt;&lt;/del&gt;&lt;br&gt;
Submission ended! I will start the judging process 😊&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the first prizes giveaway for "I Design, You Build" series, and definitely not the last! There will be more prizes in the future! So stay tuned, remember to bookmark this challenge, and follow me on &lt;code&gt;Dev.to&lt;/code&gt; and &lt;a href="https://twitter.com/zernonia" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; to stay up to date!&lt;/p&gt;




&lt;h2&gt;
  
  
  Start Coding!
&lt;/h2&gt;

&lt;p&gt;If you are ready to take on the challenge, then&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Help 💖 this design on &lt;a href="https://dribbble.com/shots/18027956-STAEM-Steam-Store-Re-Design-Challenge" rel="noopener noreferrer"&gt;Dribbble&lt;/a&gt;, and follow me! Please... 😳&lt;/li&gt;
&lt;li&gt;Bookmark this post so that you can submit it easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Right-click&lt;/strong&gt; &lt;a href="https://www.figma.com/file/v9WwrvuGFZHVLy4z3wxHGi/STAEM?node-id=3%3A2" rel="noopener noreferrer"&gt;here&lt;/a&gt; and open &lt;strong&gt;Open link in a New Tab&lt;/strong&gt; to see the Figma Design.&lt;/li&gt;
&lt;li&gt;Enjoy coding! 🤩&lt;/li&gt;
&lt;li&gt;Come back to submit!&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;All the &lt;strong&gt;images&lt;/strong&gt; and &lt;strong&gt;assets&lt;/strong&gt; are free to use, and can be exported from the Figma Design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.figma.com/file/v9WwrvuGFZHVLy4z3wxHGi/STAEM?node-id=3%3A2" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47ij7e4rketxmtakxmkt.png" alt="Zernonia Frontend Challenge #4 Supabase version"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Submission
&lt;/h2&gt;

&lt;p&gt;Once you've completed, come back to this post, and submit your solution using the following &lt;code&gt;template&lt;/code&gt; in the comment section. You are encouraged to &lt;strong&gt;comment&lt;/strong&gt; and &lt;strong&gt;upvotes&lt;/strong&gt; other's answer!&lt;/p&gt;

&lt;p&gt;Thank you!💘&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feedback: This is awesome!

Demo: &amp;lt;url&amp;gt;
Github: &amp;lt;url&amp;gt;
Tech-Stack: Vue, TailwindCSS
Learning Outcome: 
  1. 
  2.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;I share these design freely so that anyone who wanted to practice or challenge Web design be able to do so without paying other platform (&lt;em&gt;ahem) to get their **Figma Design&lt;/em&gt;*🎨 file. &lt;/p&gt;

&lt;p&gt;You are free to use the Design you've created in your portfolio. No copyright claims or anything.&lt;/p&gt;

&lt;p&gt;But if you are loving my work, you are most welcomed to follow me on &lt;code&gt;Dev.to&lt;/code&gt; and &lt;a href="https://twitter.com/zernonia" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; 😄&lt;/p&gt;

&lt;p&gt;Also, check out my own &lt;a href="https://zernonia.com" rel="noopener noreferrer"&gt;Website&lt;/a&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank you for your time and attention! Hope you'll enjoy!
&lt;/h3&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>showdev</category>
      <category>idesignyoubuild</category>
    </item>
    <item>
      <title>I Design, You Build! - Frontend Challenge #3</title>
      <dc:creator>Zernonia</dc:creator>
      <pubDate>Thu, 14 Oct 2021 02:18:13 +0000</pubDate>
      <link>https://dev.to/zernonia/i-design-you-build-frontend-challenge-3-gda</link>
      <guid>https://dev.to/zernonia/i-design-you-build-frontend-challenge-3-gda</guid>
      <description>&lt;h2&gt;
  
  
  Appreciation
&lt;/h2&gt;

&lt;p&gt;What an overwhelming response from the first two challenges! I know I said it before, but I really enjoy seeing every submission, and appreciate every feedback given. If you haven't give the challenge a try, I &lt;strong&gt;strongly encourage&lt;/strong&gt; you to join us in this fun challenge! 🤩✨&lt;/p&gt;

&lt;p&gt;I know everyone is in different level of HTML/CSS/Javascript, but don't worry, I will try to mix in different difficulties in the coming challenge, so stay tuned! 🔔&lt;/p&gt;




&lt;h2&gt;
  
  
  Challenge
&lt;/h2&gt;

&lt;p&gt;There's a few 1 pager (or should I say 1 section 😆) design previously, how about let's make a Homepage for a Modern Interior Furniture Store?&lt;/p&gt;

&lt;p&gt;So, in this challenge, we will be creating a &lt;strong&gt;minimalistic E-commerce Website&lt;/strong&gt; with the touch of modern UI. Create a homepage following the design. Fulfill Target and/or Extra below:&lt;/p&gt;

&lt;p&gt;Target:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎯 Target : User can see the similar design&lt;/li&gt;
&lt;li&gt;🎯 Target : Responsive design&lt;/li&gt;
&lt;li&gt;🎯 Target : Filter products&lt;/li&gt;
&lt;li&gt;🎯 Target : Multiple showcase (use arrow button to navigate)&lt;/li&gt;
&lt;li&gt;🎯 Target : On mobile, when I select the hamburger menu, I can see a navigation (use your own creativity)&lt;/li&gt;
&lt;li&gt;🎯 Target : On mobile, I can slide the products to left-right.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Extra:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌟 Extra : Add animation to the filtering&lt;/li&gt;
&lt;li&gt;🌟 Extra : Add animation when scrolling down the page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📃 Icon : &lt;a href="https://icones.js.org/collection/all" rel="noopener noreferrer"&gt;https://icones.js.org/collection/all&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📃 Hosting: &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;https://vercel.com/&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠ It will defeat the purpose of learning if you just copy and paste someone else's answer 😭!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Start Coding!
&lt;/h2&gt;

&lt;p&gt;If you are ready to take on the challenge, then&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Help 💖 this design on &lt;a href="https://dribbble.com/shots/16649336-SHPX-Modern-Interior-Furniture-Store-Design" rel="noopener noreferrer"&gt;Dribbble&lt;/a&gt;, and follow me! Please... 😳&lt;/li&gt;
&lt;li&gt;Bookmark this post so that you can submit it easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Right-click&lt;/strong&gt; &lt;a href="https://www.figma.com/file/e7u4jp5OqyHybDZzRCTMvi/SHPX?node-id=0%3A1" rel="noopener noreferrer"&gt;here&lt;/a&gt; and open &lt;strong&gt;Open link in a New Tab&lt;/strong&gt; to see the Figma Design.&lt;/li&gt;
&lt;li&gt;Enjoy coding! 🤩&lt;/li&gt;
&lt;li&gt;Come back to submit!&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;All the &lt;strong&gt;images&lt;/strong&gt; and &lt;strong&gt;assets&lt;/strong&gt; are free to use, and can be exported from the Figma Design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.figma.com/file/e7u4jp5OqyHybDZzRCTMvi/SHPX?node-id=0%3A1" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwacxb8wvrum5zy2swxm.png" alt="Zernonia Frontend Challenge #3"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Submission
&lt;/h2&gt;

&lt;p&gt;Once you've completed, come back to this post, and submit your solution using the following &lt;code&gt;template&lt;/code&gt; in the comment section. You are encouraged to &lt;strong&gt;comment&lt;/strong&gt; and &lt;strong&gt;upvotes&lt;/strong&gt; other's answer!&lt;/p&gt;

&lt;p&gt;Thank you!💘&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feedback: This is awesome!

Demo: &amp;lt;url&amp;gt;
Github: &amp;lt;url&amp;gt;
Tech-Stack: Vue, TailwindCSS
Learning Outcome: 
  1. 
  2.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;I share these design freely so that anyone who wanted to practice or challenge Web design be able to do so without paying other platform (&lt;em&gt;ahem) to get their **Figma Design&lt;/em&gt;*🎨 file. &lt;/p&gt;

&lt;p&gt;You are free to use the Design you've created in your portfolio. No copyright claims or anything.&lt;/p&gt;

&lt;p&gt;But if you are loving my work, you are most welcomed to follow me on &lt;code&gt;Dev.to&lt;/code&gt; and &lt;a href="https://twitter.com/zernonia" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; 😄&lt;/p&gt;

&lt;p&gt;Also, check out my own &lt;a href="https://zernonia.com" rel="noopener noreferrer"&gt;Website&lt;/a&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank you for your time and attention! Hope you'll enjoy!
&lt;/h3&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>idesignyoubuild</category>
    </item>
  </channel>
</rss>
