Documentation
¶
Overview ¶
Package paths resolves filesystem locations for budgetclaw's config, state, data, and cache, following the XDG Base Directory Specification.
XDG is the 2026 expectation for new CLI tools: Linux, macOS, and modern shells all respect it, and it keeps user home directories clean. Legacy tools that drop a single ~/.toolname directory are increasingly seen as anti-patterns. budgetclaw goes XDG-first from day one.
Layout:
$XDG_CONFIG_HOME/budgetclaw/ config.toml, limit rules $XDG_STATE_HOME/budgetclaw/ state.db (rollups, events) $XDG_DATA_HOME/budgetclaw/ lockfiles/, plugin bundles $XDG_CACHE_HOME/budgetclaw/ pricing table cache
Defaults when XDG_* are unset (per the spec):
XDG_CONFIG_HOME → $HOME/.config XDG_STATE_HOME → $HOME/.local/state XDG_DATA_HOME → $HOME/.local/share XDG_CACHE_HOME → $HOME/.cache
Every function returns an absolute path with "budgetclaw" appended. Callers are responsible for MkdirAll before writing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDir ¶
CacheDir returns the directory holding the pricing table cache and any other regenerable artifacts. Honors XDG_CACHE_HOME, defaults to $HOME/.cache/budgetclaw.
func ClaudeProjectsDir ¶
ClaudeProjectsDir returns $HOME/.claude/projects, the directory Claude Code writes its session JSONL logs to. This path is Claude-Code-owned and not configurable via XDG.
func ConfigDir ¶
ConfigDir returns the directory holding config.toml and limit rules. Honors XDG_CONFIG_HOME, defaults to $HOME/.config/budgetclaw.
Types ¶
This section is empty.