Skip to content

docs(dev): the environment's agent runs as the developer, so onboarding checks use a throwaway machine - #702

Merged
allisonmahmood merged 1 commit into
mainfrom
docs/592-agent-runs-as-developer
Oct 15, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
docs/592-agent-runs-as-developer

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

Stacked on #701.

The agent launcher that pnpm dev up writes runs Claude Code's commands with the developer's own HOME and npm prefix. Given the portal's setup line, the environment's agent replaced the developer's global patchy and the Patchy skill their own agents load (~/.patchy/skills, ~/.agents/skills, ~/.claude/skills), and pnpm dev down undid none of it. The development guide described the agent as starting "with only the Patchy skill" and warned against nothing.

The fix

Triage chose docs over containment: giving the agent its own HOME would move where pnpm, mise, Playwright and git find their files, and the environment's agent is the wrong place to test onboarding anyway.

  • The guide's Environments section, the patchy-dev-loop skill and the launcher's comments now say the agent is a Patchy user who has already set up, its commands run as the developer, and it must never be given the setup line or run patchy setup.
  • "What to exercise for a change" gains a Front door and onboarding entry with a copyable throwaway machine. It is a folder under /tmp (outside HOME, so no parent CLAUDE.md loads) with its own HOME, npm prefix and cache, no PATCHY_*, and a PATH of its npm bin, Node's real directory and the system tools. CLAUDE_ENV_FILE applies it to the agent's commands, so Claude Code keeps the developer's login. A one-line check confirms no other patchy is visible first.

Tested by hand

I extracted the recipe's code block from the doc verbatim and ran it against a live pnpm dev up environment, with PATCHY_API_URL and PATCHY_API_TOKEN exported in the outer shell:

  • The install line. In the documented subshell form it exited 0, printed the executable, skill and link paths all inside the throwaway folder, and reached the login handoff.
  • Through an agent. The doc's claude command did the same, run headlessly with -p and pre-approvals. echo $HOME showed the throwaway HOME. An agent started with the recipe's two flags listed only Claude Code's built-in skills and loaded no instruction files.
  • The patchy check. With a Node whose folder holds my global patchy (mise, Node 26), it prints that path. With the worktree's Node 24 it prints nothing.
  • My own install. Before and after every run, my ~/.claude/skills/patchy, ~/.agents/skills/patchy, ~/.patchy/skills/patchy and every global patchy were unchanged (ls -la, readlink, version and a hash of dist/index.js).

Review

GPT 6.1 Sol (xhigh) found one low issue: under nvm or mise, Node's folder can hold the developer's global patchy, so the agent could see it before installing. I tried linking just node and npm into the machine instead, but mise's npm is a launcher that locates itself by its own folder and broke. So the recipe keeps Node's real folder and adds the check Sol suggested. Sol found no other correctness, surface or scope problems.

Surfaces

From "Hit every surface", the dev loop entry applied: docs/DEVELOPMENT.md, the patchy-dev-loop skill and the runner's launcher comments. Nothing else describes the environment's agent.

Closes #592

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:s Under 100 changed lines labels Oct 15, 2026
@allisonmahmood
allisonmahmood force-pushed the fix/619-environment-agent-isolation branch from 0bc6e9f to e55d4a8 Compare October 15, 2026 21:43
Base automatically changed from fix/619-environment-agent-isolation to main October 15, 2026 21:52
…ng checks use a throwaway machine

The `agent` launcher that `pnpm dev up` writes runs Claude Code's
commands with the developer's own HOME and npm prefix. Given the portal's
setup line, it replaced the developer's global `patchy` and the Patchy
skill their own agents load, and `pnpm dev down` undid none of it. The
guide described it as starting "with only the Patchy skill" and warned
against nothing.

Triage chose docs over containment. The development guide, the
`patchy-dev-loop` skill and the launcher's comments now say the agent is
a Patchy user who has already set up, runs as the developer, and must
never be given the setup line or run `patchy setup`. "What to exercise
for a change" gains a Front door and onboarding entry with a copyable
throwaway machine: its own HOME, npm prefix and PATH under /tmp, applied
to the agent's commands through CLAUDE_ENV_FILE so Claude Code keeps the
developer's login.

Closes #592

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the docs/592-agent-runs-as-developer branch from 1eb1efa to 9107225 Compare October 15, 2026 21:52
@allisonmahmood
allisonmahmood merged commit a93c831 into main Oct 15, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the docs/592-agent-runs-as-developer branch October 15, 2026 22:01
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dev): the environment's agent can install into the developer's real HOME

1 participant