Documentation
¶
Overview ¶
Package trust pre-marks a workdir as trusted in ~/.claude.json so interactive claude (spawned via PTY drive) skips the workspace-trust modal.
Best-effort: no file lock. A concurrent writer may produce a lost update; tui-driver's HasTrustModal(snap) provides the runtime safety net that dismisses the modal if pre-marking lost the race. The helper is still atomic on the single-writer axis (tempfile + rename) so a crashed pyry mid-write does not leave ~/.claude.json in a broken state for the user's own interactive claude sessions.
MUST NOT log file contents at any layer. ~/.claude.json may contain tokens or claude-internal state pyry does not own; the helper takes a pass-through view (preserve fields verbatim) and emits nothing to logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkWorkdirTrusted ¶
MarkWorkdirTrusted ensures
~/.claude.json :: projects[<realpath(workdir)>].hasTrustDialogAccepted = true
Idempotent. Atomic — writes to a tempfile in the same directory then renames over the target. Returns the resolved realpath on success.
On absent ~/.claude.json the helper creates it with mode 0o600 and a minimal skeleton. On existing ~/.claude.json the helper preserves all other top-level fields, the projects map's sibling entries, and any extra keys on the target entry verbatim — including numeric precision (no float64 round-trip of int64-sized values).
Types ¶
This section is empty.