dev-env¶
Checks and repairs the developer environment on Windows and Linux: the toolchain, the git
identity, the destructive command guard (dcg) and its hook, the systemd service that runs Claude
Code on the Linux host, the credentials the MCP servers need, Google Cloud access, and one shared
directory for worktrees. Both checkers are one PowerShell script each, covering both operating
systems (CLAUDE.md says why a cross-platform check belongs here).
The machines it serves: docs/setup/linux-host.md and docs/setup/owners-workstation.md; the whole environment at a glance: docs/architecture/07_deployment_view.md.
Skills¶
dev-doctor¶
Checks, in groups: the session and (Linux) the systemd unit running Claude Code, the toolchain
(JDK through Gradle toolchains, Node.js, gh, jq, Python, pre-commit, PowerShell modules, the
semgrep, gitleaks and Vale a repository pins for its pre-push hooks, the optional Antigravity CLI), the
git identity, dcg and its hook, the repository (Gradle wrapper, line endings, Spotless, pre-push gate), the MCP server
logins (GitHub, Sonatype Guide, Context7, Aikido) and the Aikido plugin itself, installed skills and plugins, and worktrees.
The read-only run is safe anywhere; -Fix, in a real terminal, asks before each repair and does
the whole chain itself — installing a tool, gh auth login, prompting for a credential with
hidden input and verifying it before storing. -Fix -Yes applies every repair without a
question, only for a person at a terminal (not inside a Claude Code session). On Linux it also bootstraps the systemd unit and
tells a staged token from an active one.
When: on a new machine, when a tool is not found, an MCP server says "Authentication required",
git commit has no author identity, a token does not reach the service, or "which worktrees can
go?". Example:
pwsh -File "${CLAUDE_PLUGIN_ROOT}/skills/dev-doctor/scripts/dev-doctor.ps1" -Only Worktrees
The skill: plugins/dev-env/skills/dev-doctor/SKILL.md.
ops-doctor¶
Checks and sets up access to Google Cloud from this machine: the gcloud CLI, the gcloud login,
Application Default Credentials, the default and quota project, billing, the APIs a repository
needs and service account impersonation. It also compares the Cloud Run services a repository
declares with the live ones, deploys them to match, and proves this machine can call each one
with an identity token, directly and through gcloud run services proxy. -Fix runs the setup tasks the report
names, in order.
When: "log in to Google Cloud", a client library says "default credentials were not found", an API answers 403 or "API has not been used in project", a Cloud Run service drifted, answers 401 or 403, or the proxy command fails. Example:
pwsh -File "${CLAUDE_PLUGIN_ROOT}/skills/ops-doctor/scripts/ops-doctor.ps1"
It also sets up the owner's remote access to a host through Cloudflare: one remotely managed tunnel per host, every public hostname behind an Access app with one shared owner-only policy, and on a desktop host the RDP desktop in the browser, for a client without admin rights. The Cloudflare side is built through the API; cloudflared runs as a user service; steps that need root are printed, not run. When: "make this host reachable from outside", a web UI on the owner's domain, a desktop from a locked-down work notebook. Example:
bash "${CLAUDE_PLUGIN_ROOT}/skills/ops-doctor/scripts/linux/remote-access.sh" check
The model and the steps: plugins/dev-env/skills/ops-doctor/remote-access.md.
The skill: plugins/dev-env/skills/ops-doctor/SKILL.md.
Hooks¶
WorktreeCreate and WorktreeRemove run hooks/worktree.ps1 (plugins/dev-env/hooks/worktree.ps1) with pwsh.
They send the worktrees Claude Code creates itself (claude --worktree, EnterWorktree,
subagents with isolation: "worktree") to one shared folder, as <base>/<repo>-<name> on a
branch worktree-<name>, instead of <repo>/.claude/worktrees/. They keep Claude Code's own
logic otherwise: the base ref, the files .worktreeinclude lists. Removal never forces: a
worktree with changed or untracked files stays.
Claude Code never runs WorktreeRemove for a subagent's worktree once a hook made it, so
SubagentStop runs the same script: when a subagent stops in the worktree created for it (branch
worktree-agent-<id>), it removes that worktree, and the branch unless it has commits that are not
merged, by the same rules.
<base> is CLAUDE_WORKTREE_BASE if set, else the workflow coordinator's base_dir
(workflow), else a worktrees folder next to the projects
folder; it must lie outside every repository. dev-doctor (group Worktrees) reports the folder
and whether the hooks are active, lists every worktree as kept or removable with the reason, and
with -Fix removes the stale ones.
dcg itself is not this plugin's hook: dev-doctor installs it as a PreToolUse hook in the user
settings (plugins/dev-env/skills/dev-doctor/reference/dcg-guard.md).
Baseline¶
baseline/ (plugins/dev-env/baseline/) is the user-level Claude Code baseline every machine gets (#769): the
autoMode entries and permissions.allow rules of baseline.json (plugins/dev-env/baseline/baseline.json) in
~/.claude/settings.json — the only scope Claude Code reads autoMode from — and
baseline.md (plugins/dev-env/baseline/baseline.md) as ~/.claude/rules/baseline.md.
Baseline.ps1 (plugins/dev-env/baseline/Baseline.ps1) is the one implementation: dev-doctor's Baseline auto
mode and Baseline rules rows dot-source it, and sandbox provisioning runs it inside each VM
(#771; docs/setup/claude-baseline.md):
pwsh -File "${CLAUDE_PLUGIN_ROOT}/baseline/Baseline.ps1" # compare only
pwsh -File "${CLAUDE_PLUGIN_ROOT}/baseline/Baseline.ps1" -Apply # asks at a console
pwsh -File "${CLAUDE_PLUGIN_ROOT}/baseline/Baseline.ps1" -Apply -Sandbox # unattended, in a sandbox only
Every prose entry starts with [baseline]; an apply replaces only those, writes them after
"$defaults" and leaves a list without "$defaults" alone. Change an entry only after
claude auto-mode critique on a scratch settings file that holds it.
Janitor¶
janitor/janitor.ps1 (plugins/dev-env/janitor/janitor.ps1) is no hook and no skill: the owner installs it once
per machine as a Task Scheduler task or a systemd user timer. Each pass deletes merged local
branches whose remote branch is gone and carries out the delete_branch, remove_folder and
vault_sync (an on-demand token sync) entries queued for it (schema (plugins/dev-env/janitor/queue-entry.schema.json)); agents only queue and may
run -Status and -DryRun. Install, the threat model and what it never does:
docs/setup/janitor.md.
Configuration¶
- A repository's Google Cloud needs, in
.claude/ops-doctor.json: the project, the APIs, the service account to impersonate, the Cloud Run services and a Cloud Billing budget (ops-doctor (plugins/dev-env/skills/ops-doctor/SKILL.md)). - Credentials are read with hidden input and stored per machine — never in a repository, never on a command line: docs/setup/secrets.md.
- The worktree directory:
CLAUDE_WORKTREE_BASE, or the coordinator'sbase_dir, as above.
Installation¶
claude plugin install dev-env@<owner>
Both skills run pwsh (PowerShell 7) on both platforms, and so do the worktree hooks: a machine
with the plugin needs pwsh on the PATH of the process that runs Claude Code. On Linux,
sudo snap install powershell --classic. The marketplace and how updates reach a machine:
docs/setup/marketplace.md.
Limits and gotchas¶
-Fixprompts for credentials and refuses when stdin is not a terminal; through Claude Code's!or Bash tool only the read-only run and-UseGitHubCliwork.-Fix -Yesis no way around that: inside a Claude Code session it applies no permission, baseline or dcg allowlist repair.- The plugin never escalates privileges: on Linux a step that needs root is staged and the exact
sudocommand is printed. - Each skill's own gotchas: dev-doctor (
plugins/dev-env/skills/dev-doctor/SKILL.md), ops-doctor (plugins/dev-env/skills/ops-doctor/SKILL.md).