Agent skill

Osx Tuning

by dimetron in dimetron/pi-go

Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs.

MITAuto-check: notesDevOps & Cloud

Install Osx Tuning

skills CLI
$ npx skills add dimetron/pi-go --skill osx-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dimetron/pi-go osx-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dimetron/pi-go.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/extension/bundled_skills/osx-tuning .claude/skills/osx-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
osx-tuning
GitHub stars
209
Token cost
~1.6k tokens
SKILL.md length
475 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs.

  • Works in 3 steps: launchd maxfiles (system-wide) → Per-shell ulimit (interactive shells) → Boot-time sysctls
  • The user asks to tune macOS
  • SKILL.md covers Why the defaults are low, The three layers, 1. launchd maxfiles… and 2. Per-shell ulimit…, plus 4 more sections
  • Reaches apple.com

What it does

Osx Tuning is an agent skill from dimetron/pi-go. Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs. Use this skill whenever the user asks to "tune macOS", "raise file descriptor limits", "fix ulimit", "optimize for Docker/Go/VM performance", "increase maxfiles/maxproc/somaxconn", or reports EMFILE/too-many-open-files, connection refused under load, or slow container/VM networking. Covers the full chain: launchd maxfiles, per-shell ulimit, and boot-time sysctl tuning via LaunchDaemons, with…

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Containers. It works with Docker, macOS and Linux. The repository describes itself as: Go implementation of AI coding agent. The licence is MIT.

When your agent uses it

  • The user asks to tune macOS
  • Raise file descriptor limits
  • Optimize for Docker/Go/VM performance
  • Increase maxfiles/maxproc/somaxconn

Example prompts

  • “tune macOS”
  • “raise file descriptor limits”
  • “fix ulimit”
  • “/osx-tuning”

Requirements

  • Docker

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. launchd maxfiles (system-wide)
  2. Per-shell ulimit (interactive shells)
  3. Boot-time sysctls

What it can do on your machine

Read from SKILL.md and the folder at commit c4c83e6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and xml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • apple.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Osx Tuning loads about 1.6k tokens when it runs. Until then it costs about 137 tokens; SKILL.md has 475 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~137
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:67
    sudo cp /tmp/limit.maxfiles.plist /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:68
    sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:69
    sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:70
    sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:140
    sudo launchctl list | grep -iE "sysctl|maxfiles"   # both loaded, exit 0
  • NoteRuns commands with sudoSKILL.md:146
    sudo launchctl unload -w /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:147
    sudo rm /Library/LaunchDaemons/limit.maxfiles.plist
  • NoteRuns commands with sudoSKILL.md:148
    sudo launchctl unload -w /Library/LaunchDaemons/com.local.sysctl.plist
  • NoteRuns commands with sudoSKILL.md:149
    sudo rm /Library/LaunchDaemons/com.local.sysctl.plist

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dimetron/pi-go at commit c4c83e6, republished under its MIT licence (© dimetron). 475 words, ~1,633 tokens.

