trust

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func MarkWorkdirTrusted(workdir string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL