Expand description
Path helpers around the claude CLI’s on-disk config layout.
forge-sdk does not fall back to ~/.claude on its own.
Resolution lives in forge-agent / forge-workspace - those
layers resolve each account’s config_dir from forge.toml and
thread the resulting
PathBuf into every accessor that needs it. forge-sdk only
exposes a <config_dir> + "projects" join helper for callers that
already hold a config_dir.
Separately, app_support_dir resolves forge’s own machine-local
data directory (forge/ under the platform app-support base),
shared by the logs and the single-instance lock.
Re-exports§
use std::collections::hash_map::DefaultHasher;🔒use std::hash::Hash;🔒use std::hash::Hash;🔒use std::hash::Hasher;🔒use std::path::Path;🔒use std::path::PathBuf;🔒use sha2::Digest;🔒use sha2::Sha256;🔒use crate::Error;🔒
Functions§
- app_
support_ dir - Resolve forge’s machine-local application-support directory
(
~/Library/Application Support/forgeon macOS,$XDG_DATA_HOME/forgeon Linux). Distinct from theclaudeconfig dir: this holds forge’s OWN per-machine state - the diagnostics logs and the single-instance lock both live under here, and it is never synced across machines. - config_
dir_ hash - Stable hex digest of
config_dirthat keys forge’s machine-local per-config-dir files (the single-instance lock, the state cache). Canonicalised first (best-effort) so symlinked / trailing-slash variants map to one digest. - config_
dir_ store_ key - Stable hex key for a config dir’s durable store, independent of the Rust release.
- projects_
dir_ for - Path to a config_dir’s
projects/subdirectory. Caller passes the resolvedconfig_direxplicitly; this helper just performs the join so the layout convention lives in one place.