Follow Discord
Sweep 27 Oct 2026 · 19:04Z Build v2.1.312 531 read Stable v2.1.308 Latest v2.1.312 Next v2.1.312 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Customize sessions in self-hosted environments changedself-hosted-environments-configuration

Nearest release: v2.1.310, published 7 hours after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 23 Oct 2026 13:50 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 23 Oct 2026 14:07 UTC.

Upstream edited
Recorded here
Lines+6added
Lines−5removed
From line 58 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits36to this page, all time

The whole hunk

from line 58, old and new numbered
/
lines
from line 58
5858 
5959The child's stdin is the runner's control channel. Token rotations and session-end signals arrive on it. The runner also opens a pipe on file descriptor 3 and reads the child's activity signals from it to drive idle and startup timeouts. A plain `exec "$CLAUDE_RUNNER_CLAUDE_BIN" "$@"` preserves both automatically.
6060 
61If your wrapper backgrounds the child with a bare `&`, it severs the child's stdin. The session looks healthy until the initial OAuth token's roughly 30-minute lifetime expires, and then every API call that uses the token fails with `401 authentication_error`. If your wrapper must background the child, for example to keep a teardown trap alive, save stdin on file descriptor 4 or higher and re-attach it explicitly:
61If your wrapper backgrounds the child with a bare `&`, it severs the child's stdin. The session looks healthy until the initial OAuth token's roughly 30-minute lifetime expires, and then every API call that uses the token fails with `401 authentication_error`. If your wrapper must background the child, for example to keep a teardown trap alive, save stdin on file descriptor 9 and re-attach it explicitly:
6262 
6363```bash theme={null}
64exec 4<&0
65"$CLAUDE_RUNNER_CLAUDE_BIN" "$@" <&4 4<&- &
64exec 9<&0 # the runner uses 3, and from v2.1.309 reserves 4 and 5
65"$CLAUDE_RUNNER_CLAUDE_BIN" "$@" <&9 9<&- &
6666CHILD=$!
6767trap 'teardown' EXIT
6868wait "$CHILD"
from line 71
7171You can redirect the child's stdout. Keep file descriptor 3 and stderr attached to the runner:
7272 
7373* **File descriptor 3**: carries the child's activity signals to the runner. Don't close it or reuse it in the wrapper.
74* **File descriptors 4 and 5**: runners on Claude Code v2.1.309 or later reserve them for the child. Don't close or reuse them in the wrapper. If your wrapper uses either, for example to save stdin, move that use to a descriptor from 6 to 9, which earlier versions leave free too.
7475* **stderr**: when the wrapper or the child exits non-zero, the runner posts the last lines of stderr to the session and prints them in its own log. The session's user sees those lines, so don't print secrets to stderr, and remove `set -x` before you deploy the wrapper. If you redirect stderr, sessions still run, but the runner reports a failure with the exit code alone.
7576 
7677### Pass the system prompt flags through
Feedback