Agent skill

Persistent Localhost

by davidondrej in davidondrej/skills

Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.

MITAuto-check passed

Install Persistent Localhost

skills CLI
$ npx skills add davidondrej/skills --skill persistent-localhost -a claude-code

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

GitHub CLI
$ gh skill install davidondrej/skills persistent-localhost --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/davidondrej/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ops-and-setup/persistent-localhost .claude/skills/persistent-localhost && 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
persistent-localhost
GitHub stars
4.1k
Token cost
~618 tokens
SKILL.md length
247 words
Files
2 (incl. scripts)
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.

  • Works in 2 steps: Check what already exists → Start the server. --name is the handle.…
  • Troubleshooting local servers that should survive shell exit and restart after crashes
  • SKILL.md covers Workflow, Hot reload, Rules the script enforces and Fallback
  • Runs Shell scripts from its folder; calls uvicorn, node and brew

What it does

Persistent Localhost is an agent skill from davidondrej/skills. Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents. Use when starting, stopping, restarting, inspecting, or troubleshooting local servers that should survive shell exit and restart after crashes.

Its SKILL.md is about 620 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/persistent-localhost.sh`).

It works with macOS. The repository describes itself as: access to david ondrej's personal agent skills. The licence is MIT.

When your agent uses it

  • Troubleshooting local servers that should survive shell exit and restart after crashes

Example prompts

  • “/persistent-localhost”

Requirements

  • A Bash shell

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Check what already exists
  2. Start the server. --name is the handle. --port enables readiness checks and duplicate handling. --dir defaults to the current directory.

What it can do on your machine

Read from SKILL.md and the folder at commit ba8e24c. 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

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • uvicorn
    • node
    • brew

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

  • Network

    No URLs in SKILL.md.

    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

Persistent Localhost loads about 618 tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 247 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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); the scripts in this folder are not scanned.

SKILL.md

The full file from davidondrej/skills at commit ba8e24c, republished under its MIT licence (© davidondrej). 247 words, ~618 tokens.

Download SKILL.mdSave it as .claude/skills/persistent-localhost/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
persistent-localhost
description
Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents. Use when starting, stopping, restarting, inspecting, or troubleshooting local servers that should survive shell exit and restart after crashes.

Persistent localhost servers (macOS launchd)

One script does everything. Resolve scripts/persistent-localhost.sh relative to this SKILL.md, never from the current directory.

Workflow

  1. Check what already exists:
bash
scripts/persistent-localhost.sh list
  1. Start the server. --name is the handle. --port enables readiness checks and duplicate handling. --dir defaults to the current directory.
bash
scripts/persistent-localhost.sh start --name myproj --port 5111 --cmd "./bin/serve"

The command returns only after the port is listening, or fails with the last 20 log lines. Report the printed URL= to the user.

  1. Inspect, restart, read logs, stop:
bash
scripts/persistent-localhost.sh status myproj
scripts/persistent-localhost.sh restart myproj   # after editing code that has no reloader
scripts/persistent-localhost.sh logs myproj 100
scripts/persistent-localhost.sh stop myproj

Hot reload

Prefer the framework's own reloader in --cmd (flask run --debug, vite, uvicorn --reload, node --watch). If the server has none, add --watch. It wraps the command in watchexec -r on the working directory. Never use both. Requires brew install watchexec.

Rules the script enforces

  • Runs as com.persistent-localhost.<name> in the user gui domain via launchctl bootstrap. Restart uses kickstart -kp, stop uses bootout. No deprecated load, start, stop, no broad pkill.
  • KeepAlive only on crash. A clean exit stays down. Throttle 5s so a syntax error cannot spin.
  • Port already taken by the same app (our own label, or a stray process with the same working directory) is replaced. A different app is left alone and the next free port is used. Read the printed PORT=.
  • The caller's PATH and a PORT variable are passed into the job. Add more with --env KEY=VAL.
  • Logs: ~/Library/Logs/persistent-localhost/<name>.log. State: ~/Library/Application Support/persistent-localhost/<name>.state. Plist: ~/Library/LaunchAgents/.

Fallback

Never start servers with nohup, &, disown, setsid, or run_in_background. If launchctl bootstrap fails, report the failure and stop.

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

Files

SKILL.md and 1 other file (scripts) in skills/ops-and-setup/persistent-localhost of davidondrej/skills.

  • SKILL.md
  • scripts/persistent-localhost.sh

Open the folder on GitHubat commit ba8e24c

Compare with similar skills

Persistent Localhost 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.

Persistent Localhost compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Persistent Localhost this skilldavidondrej/skills4.1k—~618Automated safety check: PassMIT
Site ArchitectureAvdLee/RocketSimApp80311 repos~3.3kAutomated safety check: PassCustom licence
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
Openclaw Live Updateropenclaw/openclaw392k—~3.7kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca87k1 repos~584Automated safety check: PassApache-2.0

Similar skills

  • Site Architecture

    AvdLee/RocketSimApp

    When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking.

    803 GitHub starsUsed in 11 repos~3.3k tokens
    Marketing & SEOAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    87k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed

More from davidondrej/skills

All 51 skills in this repo
  • Nagent

    davidondrej/skills

    Launch a new bb worker thread with the right project, model, worktree, and task brief.

    4.1k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check: notes
  • Browser Harness

    davidondrej/skills

    Direct browser control via CDP. An agent skill from davidondrej/skills.

    4.1k GitHub starsUsed in 2 repos~3k tokens
    Auto-check passed
  • Reset Cursor Acp

    davidondrej/skills

    Reset a stuck Cursor ACP thread in <chat-system and reload its configuration.

    4.1k GitHub stars~728 tokensUpdated yesterday
    Auto-check passed
  • Anti Sleep

    davidondrej/skills

    Keep a Mac awake for a set duration or while a process runs.

    4.1k GitHub stars~640 tokensUpdated yesterday
    Auto-check: warnings
  • Bb CLI

    davidondrej/skills

    Use this when controlling bb. An agent skill from davidondrej/skills.

    4.1k GitHub stars~823 tokensUpdated yesterday
    Auto-check passed
  • Boat

    davidondrej/skills

    Manage Boat (boat.dev, formerly Box by Ascii) cloud sandboxes via API, CLI, and SSH.

    4.1k GitHub stars~2k tokensUpdated yesterday
    Auto-check: notes

Works with

Questions about Persistent Localhost

What does Persistent Localhost do?

Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents. Persistent Localhost is an agent skill from davidondrej/skills. Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.

When should I use Persistent Localhost?

Persistent Localhost fits situations like: troubleshooting local servers that should survive shell exit and restart after crashes.

How do I install Persistent Localhost in Claude Code?

Run `npx skills add davidondrej/skills --skill persistent-localhost -a claude-code`. Or copy the skill folder (skills/ops-and-setup/persistent-localhost in davidondrej/skills) into .claude/skills/persistent-localhost in your project. Claude Code loads it when a task matches its description.

How do I install Persistent Localhost in Codex?

Run `npx skills add davidondrej/skills --skill persistent-localhost -a codex`. Or copy the skill folder (skills/ops-and-setup/persistent-localhost in davidondrej/skills) into .agents/skills/persistent-localhost in your project. Codex loads it when a task matches its description.

Can I use Persistent Localhost 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 davidondrej/skills --skill persistent-localhost -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/persistent-localhost, .gemini/skills/persistent-localhost, .github/skills/persistent-localhost and .opencode/skills/persistent-localhost in your project.

What does Persistent Localhost need to run?

Going by SKILL.md and its folder, Persistent Localhost needs a shell for the scripts in its folder and the command-line tools its instructions call (uvicorn, node and brew). Our summary lists: A Bash shell.

Does Persistent Localhost access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Persistent Localhost safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Persistent Localhost use?

Persistent Localhost 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 Persistent Localhost use?

About 618 tokens (SKILL.md is roughly 2.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 Persistent Localhost?

Skills that share tags, products or a category with Persistent Localhost: Site Architecture (AvdLee/RocketSimApp, 803 stars), Engine Whats New (flutter/flutter, 179k stars), macOS Spm App Packaging (Dimillian/Skills, 4k stars) and Openclaw Live Updater (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Persistent Localhost?

davidondrej (a GitHub user) maintains it in davidondrej/skills, which has 4,107 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 7, 2026.

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