Skip to content

Use shared ~/.harper-dev/<project>/ parent + document sandbox permission - #28

Open
hdbjeff wants to merge 2 commits into
feat/add-worktree-dev-rulefrom
chore/shared-harper-dev-parent
Open

Use shared ~/.harper-dev/<project>/ parent + document sandbox permission#28
hdbjeff wants to merge 2 commits into
feat/add-worktree-dev-rulefrom
chore/shared-harper-dev-parent

Conversation

@hdbjeff

@hdbjeff hdbjeff commented May 6, 2026

Copy link
Copy Markdown

Amends the running-dev-instances-in-worktrees rule (#26) with two changes that came out of adopting it on a real project under a sandboxed AI agent:

  1. Nest per-worktree data roots under a single shared parent. Today the rule prescribes `/.-dev/hdb-/` — one parent per project. For machines that sandbox AI-agent file writes, this means one allowlist entry per Harper project on the host. Move to `/.harper-dev//hdb-/` so a single literal allowlist entry covers them all.

  2. Document the sandbox-permission step. The rule mentions sandboxes adjacently but doesn't say "and your AI-agent sandbox needs to be told to allow writes here." Adds an explicit subsection under §3.

Path change

Before:
```
~/.project1-dev/hdb-/
~/.project2-dev/hdb-/
~/.project3-dev/hdb-/
```

After:
```
~/.harper-dev/project1/hdb-/
~/.harper-dev/project2/hdb-/
~/.harper-dev/project3/hdb-/
```

Most sandbox path matchers don't expand globs (`/Users//-dev` is a literal string), and even if they did, leading-dot dirs are usually excluded from `` by default.

Migration

Backwards-incompatible. Old data at `~/.-dev/` is safe to `rm -rf`; first run after this lands re-scaffolds at the new path.

Other benefits

  • `du -sh ~/.harper-dev` shows total Harper dev disk usage across projects.
  • `rm -rf ~/.harper-dev` wipes everything for a fresh start.

🤖 Generated with Claude Code

hdbjeff and others added 2 commits May 6, 2026 00:54
Replace per-project ~/.<project>-dev/ with shared ~/.harper-dev/<project>/
parent so a single sandbox-write allowlist entry covers all Harper
projects on a host. Adds an AI-agent sandbox subsection under §3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hdbjeff
hdbjeff requested a review from stephengoldberg May 6, 2026 16:17

@heskew heskew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One actionable configuration defect in the new sandbox subsection needs fixing; details are inline. The path migration itself is internally consistent.

This PR is stacked on skills#26 (feat/add-worktree-dev-rule), which still has an unresolved changes-requested review about moving the rule into a dedicated local-development skill and linking it from the skill indexes. #28 should follow/rebase onto that eventual structure rather than merge independently.

Review coverage: Codex exact-head documentation/configuration pass. Gemini/agy was unavailable for this queue pass.

🤖 Posted by Codex on behalf of @heskew


```json
{
"filesystem": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This settings shape is not recognized by current Claude Code: filesystem sandbox paths live under sandbox.filesystem, not a top-level filesystem key, so following this example does not grant the promised write access. Please use the current portable form:

{
  "sandbox": {
    "filesystem": {
      "allowWrite": ["~/.harper-dev"]
    }
  }
}

Using ~ also avoids hard-coding macOS's /Users/<user> layout. Current schema: https://code.claude.com/docs/en/sandboxing#granting-subprocess-write-access-to-specific-paths


### AI-agent sandboxes: allow writes to `~/.harper-dev/`

If you run Harper dev under a sandboxed AI agent (Claude Code, Cursor, etc.) that enforces a write-path allowlist, add the shared data-root path so the agent can scaffold and use per-worktree data roots without per-project tweaks. With the data root nested under `~/.harper-dev/<project>/`, one literal allowlist entry covers every Harper project on the host.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the convenience comes with a trust-boundary change worth stating. Allowing the shared parent lets an agent launched from one Harper project mutate every project's dev root under ~/.harper-dev, including another running instance. These roots are disposable and source trees remain outside, so the tradeoff can be reasonable; please mention it and offer ~/.harper-dev/<project> as the least-privilege option for stricter setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants