/byteforge-claude-skills:codync-tailscale-hostfrom byteforge-claude-skills
Install a Codync host (persistent coding-agent bots driven from a phone or desktop app) on Linux or macOS so it is reachable ONLY over the user's Tailscale tailnet, with the Codync cloud relay off, pinned to host v2.53.0 with automatic updates off (2.54.0+ move bots out of their project folders), and chosen environment variables (agent auth tokens etc.) passed into the background service. Use when the user asks to install, set up, harden or replicate a Codync host, make Codync tailnet-only, turn off the Codync cloud relay, fix bots that can't see env vars or tokens under the codync-host service, or roll a host on 2.54.0+ back to 2.53.0 and return its bots to their project folders.
Ships in byteforge-claude-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Codync (Apache-2.0) runs coding agents (Claude Code, Codex, Gemini CLI, …) as persistent bots on a computer and lets paired phones and desktops drive them. This skill takes a machine to a Codync host that:
It supports Linux (systemd --user unit codync-host.service) and
macOS (launchd LaunchAgent com.pokai.codync.host). Installing Tailscale
itself is out of scope: it must already be up.
Upstream behaviour below was read from the Codync source (host 2.5x). Where a step depends on a version detail, the skill says how to check it on the machine rather than trusting this text.
Host 2.54.0 adds a one-time startup migration
(host/src/hub/projects/migrate.rs). It moves every bot that works in a
project folder into its own ~/.codync/bots/<id>/workspace, keeps the original
folder only as the bot's first "project", moves the bot's uploads, adds a
folder to its routines and clears its main sessions. It also raises the
database schema from 9 to 14. That breaks bots that are meant to work directly
in a repo, so this skill installs v2.53.0, the last release before the
change, and turns automatic updates off. Don't move a host to 2.54.0 or later
unless the user has decided they want the new layout. A host that already
upgraded can go back: see Rollback from 2.54.0+.
| Placeholder | Meaning | Default |
|---|---|---|
{PORT} | host port | 19222 |
{TAILSCALE_INTERFACE} | Linux Tailscale interface | tailscale0 |
{ENV_NAME} | short name for the env file | agents |
{ENV_FILE} | private env file | ~/.config/codync-host/{ENV_NAME}.env |
{VAR_NAME} | each variable the user chooses to pass in | — |
{VERSION} | pinned Codync release tag | v2.53.0 (not 2.54.0+; see above) |
{TAILNET_HOSTNAME} | this machine's MagicDNS name or 100.x address | from tailscale status |
{LAN_OR_PUBLIC_IP} | an address of this machine outside the tailnet | — |
0600 files; verify by printing variable names only.sudo (firewall, linger) are run by the user if Claude has no
sudo; give them one command at a time.codync-host install starts it immediately, so the network lockdown (Step 4)
comes before the install (Step 6).{PORT} = 19222; change only if taken.{VAR_NAME} values; never ask for the values in chat.{VERSION} = v2.53.0, and don't suggest
"latest": 2.54.0 and later move bots out of their project folders (see
Why v2.53.0). Install a newer
release only if the user explicitly wants that layout. Step 8 keeps the
host from upgrading itself.codync-host analytics off.uname -s # Linux or Darwin
tailscale status | head -5 # must show this machine online
command -v node npx # Claude Code, Codex and Pi run through npx
echo "$PATH" | tr ':' '\n' | grep -x "$HOME/.local/bin" # binaries land here
~/.local/bin on PATH: add it to the shell rc. The service captures
the PATH of the shell that runs codync-host install, so make sure that
shell's PATH finds npx, node, claude, codex, … before Step 6.codync-host status shows installed, running,
port, bind. Skip to the first step whose state is wrong.Don't pipe an unreviewed script into sh. Download it, read it, then run the
copy you read, pinned to {VERSION} (default v2.53.0, never "latest"):
work="$(mktemp -d)"
curl -fsSL -o "$work/install.sh" https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh
less "$work/install.sh" # Claude: read it and summarize to the user
CODYNC_VERSION={VERSION} sh "$work/install.sh" --host-only
codync-host --version # must print 2.53.0 (or the {VERSION} the user chose)
Without CODYNC_VERSION the script installs the latest release, which is
2.54.0 or newer.
What the script does (verify against the copy you read):
codync-host-{os}-{arch}.tar.gz from GitHub Releases and checks it
against the published .sha256.codync-host (plus codync-screen and cua-driver on Linux) into
~/.local/bin as a non-root user, without sudo.--host-only matters on macOS too: without it the script installs
Codync.app into /Applications and opens it. Use --host-only for
servers and headless Macs; the standalone host is also what the built-in
updater (Step 8) manages.--bind accepts only 127.0.0.1 or 0.0.0.0; it refuses a tailnet IP or an
interface ("the host only binds 127.0.0.1 (this computer) or 0.0.0.0 (every
interface)"), because every local client (bots' MCP servers, status, the
updater's health check) dials 127.0.0.1. The choice is saved in
~/.codync/bind and survives updates and reinstalls.
sudo ufw status verbose
It must say Status: active and Default: deny (incoming). If ufw is inactive
or allows incoming by default, stop: binding 0.0.0.0 would expose the port.
Either fix the firewall with the user (enabling ufw on a remote machine needs
an SSH allow rule first, or you lock yourself out), or use the macOS approach
below (--bind 127.0.0.1 plus tailscale serve), which works on Linux too.
Add the allow rule, only if it isn't already there:
sudo ufw status | grep -q "{PORT}/tcp on {TAILSCALE_INTERFACE}" \
|| sudo ufw allow in on {TAILSCALE_INTERFACE} to any port {PORT} proto tcp comment 'codync-host (tailnet only)'
sudo ufw status numbered | grep {PORT}
With default-deny incoming, no explicit deny rule is needed. Docker's
published-port bypass of ufw doesn't apply: the host is a normal process, not a
container. Other firewalls (firewalld, nftables) follow the same rule: allow
{PORT}/tcp on {TAILSCALE_INTERFACE}, deny it everywhere else.
tailscale servemacOS has no ufw, its application firewall filters per app (not per port or
interface), and the Tailscale interface is utunN with a variable N. The
recommended approach keeps the host off every network interface and lets
Tailscale forward tailnet traffic to it:
--bind 127.0.0.1.tailscale serve forwarding {PORT} on the tailnet address to
localhost:{PORT}.Trade-off to tell the user: the host accepts its bearer token (the local API
token in ~/.codync/token) only from loopback, and phones never use it
(they use the end-to-end-encrypted channel with their pairing keys). Behind
tailscale serve, tailnet callers arrive from loopback, so a tailnet peer that
somehow obtained that token could use the local API. Treat the token as a full
credential, and restrict who can reach this machine's port with Tailscale ACLs
or grants. The pf-based alternative, which keeps loopback-only token use, is
in references/macos-pf.md; it needs sudo and its own
boot-time enabling, so prefer tailscale serve unless the user objects.
CODYNC_CLOUD=off)The service manager does not read ~/.bashrc, ~/.zshrc or ~/.profile.
Without this step, bots can't see the agents' tokens; the typical symptom is
the default "lead" bot failing its sign-in check at first start.
{ENV_FILE} without printing valuesRun in a shell where the chosen variables are already exported (open a new
login shell if needed). One KEY=value per line, no export, no quotes
needed:
umask 077
mkdir -p ~/.config/codync-host && chmod 700 ~/.config/codync-host
: > {ENV_FILE} && chmod 600 {ENV_FILE}
for name in {VAR_NAME} {VAR_NAME}; do # the names from Step 1 Q3
if [ -n "${!name+x}" ]; then
printf '%s=%s\n' "$name" "${!name}" >> {ENV_FILE}
else
echo "not set in this shell: $name" >&2
fi
done
cut -d= -f1 {ENV_FILE} # names only
(${!name} is bash indirection; under zsh use ${(P)name}.) Values containing
newlines can't go in an env file; give that variable another mechanism.
Re-running replaces the file (: >), so it stays idempotent.
Tell the user the values now live in two places (shell rc and
{ENV_FILE}): rotating a token means updating both and restarting the service.
codync-host install rewrites the base unit file every time, so never edit it.
Drop-ins in codync-host.service.d/ survive. Create them now, so the very
first start already has the tokens and the cloud relay off:
dropins=~/.config/systemd/user/codync-host.service.d
mkdir -p "$dropins"
printf '[Service]\nEnvironmentFile=%%h/.config/codync-host/{ENV_NAME}.env\n' > "$dropins/{ENV_NAME}.conf"
printf '[Service]\nEnvironment=CODYNC_CLOUD=off\n' > "$dropins/cloud-off.conf"
cat "$dropins"/*.conf
(%%h prints %h, systemd's home-directory specifier.) Keep one concern per
drop-in; non-secret settings use Environment= lines.
codync-host install writes the LaunchAgent plist from scratch with only
PATH and CODYNC_HOME in EnvironmentVariables, so variables must be added
after Step 6 and re-applied after every later codync-host install.
Updates through the built-in updater only swap the binary and restart the job;
they keep the plist. The commands are in Step 7.
# Linux
codync-host install --port {PORT} --bind 0.0.0.0
sudo loginctl enable-linger "$USER" # run at boot without a login
# macOS
codync-host install --port {PORT} --bind 127.0.0.1
codync-host status # installed: yes, running, port, bind
install also captures the current shell's PATH into the service. Re-run it
(Linux: drop-ins are kept; macOS: then repeat Step 7) after changing PATH or
moving the binary.
tailscale serveOn first start the host registers with the Codync cloud relay
(api.codync.dev) without asking. That's a path to the machine from outside
the tailnet. Turn it off, and keep it off:
codync-host cloud --disable
codync-host cloud # must show enabled: false
codync-host analytics off # only if the user chose it in Step 1
CODYNC_CLOUD=off in the service environment overrides the saved switch, so
it stays off even if the switch is flipped later. Linux already has it from
Step 5. On macOS, add it now with the other variables:
# macOS only. Re-run this block after every `codync-host install`.
plist=~/Library/LaunchAgents/com.pokai.codync.host.plist
plutil -replace EnvironmentVariables.CODYNC_CLOUD -string off "$plist"
while IFS= read -r line; do
[ -n "$line" ] || continue
plutil -replace "EnvironmentVariables.${line%%=*}" -string "${line#*=}" "$plist"
done < {ENV_FILE}
chmod 600 "$plist"
plutil -lint "$plist"
plutil -extract EnvironmentVariables xml1 -o - "$plist" | grep '<key>' # names only
The values are now also in the plist (kept 0600). While plutil runs, each
value is briefly visible in that process's arguments to the same machine's
process list; on a shared Mac, discuss this with the user first.
Restart so the new environment applies and connections opened before the change are dropped:
# Linux
systemctl --user daemon-reload && systemctl --user restart codync-host
# macOS
launchctl bootout "gui/$(id -u)/com.pokai.codync.host"
launchctl bootstrap "gui/$(id -u)" ~/Library/LaunchAgents/com.pokai.codync.host.plist
macOS: publish the loopback port on the tailnet (it persists across reboots):
tailscale serve --bg --tcp {PORT} tcp://localhost:{PORT}
tailscale serve status
Check tailscale serve --help first: flag spelling has changed between
Tailscale versions. On the Mac App Store build, the CLI may need to be enabled
in Tailscale's settings.
Normal outbound traffic afterwards: registry.modelcontextprotocol.io (bot
marketplace), GitHub (update checks), and occasional api.codync.dev calls.
None of it opens inbound access.
codync-host update --auto off
codync-host update --status # "Automatic updates: off"
With automatic updates on, the host would install 2.54.0 or later by itself
and run the bot-folder migration. Turning them off keeps it on {VERSION}.
--auto off is not a hard pin. Any of these still upgrades the host:
codync-host update (latest release) or
codync-host update --target <tag>,CODYNC_VERSION={VERSION}.Tell the user to leave those alone until they decide to take 2.54.0+. (The host can also be told to update by the Codync cloud when it refuses a host version; that path goes through the cloud relay, which Step 7 turns off.)
Going back down is not an update: codync-host update --target refuses any
release older than the running host. To downgrade, install the old release
over the current one with the Step 3 installer (CODYNC_VERSION=v2.53.0 sh "$work/install.sh" --host-only); see
Rollback from 2.54.0+ before doing that on a host
that already ran the migration.
codync-host status # running, port {PORT}, bind as chosen
codync-host cloud # enabled: false
codync-host update --status # "Automatic updates: off"
codync-host --version # 2.53.0 (or the {VERSION} the user chose)
Names (never values) the running service sees:
# Linux
tr '\0' '\n' < "/proc/$(systemctl --user show -p MainPID --value codync-host)/environ" | cut -d= -f1 | sort
# macOS
plutil -extract EnvironmentVariables xml1 -o - ~/Library/LaunchAgents/com.pokai.codync.host.plist | grep '<key>'
Reachability, which the user must test from other machines (a test from this machine never crosses the inbound firewall path):
nc -vz {TAILNET_HOSTNAME} {PORT} connects.nc -vz {LAN_OR_PUBLIC_IP} {PORT} must time out or be refused.codync-host install sets statusLine in
~/.claude/settings.json to codync-host statusline, which forwards Claude
usage limits to the host. An existing status line is kept and wrapped
(after statusline --command=), and codync-host uninstall restores it.
Offer to revert it now if they don't want it.~/.codync (or CODYNC_HOME) holds the computer's identity key,
the local API token, bots and SQLite transcripts. If the home directory is a
git repo or is backed up, exclude it.codync-host pair # QR code for the phone app
codync-host access # pending requests; approve with: codync-host access approve <code>
codync-host devices # list; revoke from here
The pairing link advertises the machine's Tailscale addresses (MagicDNS name
and 100.x address) first, then LAN addresses, which the firewall blocks.
{ENV_FILE}; macOS: re-run the
Step 7 plist block; then restart (Step 7).codync-host install (PATH change, moved binary): Linux needs
nothing more; macOS needs the Step 7 plist block and a restart.codync-host update --status stays off afterwards if
they want to stay on the new release.codync-host uninstall (removes the service and restores the
status line; keeps data), then remove the firewall rule
(sudo ufw delete allow in on {TAILSCALE_INTERFACE} to any port {PORT} proto tcp)
or the serve config (tailscale serve --tcp {PORT} off), delete the drop-ins
and {ENV_FILE}, the binaries in ~/.local/bin, and ~/.codync if the user
wants the data gone.For a host that already started on 2.54.0 or later and moved its bots. The
migration wrote every bot config it changed, as it was before, to
<data-dir>/backups/bot-projects-<ms>.json (<data-dir> is CODYNC_HOME, or
~/.codync). Bot configs live as JSON in the bots table of
<data-dir>/codync.db. Needs jq and sqlite3 (with JSON functions, the
default in current builds), and $work holding the installer reviewed in
Step 3 (download and review it again in a new shell). Do one step at a time
and show the user each result.
Stop the host from upgrading again, then install the old release over the current one (the installer restarts the service):
codync-host update --auto off
CODYNC_VERSION=v2.53.0 sh "$work/install.sh" --host-only # the reviewed Step 3 copy
codync-host --version # 2.53.0
Stop the service. The rest must run with the host stopped, or it may rewrite the configs while you edit them.
# Linux
systemctl --user stop codync-host
# macOS
launchctl bootout "gui/$(id -u)/com.pokai.codync.host"
Find the backup (normally one file; if there are several, ask the user which run to restore) and list what it holds:
data="${CODYNC_HOME:-$HOME/.codync}"
ls -l "$data"/backups/bot-projects-*.json
backup="$data/backups/bot-projects-<ms>.json" # the one chosen
jq -r '.bots[] | "\(.id)\t\(.cwd)"' "$backup" # bot id, original folder
Generate the SQL that puts each bot's cwd back, review it with the user,
then apply it:
cat > "$work/restore-cwd.jq" <<'EOF'
def q: "'" + gsub("'"; "''") + "'";
.bots[] | "UPDATE bots SET config = json_set(config, '$.cwd', \(.cwd | q)) WHERE id = \(.id | q);"
EOF
jq -r -f "$work/restore-cwd.jq" "$backup" > "$work/restore-cwd.sql"
cat "$work/restore-cwd.sql"
sqlite3 "$data/codync.db" < "$work/restore-cwd.sql"
sqlite3 "$data/codync.db" "SELECT id, json_extract(config, '$.cwd') FROM bots WHERE deleted = 0"
Move each bot's uploads back from bots/<id>/workspace/uploads to
bots/<id>/uploads, leaving anything already at the destination:
for id in $(jq -r '.bots[].id' "$backup"); do
src="$data/bots/$id/workspace/uploads"; dst="$data/bots/$id/uploads"
[ -d "$src" ] || continue
mkdir -p "$dst"
for u in "$src"/*; do
[ -e "$u" ] || continue
if [ -e "$dst/$(basename "$u")" ]; then echo "already there, left: $u" >&2; continue; fi
mv "$u" "$dst/"
done
rmdir "$src" 2>/dev/null || true
done
Start the service again (Linux: systemctl --user start codync-host;
macOS: the launchctl bootstrap line in Step 7) and check
codync-host status and codync-host update --status
("Automatic updates: off"). Ask the user to open a bot and confirm it works
in its project folder.
What doesn't come back: the bots' main sessions were cleared, so each bot
starts a new agent session. The projects list and the folder added to
routines stay in the stored data; 2.53.0 ignores them. The database stays
at schema 14 (2.53.0 opens a newer schema without migrating it), and the
migration is recorded as done, so a later upgrade to 2.54.0+ won't move the
bots again. Leave bots/<id>/workspace folders in place unless the user wants
them removed.
If you find a bug or stale instruction while using this skill:
byteforge-skills-maintainer-agent is available,
file a ticket with that agent. Use discover_agents to find its project ID.Include the skill name, plugin version if known, the instruction followed, expected and actual results, relevant errors/runtime versions, and any fix or workaround that worked. Omit credentials and private data.
Address the user's immediate problem first; report the skill defect afterward.
What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/aegis-nextjs-frontendThis skill should be used when the user asks to "create a new website", "spin up a frontend", "set up a Next.js site with aegis auth", "scaffold a new web app with authentication", "create a site with login and i18n", or needs a production-ready Next.js frontend integrated with ByteForge Aegis authentication. Provides complete project scaffolding with auth pages, internationalization, Docker deployment, and a design system./byteforge-loki-loggingConfigure Grafana Loki logging using byteforge-loki-logging library for Python/Flask applications. Use when setting up Loki logging, configuring centralized logging, or adding structured JSON logging to any Python project./byteforge-prometheus-metricsConfigure Prometheus metrics for Python/Flask applications with multi-worker gunicorn safety and optional Redis-backed business metrics. Use when adding a /metrics endpoint, instrumenting a Flask app, or fixing inflated metrics from multi-worker gunicorn./flask-docker-deploymentSet up Docker deployment for Flask applications with Gunicorn, automated versioning, and container registry publishing. Use when dockerizing a Flask app, containerizing for production, or setting up CI/CD with Docker./flask-smorest-apiSet up Flask REST API with flask-smorest, OpenAPI docs, blueprint architecture, and dataclass models. Use when creating a new Flask API server, building REST endpoints, or setting up a production API./flask-telegram-botAdd a Telegram bot webhook endpoint to a Flask service using the byteforge-telegram library. Use when wiring up a Flask app to receive Telegram bot updates, validating the Telegram secret token, routing commands, and sending notifications back through the Bot API.npx claudepluginhub jmazzahacks/byteforge-claude-skills --plugin byteforge-skills