feat: configurable tz, signing tooling, deterministic session ids #19

Merged
claudiomaradonna merged 3 commits from feat/tz-signing-deterministic-sessions into main 2026-05-11 23:55:08 +02:00

Three independent quality-of-life improvements for daily use. The image now bakes a configurable timezone (defaulting to Etc/UTC, overridable via install.sh --tz or make TZ=...) so containerized timestamps stop diverging from the host whenever the user wants local time. It also ships openssh-client plus gnupg/jq/ripgrep/xz-utils, switching the apt-get install to --no-install-recommends, so SSH-based commit signing finally works inside the container once --with-ssh-agent is on — README spells out the gitconfig wiring users still have to provide themselves. Finally, claude.sh derives the session ID deterministically from the workspace path (first 8 hex chars of its sha256), so re-running claude in the same folder transparently reuses the same session without juggling CLAUDE_JAIL_SESSION or --session; explicit overrides are tightened to require an existing session, removing the typo-creates-empty-session footgun.

Three independent quality-of-life improvements for daily use. The image now bakes a configurable timezone (defaulting to `Etc/UTC`, overridable via `install.sh --tz` or `make TZ=...`) so containerized timestamps stop diverging from the host whenever the user wants local time. It also ships `openssh-client` plus gnupg/jq/ripgrep/xz-utils, switching the apt-get install to `--no-install-recommends`, so SSH-based commit signing finally works inside the container once `--with-ssh-agent` is on — README spells out the gitconfig wiring users still have to provide themselves. Finally, `claude.sh` derives the session ID deterministically from the workspace path (first 8 hex chars of its sha256), so re-running `claude` in the same folder transparently reuses the same session without juggling `CLAUDE_JAIL_SESSION` or `--session`; explicit overrides are tightened to require an existing session, removing the typo-creates-empty-session footgun.
Containerized tools that look at clock time (git timestamps, log
output, scheduled checks) inherit the image's timezone, not the
host's. Defaulting to UTC is fine for CI but unhelpful when the user
actually wants local time inside the container.

Plumb a TZ build argument from `install.sh --tz <zone>` and
`make TZ=<zone>` down to the Dockerfile, install `tzdata`, point
`/etc/localtime` at the chosen zone, and export `TZ` so child
processes pick it up. Default stays `Etc/UTC` so behavior is
unchanged when the flag is omitted.
The wrapper already forwards the host SSH agent via --with-ssh-agent,
but the image lacked openssh-client, so signing commits with
gpg.format=ssh inside the container failed even when the agent socket
was available. Add openssh-client, plus jq/gnupg/ripgrep/xz-utils for
common toolchains, and switch the apt-get install to
--no-install-recommends to keep the image lean.

Document the signing setup in README so users know which git config
keys to set and how to make the public key reachable inside the
container (explicit mount or inline `key::` form).
Random 8-hex IDs meant the same project got a fresh empty session on
every invocation, and reusing prior context required juggling
CLAUDE_JAIL_SESSION or copy-pasting an --session flag. Most users
want the opposite: stable per-folder sessions, zero config.

Derive the default ID from the first 8 hex chars of sha256("$workspace")
so re-running claude in the same directory transparently reuses the
session. Create the on-disk state lazily on first use, and tighten
explicit --session / CLAUDE_JAIL_SESSION to require an existing
session (no more accidental creation from a typoed ID).

Update README and .env.example to document the new default and the
narrower role of CLAUDE_JAIL_SESSION.
claudiomaradonna deleted branch feat/tz-signing-deterministic-sessions 2026-05-11 23:55:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
claudiomaradonna/claude-jail!19
No description provided.