Skip to main content

Module paths

Module paths 

Source
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/forge on macOS, $XDG_DATA_HOME/forge on Linux). Distinct from the claude config 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_dir that 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 resolved config_dir explicitly; this helper just performs the join so the layout convention lives in one place.