claude-hq v0.2
One long-lived HQ conversation on a home server, accessible through
Claude Code Remote Control.
From a company laptop, browser, desktop app, or phone, ask HQ to find projects,
spawn clickable working sessions, check progress, and report cleanup and health.
No SSH access from the laptop is needed.
HQ is Bash glue around Claude Code built-ins. Claude owns background sessions,
session discovery, Remote Control, worktrees, logs, and auto memory. HQ adds
project resolution, compact reports, and controller instructions. There is no
session registry, tmux manager, transcript parser, or daemon. An optional bounded
janitor performs only the automatic cleanup described below.
docs/SPEC.md defines the scope.
Five-minute home-server setup
Requires Linux, Bash 4+, Git, jq, curl, GNU coreutils/findutils (including timeout,
stat, nproc, and xargs), util-linux (flock/ionice), and Claude Code with background sessions and
Remote Control (verified interface: 2.1.319). Sign in to a Claude account with
Remote Control available. Start with this checkout at ~/dev/claude-hq.
-
Trust the HQ directory locally: run claude in it, accept workspace trust,
then exit. Do this once in each project directory you want HQ to spawn into.
Untrusted spawns print Claude's trust message for you to resolve locally.
-
Install the command and memory wiring:
cd ~/dev/claude-hq
bash install.sh
export PATH="$HOME/.local/bin:$PATH"
claude plugin marketplace add "$PWD"
claude plugin install hq@claude-hq --scope local
Add ~/.local/bin to your shell PATH permanently. The idempotent installer
symlinks bin/hq, merges the absolute memory/ path as autoMemoryDirectory
into the checkout's ignored .claude/settings.local.json, and copies
config.example.env to ~/.config/claude-hq/config.env only if absent.
It respects XDG_CONFIG_HOME. Plugin installation enables the skill, slash
commands, and SessionStart hook in the HQ directory. The hook checks for
.hq-root in CLAUDE_PROJECT_DIR, so user-wide installs stay silent in children.
-
Edit that user-owned config. HQ_ROOTS is a colon-separated list, default
$HOME/dev; only its immediate Git repositories are projects. Directories
ending in -worktrees are skipped. Optionally set BESZEL_URL,
BESZEL_EMAIL, and BESZEL_PASSWORD together for a Beszel users account.
The config is sourced as shell code; keep credentials in that private copy.
-
Try Remote Control in the repo:
claude remote-control --name HQ
Open the displayed link on your other device. Keep the server awake.
Exit this foreground process before enabling the persistent service below.
-
Install the user service:
mkdir -p ~/.config/systemd/user
cp systemd/claude-hq.service ~/.config/systemd/user/
# Edit WorkingDirectory and ExecStart to match this checkout and `command -v claude`.
systemctl --user daemon-reload
systemctl --user enable --now claude-hq.service
The template uses %h/dev/claude-hq and %h/.local/bin/claude. It runs
claude remote-control --name HQ and restarts the process if it exits.
Enable user lingering with loginctl enable-linger "$USER" if the service
should survive logout (your server may require administrator approval).
Inspect output with journalctl --user -u claude-hq.service -n 30.
Claude owns session lifetime and reconnection; this unit keeps its Remote
Control process running and does not implement session restoration.
Use from the laptop
Open claude.ai/code or the Claude app and select HQ.
Try “Brief me”, “Work on alpha in a worktree”, or “Check my sessions”. HQ runs
on the home server and returns the built-in session id and available URL.
Select a child session directly when you want to work in it. Use /clear in HQ
for a fresh context; the SessionStart briefing and auto memory orient it again.
HQ checks hq sessions and uses Claude's ListAgents / SendMessage tools
to ask children for status. /recap provides session context; only when needed,
claude -p --resume <id> "<question>" adds a turn to the child. Background children
may lack auto memory, so HQ passes context and requests a <=2,000-token summary.
Cleanup is a report followed by a user decision.
Commands