Download SKILL.mdSave it as .claude/skills/osx-tuning/SKILL.md (or your agent's skills folder).
name
osx-tuning
description
Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs. Use this skill whenever the user asks to "tune macOS", "raise file descriptor limits", "fix ulimit", "optimize for Docker/Go/VM performance", "increase maxfiles/maxproc/somaxconn", or reports EMFILE/too-many-open-files, connection refused under load, or slow container/VM networking. Covers the full chain: launchd maxfiles, per-shell ulimit, and boot-time sysctl tuning via LaunchDaemons, with verification and revert steps.

macOS Performance Tuning (Go / Docker / Linux VMs)

Raise macOS resource limits and tune TCP sysctls for heavy local development: Go servers, Docker/OrbStack containers, and Linux VMs. Everything here is reversible and verified.

Why the defaults are low

macOS ships conservative soft limits. The two that bite developers:

  • maxfiles soft limit = 256 — set by launchd for every process. Go's net/http servers, Docker, and build tools open far more than 256 file descriptors. Hitting it surfaces as EMFILE: too many open files or socket: too many open files.
  • kern.ipc.somaxconn = 128 — max pending TCP connections per listen socket. Go servers and the Docker API socket queue up behind this under load.

The hard limits are already unlimited/high, so nothing is truly capped — the soft values just need raising.

The three layers

Tuning must happen at three levels because each only affects a subset of processes:

LayerAffectsMechanism
launchd maxfilesall new processesLaunchDaemon plist
per-shell ulimitinteractive shells~/.zshrc
sysctlskernel-wide, all processesLaunchDaemon plist

1. launchd maxfiles (system-wide)

Create /Library/LaunchDaemons/limit.maxfiles.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>65536</string>
      <string>unlimited</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>

Install and load:

bash
sudo cp /tmp/limit.maxfiles.plist /Library/LaunchDaemons/limit.maxfiles.plist
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

Verify:

bash
launchctl limit maxfiles   # expect: maxfiles 65536 unlimited

2. Per-shell ulimit (interactive shells)

The launchd change only affects newly launched processes. Already-open shells keep their old soft limit, so add a line to ~/.zshrc:

zsh
# Raise open file descriptor soft limit (hard limit is unlimited)
ulimit -n 65536

Takes effect in new shells, or source ~/.zshrc in open ones.

3. Boot-time sysctls

macOS does not reliably honor /etc/sysctl.conf on modern versions. Use a LaunchDaemon that runs sysctl -w at boot.

Create /Library/LaunchDaemons/com.local.sysctl.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.local.sysctl</string>
    <key>ProgramArguments</key>
    <array>
      <string>/bin/sh</string>
      <string>-c</string>
      <string>sysctl -w kern.maxprocperuid=4000 kern.ipc.somaxconn=1024 net.inet.tcp.sendspace=262144 net.inet.tcp.recvspace=262144 net.inet.tcp.win_scale_factor=5 net.inet.tcp.mssdflt=1460</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>

Install and load (same pattern as above, target com.local.sysctl.plist).

Show full SKILL.md (233 more words)Show less
What each sysctl does
sysctlDefaultTunedWhy
kern.maxprocperuid26664000Max processes per user. Go goroutines, Docker/VM threads, build workers all count. 2666 is low for heavy dev.
kern.ipc.somaxconn1281024Max pending TCP connections per listen socket. Go net/http and the Docker API socket hit this under load.
net.inet.tcp.sendspace131072262144Larger TCP send buffer — better throughput for Go servers and VM/container networking.
net.inet.tcp.recvspace131072262144Larger receive buffer, same reason.
net.inet.tcp.win_scale_factor35Enables larger TCP window scaling — matters for high-bandwidth transfers (Docker pulls, VM traffic).
net.inet.tcp.mssdflt5121460Default MSS. 512 is the conservative fallback; 1460 matches Ethernet MTU 1500, reducing packet overhead.

Verification

bash
launchctl limit maxfiles          # maxfiles 65536 unlimited
ulimit -n                          # 65536 in a new shell
sysctl kern.maxprocperuid kern.ipc.somaxconn \
       net.inet.tcp.sendspace net.inet.tcp.recvspace \
       net.inet.tcp.win_scale_factor net.inet.tcp.mssdflt
sudo launchctl list | grep -iE "sysctl|maxfiles"   # both loaded, exit 0

Reverting

bash
sudo launchctl unload -w /Library/LaunchDaemons/limit.maxfiles.plist
sudo rm /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.local.sysctl.plist
sudo rm /Library/LaunchDaemons/com.local.sysctl.plist
# remove the ulimit line from ~/.zshrc

Notes / caveats

  • kern.maxproc (4000) and kern.maxfiles (2147483647) are already at their caps — no change needed.
  • net.inet.ip.forwarding should stay 0 unless you're building a router.
  • vm.overcommit is not a macOS knob; memory is managed by the VM/compressor. High swap usage is normal compressed-memory behavior, not a leak.
  • Docker/OrbStack VM CPU/RAM is configured in OrbStack's settings GUI, not via sysctl — that's where you bump resources for the Linux VM itself.
  • win_scale_factor and mssdflt are the most opinionated changes. Safe on a modern network, but revert those first if you ever see odd TCP behavior.
  • sudo is required for the LaunchDaemon installs and sysctl -w. The sandbox blocks localhost listeners and some privileged ops — run these outside a sandbox if a step fails with a permission error.

© dimetron, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/extension/bundled_skills/osx-tuning of dimetron/pi-go.

Open the folder on GitHubat commit c4c83e6

Compare with similar skills

Osx Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Osx Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Osx Tuning this skilldimetron/pi-go209—~1.6kAutomated safety check: NotesMIT
.NET Crash Dump Collectiondotnet/skills5.6k2 repos~1.1kAutomated safety check: PassMIT
Agentdock User Guideuvwt/agentdock1.2k—~1.6kAutomated safety check: PassApache-2.0
Setup Review Sandboxnrwl/nx29k—~1.8kAutomated safety check: NotesMIT
Reproduce Issuenrwl/nx29k—~2.6kAutomated safety check: NotesMIT
Docker Patternsaffaan-m/ECC276k1 repos~3.7kAutomated safety check: NotesMIT

Similar skills

  • Official

    Configures automatic crash dumps or captures dumps from running processes for modern .NET apps on Linux, macOS and Windows, including Docker and Kubernetes.

    5.6k GitHub starsUsed in 2 repos~1.1k tokens
    DevOps & CloudAuto-check passed
  • Agentdock User Guide

    uvwt/agentdock

    当用户询问 AgentDock 是什么、如何使用、配置在哪里、不同平台或安装方式怎样修改配置并生效、如何重启或验证配置、如何发现并配置 Codex/Claude/Grok 等 Coding Agent 的 ACP,以及常见运行问题时使用;覆盖 macOS Desktop、Windows Desktop、Linux 服务、Docker 和直接运行二进制,不用于源码开发与贡献流程。

    1.2k GitHub stars~1.6k tokensUpdated today
    DevOps & CloudAuto-check passed
  • One-time setup of the sandbox prerequisites used by the reproduce-issue skill and the reproduce-verifier agent — Docker, the isolation runtime (gVisor on Linux / Colima on macOS), healthy container…

    29k GitHub stars~1.8k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • The single skill for reproducing an nx issue. An agent skill from nrwl/nx.

    29k GitHub stars~2.6k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Docker Patterns

    affaan-m/ECC

    Docker and Docker Compose patterns for local development, hardened CLI installer harnesses, container security, networking, volumes, and multi-service orchestration.

    276k GitHub starsUsed in 1 repo~3.7k tokens
    DevOps & CloudAuto-check: notes
  • CI Adhoc Test

    nubjs/nub

    Run ad-hoc / exploratory tests on a real OS or platform via CI when the behavior CANNOT be reproduced on the local host or in Docker — macOS Seatbelt / sandbox-exec / codesigning, Windows cmd.exe /…

    4.4k GitHub stars~1.7k tokensUpdated today
    DevOps & CloudAuto-check passed

More from dimetron/pi-go

All 21 skills in this repo
  • Vhs E2E Gif

    dimetron/pi-go

    Record a test run, a TUI session, or any terminal command as a GIF with VHS and attach it to a GitHub PR as a release-hosted asset, never a repo commit.

    209 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Agents Md

    dimetron/pi-go

    Generate AGENTS.md files for Go, Rust, TypeScript, and Java projects.

    209 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Bubbletea Testing

    dimetron/pi-go

    A skill your agent uses whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go.

    209 GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • Memory Index

    dimetron/pi-go

    Index a folder's contents into the MemPalace semantic memory for search and retrieval.

    209 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Nightly Session Watch

    dimetron/pi-go

    Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still…

    209 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Pgo

    dimetron/pi-go

    Profile-guided optimization (PGO) for the pi binary. An agent skill from dimetron/pi-go.

    209 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Osx Tuning

What does Osx Tuning do?

Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs. Osx Tuning is an agent skill from dimetron/pi-go. Tune macOS resource limits and sysctls for best performance with Go development, Docker/OrbStack, and Linux VMs.

When should I use Osx Tuning?

Osx Tuning fits situations like: the user asks to tune macOS; raise file descriptor limits; optimize for Docker/Go/VM performance; increase maxfiles/maxproc/somaxconn.

How do I install Osx Tuning in Claude Code?

Run `npx skills add dimetron/pi-go --skill osx-tuning -a claude-code`. Or copy the skill folder (internal/extension/bundled_skills/osx-tuning in dimetron/pi-go) into .claude/skills/osx-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Osx Tuning in Codex?

Run `npx skills add dimetron/pi-go --skill osx-tuning -a codex`. Or copy the skill folder (internal/extension/bundled_skills/osx-tuning in dimetron/pi-go) into .agents/skills/osx-tuning in your project. Codex loads it when a task matches its description.

Can I use Osx Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dimetron/pi-go --skill osx-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/osx-tuning, .gemini/skills/osx-tuning, .github/skills/osx-tuning and .opencode/skills/osx-tuning in your project.

What does Osx Tuning need to run?

SKILL.md names no scripts, command-line tools or credentials: Osx Tuning is instructions for the agent only. Our summary lists: Docker.

Does Osx Tuning access the network?

SKILL.md names 1 domain. In commands or code: apple.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Osx Tuning safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Osx Tuning use?

Osx Tuning is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Osx Tuning use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Osx Tuning?

Skills that share tags, products or a category with Osx Tuning: .NET Crash Dump Collection (dotnet/skills, 5.6k stars), Agentdock User Guide (uvwt/agentdock, 1.2k stars), Setup Review Sandbox (nrwl/nx, 29k stars) and Reproduce Issue (nrwl/nx, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Osx Tuning?

dimetron (a GitHub user) maintains it in dimetron/pi-go, which has 209 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 9, 2026.

Source: dimetron/pi-go on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.