> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt
> Use this file to discover all available pages before exploring further.

# v0.5.0-beta.8

> 2026-04-20

## Bug Fixes

### 1. `trellis update` now actually delivers opencode changes (follow-up to beta.7)

Beta.7 fixed the OpenCode 1.2.x plugin factory-function shape in CLI templates. But users running `trellis update` on existing projects reported their `.opencode/plugins/*.js` was **still broken** — the fix wasn't reaching them.

Root cause: `packages/cli/src/configurators/index.ts` had this for opencode:

```ts theme={null}
opencode: {
  configure: configureOpenCode,
  // ← no collectTemplates!
},
```

Every other configured platform had a `collectTemplates` function returning the platform's file set for hash-tracked update. OpenCode was the only exception — an old omission, not a design choice. Consequence: `collectPlatformTemplates("opencode")` returned `undefined`, so `trellis update` silently skipped the entire `.opencode/` tree. Any CLI-side change to opencode (plugin logic, agent prompts, lib utilities, `package.json` deps) would ship on `init` but never propagate on `update`.

Fixed by adding `collectOpenCodeTemplates()` that walks the opencode template directory and returns `{ .opencode/agents/*, .opencode/plugins/*, .opencode/lib/*, .opencode/package.json, .opencode/commands/trellis/*, .opencode/skills/*/SKILL.md }`. `configureOpenCode` (init) was refactored to use the same enumeration, so init and update write byte-identical file sets.

### 2. Windows hook-path ENOENT after `cd` in Bash tool

Reported by a user running Claude Code on Windows in a monorepo:

```
UserPromptSubmit operation blocked by hook:
[python .claude/hooks/inject-workflow-state.py]:
can't open file 'E:\IdeaProjects\ai-codeview\frontend\.claude\hooks\inject-workflow-state.py':
[Errno 2] No such file or directory
```

The file lives at `E:\IdeaProjects\ai-codeview\.claude\...` (project root), not under `frontend/`. Claude Code's Bash tool had changed cwd to `frontend/` during an earlier command, and by default that cwd **persists** into subsequent hook invocations. The UserPromptSubmit hook command — `python .claude/hooks/inject-workflow-state.py` — resolved the relative path against the stuck cwd and couldn't find the file.

Fixed by pinning `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1` in `.claude/settings.json`'s `env` block:

```json theme={null}
{
  "env": {
    "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1"
  },
  "statusLine": { ... },
  "hooks": { ... }
}
```

Claude Code reads this variable internally — no shell expansion involved — so it works identically on macOS, Linux, and Windows. The Bash tool now returns to project root after every command, and hooks always run with cwd at the project root.

We considered rewriting hook commands to use `$CLAUDE_PROJECT_DIR` but dropped that approach — [CC issue #6023](https://github.com/anthropics/claude-code/issues/6023) confirms `$VAR` syntax doesn't expand on Windows cmd/PowerShell, which would have made the Windows problem worse.

## Upgrade

```bash theme={null}
trellis update
```

Not breaking.

* **opencode**: on any beta \< 0.5.0-beta.7 with opencode configured, this release auto-updates the 3 plugin files + `trellis-*` agents + `lib/trellis-context.js` + `.opencode/package.json` to current templates. Hash-matched auto-update for unmodified copies; standard `Modified by you` confirm prompt with diff if customized.
* **claude settings**: if you haven't modified `.claude/settings.json`, it auto-updates. If you customized it (e.g. added your own hooks), you'll see the `Modified by you` prompt — pick `[1] Overwrite` to adopt the new env block, or `[3] Skip` and manually add `"env": { "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1" }` to your settings to get the Windows fix.

Install: `npm install -g @mindfoldhq/trellis@beta`
