Claude Code App Development: A Practical Mac Workflow15 min read2,942 words

Claude Code App Development: A Practical Mac Workflow

Build a native Mac app with Claude Code using a written spec, risk-first spikes, explicit performance budgets and tests that keep agent-written code reliable.

Claude Code app developmentnative Mac appAI coding workflowSwift app developmentClaude Code best practices
Claude Code App Development: A Practical Mac Workflow

How to Build a Native Mac App with Claude Code Without Losing Control

A coding agent can crank out a lot of a native Mac app. But that doesn't mean you can skip planning and just hope the code "works out" from a long prompt. The hard parts are still the hard parts: choosing what to build, stress-testing assumptions that could kill the product, keeping performance under control, and watching out for macOS behavior that looks similar on paper but behaves differently in the wild.

Stat Space, a native menu bar system monitor for Apple Silicon, went from its first commit to version 1.0 in three days. Out of 143 repository commits, 137 had a Claude Code co-author attribution. This wasn't a simple CRUD app either - it pulled together AppKit, Core Graphics, a SwiftUI popover, private frameworks loaded at runtime, plus a CLI and an MCP server. The speed came from giving the agent a bounded place to work, not from some magic prompt that magically makes good engineering decisions.

This approach is useful if you're building with an AI coding agent and you want to move quickly without giving up engineering judgment. The trick is to make decisions explicit before implementation, test the risky assumptions in isolation, and turn the quality requirements you care about into checks that can actually fail the build.

Why did a three-day build need a six-week plan?

The initial build plan estimated six weeks for the core product, and about ten weeks for the full launch scope. Version 1.0 shipped on day three. It's tempting to read that as proof that planning is pointless. I don't buy that. The planning and setup made it possible to use an agent productively - the calendar estimate just stopped matching how fast implementation could happen once the "what" and "why" were already clear.

Stat Space monitors system activity from the macOS menu bar. It groups processes into apps, tracks metrics, traces listening ports to projects, and includes a CLI and MCP server. Some features relied on private frameworks, and the app had a strict idle-resource target. Those aren't trivia: they change what a wrong assumption costs you. A normal UI bug is one kind of problem. A feature that can't reliably attribute network activity to individual processes is a product-definition problem.

Speed is not the same as certainty

Claude Code wrote most of the implementation, but it didn't decide things like whether per-app network monitoring should exist, how much CPU it could consume, or which process-kill actions were actually safe. Those are product and risk decisions, not "style choices." An agent can implement a choice quickly - but it can't take responsibility for the choice in a way the owner can stand behind.

A better metric than "how many lines per hour did the agent generate?" is "how fast can the team move from an uncertain requirement to a tested decision without creating a pile of extra review work later?" In this project, the team provided context docs, used small probes to check feasibility, and ran a benchmark so the performance promise was measurable, not vibes-based.

Treat the agent as a fast contributor, not a substitute for a system

An agent works across sessions, but it doesn't automatically carry forward every decision unless the repo gives it a durable source of truth. Otherwise it'll fill in gaps with whatever pattern it has seen before - even if that conflicts with what the product actually needs, like pulling in a familiar third-party package, adding a timer for every metric, or using SwiftUI in places where the architecture really calls for something else.

So you build the work around repeatable handoffs. The agent should be able to find the scope, constraints, existing decisions, and ways to verify its changes without you restating everything every time. That's what turns "fast code generation" into an actual development process you can keep.

What should you write before asking an agent to code?

Before adding a Swift file, the project had a specification, a design document, and an interactive reference mock. They served different purposes. The spec covered scope, pricing tiers, the architecture, data sources for each metric, risks, open questions, and even a week-by-week plan. The design doc recorded the chosen direction for the popover. The mock showed the interface with enough detail to make visual expectations concrete.

Yes, you can describe a dark sidebar and a compact popover in a paragraph. But you'll still leave room for different interpretations of spacing, hierarchy, and interaction. A reference mock reduces that ambiguity. Just don't let it be confused for a "copy this web UI" artifact - label it clearly as a reference for a native build.

Keep decisions separate from unresolved questions

The spec included a dated Decided section. When a scope or design question got settled, the decision and the date went there. That was more useful than treating the original plan as fixed, because the build changed quickly - and the decision log made it possible for later sessions to see why the project went in a particular direction.

For agent-assisted work, I'd treat your spec as having at least three states:

  • Decided: an owner has made the call, and implementation should follow it.
  • Open: the question still needs investigation or a human decision.
  • Out of scope: a tempting adjacent feature that you don't add as part of this change.

This separation prevents a common failure mode: an agent mistaking an open question for permission to choose a direction, then building more code around that assumption.

Make the handover file operational

The project used AGENTS.md as its handover document, with CLAUDE.md pointing to it. It spelled out what to read and in what order, then listed the constraints that mattered across sessions. Examples included Swift 6 strict concurrency, pull-based samplers, no Combine, limited dependencies, and rules for when samplers should run.

It also defined safety boundaries. Process-kill actions were restricted to development-tool processes parented to launchd, and they always required confirmation. Private frameworks had to be loaded at runtime, and the feature had to be hidden if loading failed. Those aren't aesthetic preferences. They affect user trust and how the app behaves when macOS doesn't match your assumptions.

When scope changed, the instruction was to update the spec as part of the same change. That small rule keeps the handover from becoming stale. A doc that no longer matches the codebase is worse than no doc at all, because it gives the next session a false sense of confidence.

How do spikes reduce product and technical risk?

This project didn't start with the full app shell. It started with four standalone spikes - each one meant to test an assumption that could change the product. A spike isn't a miniature version of the finished feature. It's a deliberately small experiment that answers a specific question at low cost.

The first spike checked whether the private NetworkStatistics framework could attribute network activity to the correct process IDs. That capability underpinned a major Pro feature, so if it failed, the product plan would have changed. Another spike checked whether helper processes, XPC services, and Electron renderers could be folded into their parent apps. A third tested whether listening ports could be connected to a project folder and launcher without root access. The fourth measured whether the sampling design could fit the idle CPU and memory budget.

Give each spike a falsifiable result

Each probe produced structured output, including an explicit pass or fail line. For example, the network spike generated known traffic for about 20 seconds and reported whether the activity was attributed to the expected processes. The ports spike started two local Python HTTP servers - one on loopback and one exposed on the local network - then checked whether both were found with the right project and exposure information.

That output matters because when an agent writes the probe, the model may otherwise summarize its own implementation as "successful" even when the underlying behavior is unclear. A testable result makes the evidence visible to both the agent and the developer.

A spike should answer a question in a form like:

  1. What assumption could change the product or architecture?
  2. What's the smallest experiment that tests it?
  3. What observable result counts as a pass?
  4. What decision will the owner make if it fails?

That last part is important. In this case, the spec said that if per-app network attribution failed, the Pro feature set would be reshaped. The agent could provide evidence, but the product decision stayed with the owner.

Keep useful probes after the first decision

The spikes stayed in the repo and could be rerun. That paid off later when identifying which app produced a sound led to another small probe. It uncovered a macOS behavior difference: one Core Audio property listener didn't fire as expected on macOS 26, while another did. The result also helped explain a stale playing state in the app.

A short probe is often a better diagnostic tool than digging through the finished UI. If an operating-system API, private framework, or process relationship is uncertain, isolate it first. The trade-off is that spikes take time and may require maintenance. They're worth keeping when they test something recurring or release-critical; once you've captured the result and the decision is settled, a one-off experiment can be removed.

How do you make an agent respect performance and quality budgets?

Stat Space's promise included staying light while idle. The target was below 0.3% CPU and 25 MB of memory on an M1 Mac, with the popover closed and sampling at one-second intervals. A monitor that shows up among the system's top CPU consumers undermines the whole reason to install it. So the requirement was enforced by a benchmark, not left as a reminder in a handover file.

The benchmark ran the app from the outside, sampled process resource usage once per second, and exited with a failure code if mean CPU or peak memory exceeded the configured limit. It converted CPU time from Mach ticks using system timebase information - treating those fields as nanoseconds would yield incorrect measurements. A benchmark launch script started the app in a dedicated mode, waited for startup, measured it, and produced a per-sampler cost report when the process received SIGTERM.

Make failures actionable, not merely red

A failed gate is only useful if it helps you figure out why. The per-sampler cost table helped identify where the work was happening, so the next change could target the real source of cost instead of turning into a broad "optimize everything" rewrite.

The team also adjusted the sampling design. With the popover closed, process sampling moved into a lighter mode: it read usage only for the developer's own command-line processes, with a full pass every 30 seconds. That's a real product trade-off - lower background cost in exchange for less detailed data while the interface isn't visible. The design worked because "idle behavior" was treated as a product requirement, not an implementation detail you hope works out.

Be careful that your budget measures what users actually experience. The first memory gate used raw resident set size, including shared AppKit and SwiftUI framework pages. That made the target unrealistic for an AppKit app. The project switched to phys_footprint, which better matched what Activity Monitor reports, and it recorded that decision. A strict threshold isn't valuable by default - you need it to measure the right quantity.

Design CI around the noise you actually have

The initial CPU gate was too sensitive for shared GitHub macOS runners. The same commit measured 0.26% CPU in one run and 0.81% in another. So the project used a looser 0.6% threshold on noisy CI to catch large regressions, while reserving the 0.3% target for M1 hardware. Because macOS runner minutes were expensive, the full macOS benchmark became a manual release check rather than a job on every push.

It's not as "clean" as a perfectly stable gate, but it's more honest. If your benchmark is flaky, developers learn to ignore failures. For each quality check, decide what it's meant to catch, how noisy the environment is, and whether the run cost is justified. Linux CI still built and tested the Swift package on every push, while platform-specific performance testing ran where the measurements were actually meaningful.

What should the human still own?

Claude Code wrote most of the code, but the developer's job didn't vanish. It shifted toward specification, review, testing, and judgment. The owner read diffs closely when changes touched process termination, Keychain access, or the sampling path - areas where security, user safety, and performance consequences deserve more scrutiny than routine presentation tweaks.

The daily-use loop mattered too. Tests cover the cases someone thought to encode; running the app exposes awkward behavior and missing cases. When a bug was fixed, the developer insisted on adding a test. That test helps prevent the same problem from popping back up in a later session after the original context is gone.

Review by consequence, not by file count

Not every generated change needs the same level of review. A practical approach is to start with changes that can cause irreversible or user-visible harm, then inspect architecture and resource use, and finally look at routine implementation details. For this app, process-kill logic always required confirmation, and that safeguard mattered when an optimization caused the app to misread whether a coding-agent process was still active.

In one case, the lite sampling mode skipped some processes inside app bundles while the popover was closed. Since Claude Code could run inside the Claude desktop app, the Agents tab interpreted missing process information as a finished session and offered to clean up its MCP servers. No processes were killed because confirmation was mandatory. The fix was to use the full process table for liveness checks, while keeping the lighter mode for other sampling work.

This is why you want safety constraints enforced in code whenever possible. The mistaken process interpretation still happened, but a separate confirmation rule kept it from turning into destructive behavior.

Keep the development loop small enough to understand

The repo included 282 test functions across resolvers, app grouping, process rules, IPC, the CLI, the MCP server, alerts, and history. Swift 6 strict concurrency caught additional errors. Linux CI ran swift build and swift test in a Swift 6.1 container, though it couldn't replace macOS-specific testing.

Early commit history was less disciplined: large batches of work-in-progress changes landed before CI was green. It worked, but it made review harder. Smaller, buildable steps would have isolated failures better and reduced the amount of generated code a human had to inspect at once.

Key takeaways

  • Put scope, design references, and non-negotiable constraints in the repo before implementation.
  • Use spikes for assumptions that could change the product, and define pass/fail criteria up front.
  • Make important budgets executable, but verify that the metric and test environment are representative.
  • Review changes by their consequences, and keep human ownership of product and safety decisions.
  • Require a regression test when a fix addresses a bug that's likely to come back in a later session.

Conclusion

The useful lesson from Stat Space isn't that a native Mac app can always be built in three days. The lesson is that an agent can accelerate implementation when your surrounding engineering system makes expectations and failure visible. A written spec carries decisions forward. Spikes surface expensive assumptions early. Benchmarks turn performance requirements into an enforceable boundary.

Start with the uncertainty that could change your product the most. Write down the decision, test it with the smallest credible experiment, and only then build around the result. Keep the agent focused on implementation speed; keep human judgment responsible for what the product should do - and what risks it's allowed to take.

Frequently Asked Questions

Yes. In this project, Claude Code wrote most of a native macOS system monitor using AppKit, Core Graphics, SwiftUI within a popover, private frameworks, a CLI and an MCP server. The result depended on detailed project context, executable checks and human review, not on the agent working without constraints.
Start with a spec that records scope, architecture, data sources, risks and unresolved questions. Add a design reference for visual work and a handover file that states repository conventions, constraints and verification steps. Keep a dated decision log so later sessions can distinguish settled choices from open questions.
A spike is a small, isolated experiment that tests a risky technical or product assumption before you build the full feature. Give it a measurable result and a decision that follows from either outcome. This makes the evidence easier to review than an agent’s narrative that a feature should work.
Only when the measurements are stable enough to be useful and the cost is acceptable. Shared macOS runners produced noisy CPU readings in this project, so the strict target ran on M1 hardware before releases, while CI used a looser threshold to catch major regressions. A flaky gate will eventually be ignored.
Developers should own product scope, safety boundaries, important trade-offs and final acceptance. They should also review high-consequence diffs, run the app in real use and insist on regression tests for meaningful fixes. An agent can implement a decision quickly, but responsibility for that decision remains with the project owner.

Related articles