> ## 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.4.0-rc.0

> 2026-04-14

**v0.4.0 feature freeze.** First release candidate. No new features before stable — only bug fixes accepted. Please test and report regressions.

## SessionStart size fix (#154)

Vanilla `additionalContext` reduced from **\~29 KB to \~7 KB**, comfortably under Claude Code's \~20 KB truncation threshold. Task state (ACTIVE TASKS, CURRENT TASK) was being silently lost on most non-trivial projects. Thanks to @21nak for the thorough writeup, measurements, and both PRs.

* **#161 workflow\.md ToC**: Replace full `workflow.md` injection (\~12 KB) with a compact section index that lists each `##` heading. Applied to all 5 platforms including copilot. AI reads the full file on demand.
* **#160 remove start.md injection**: The `<instructions>` block pre-injected `start.md` (\~11 KB), but slash commands expand on demand anyway — this was duplicate work. Now removed from 4 platforms; copilot never had it.
* **Follow-up cleanup**: `<ready>` text no longer references nonexistent "Steps 1-3 / Step 4" after `<instructions>` was removed. Orphaned `claude_dir` / `codex_dir` / `iflow_dir` variables removed.

## OpenCode plugin v1 refactor (#159)

Update OpenCode templates to the v1 plugin API (`export default { id, server }`). Fixes non-persistent context injection: `experimental.chat.messages.transform` didn't write back to history, so injected Trellis context was lost on session reopen. Now routes through `chat.message` hook with SDK history-based dedupe via `metadata.trellis.sessionStart` markers. `task` tool prompt mutation now in-place (`args.prompt = ...`) because the runtime holds a local reference to the args object. Thanks to @Adamcf123.

## Windows encoding fix (#163)

`statusline.py` crashed on Windows with `UnicodeEncodeError: 'gbk' codec can't encode` when rendering the `·` separator in the info line. Both the live hook and the claude template now wrap `stdout`/`stderr` in UTF-8 on Windows. Thanks to @xiangagou163.

## Features

* **`feat(init)`: re-init fast path (#157)** — When `.trellis/` already exists, `trellis init` offers a streamlined flow instead of the full interactive setup:
  * `trellis init --codex` → configure only Codex, skip everything else
  * `trellis init -u name` → set up developer identity (new device sync)
  * `trellis init` (bare) → menu: add platform / add developer / full re-init
  * `--force` / `--skip-existing` → bypass fast path, run full init

## Bug Fixes

* **`fix(init)`: skip bootstrap task creation on re-init** — re-running `trellis init` no longer creates duplicate bootstrap tasks

## Documentation

* **`docs(spec)`: SessionStart size constraint** — platform-integration spec now documents the \~20 KB `additionalContext` truncation threshold with a size budget table, preventing future hooks from silently exceeding the limit

## Notes

* RC install: `npm install -g @mindfoldhq/trellis@rc`
* Please run `trellis update` on an existing project and report any regressions
* Session-start hooks have been significantly restructured — if you customized them locally, re-check after update
* Windows users with statusline garbling should also update
