From 1fece42e00af4ada5ff434983f17e13780caa31d Mon Sep 17 00:00:00 2001 From: hugocasa Date: Mon, 24 Aug 2026 17:09:48 +0200 Subject: [PATCH] docs: correct the .env.local readability claim The file-read tool denies every .env.* path via .claude/settings.json, .env.local included, so the section points at cat instead of implying the file is readable. DATABASE_URL carries an export prefix, which the bare 'source .env.local' in .envrc needs to reach cargo and sqlx, and which a ^DATABASE_URL= grep would miss. Documented rather than removed. Co-Authored-By: Claude Opus 5 --- AGENTS.md | 4 +++- scripts/worktree-common.sh | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7a4769e558..83f8152a06 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -79,7 +79,9 @@ checkout with nothing running. **`.env.local` in the worktree root is the portable answer** — `BACKEND_PORT`, `FRONTEND_PORT`, `REMOTE`, `DATABASE_URL`, `CARGO_FEATURES`, `WM_DB_NAME`. Both managers write -those fields, so it is correct whichever one you are in, and it is readable despite the name. +those fields, so it is correct whichever one you are in. Read it with `cat .env.local` from a +shell: the file-read tool denies every `.env.*` path, and `DATABASE_URL` is written with an +`export` prefix that a `^DATABASE_URL=` grep misses. webmux additionally writes `$(git rev-parse --git-dir)/webmux/runtime.env`, which every pane sources at startup and which carries the extras `.env.local` lacks: `WEBMUX_*`, `WM_CLONE_DB`, diff --git a/scripts/worktree-common.sh b/scripts/worktree-common.sh index 41d4ed109e..5d3b6cfd1f 100755 --- a/scripts/worktree-common.sh +++ b/scripts/worktree-common.sh @@ -13,8 +13,7 @@ wm_main_repo_root() { cd "$(git -C "$repo_root" rev-parse --git-common-dir 2>/dev/null)/.." && pwd } -# Written by both worktree entry points — `worktree-env` by hand, `post-create.sh` from the -# webmux hook — and read by agents to find their own ports, so the two must not drift. +# These field names are documented in AGENTS.md as how an agent finds its own ports and database. wm_write_env_local() { local repo_root=$1 local backend_port=$2