2026-09-17 11:35:19 -04:00
|
|
|
.PHONY: all os stow deps claude claude-save
|
2025-06-09 10:51:22 -04:00
|
|
|
|
|
|
|
|
OS_NAME := $(shell uname -s | tr A-Z a-z)
|
|
|
|
|
|
2026-09-17 11:35:19 -04:00
|
|
|
CLAUDE_HISTORY_REPO := git@git.service:secstate/claude-history
|
|
|
|
|
CLAUDE_HISTORY_DIR := $(HOME)/.claude-history
|
|
|
|
|
CLAUDE_HISTORY_PATHS := projects plans tasks history.jsonl
|
|
|
|
|
|
|
|
|
|
all: stow claude
|
|
|
|
|
|
2025-06-09 10:51:22 -04:00
|
|
|
stow:
|
2026-03-02 10:59:21 -05:00
|
|
|
mkdir -p ~/.gnupg && chmod 0700 ~/.gnupg
|
2025-03-27 16:19:00 -04:00
|
|
|
stow -t ~ */
|
2025-06-18 17:03:13 -04:00
|
|
|
dconf load / < gnome/.local/share/custom-gconf.conf \
|
2025-06-09 10:51:22 -04:00
|
|
|
|
|
|
|
|
deps:
|
|
|
|
|
@echo "Installing software for ${OS_NAME} platform"
|
|
|
|
|
@if [ $(OS_NAME) = "darwin" ]; then\
|
|
|
|
|
cd macos/.config/homebrew && brew bundle\
|
|
|
|
|
fi
|
|
|
|
|
@if [ $(OS_NAME) = "linux" ]; then\
|
|
|
|
|
@echo "Not macos"\
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
os:
|
|
|
|
|
@echo $(OS_NAME)
|
2026-09-17 11:35:19 -04:00
|
|
|
|
|
|
|
|
# Clone the private session-state repo and symlink it into ~/.claude so Claude
|
|
|
|
|
# Code resumes prior sessions. Sessions only match when the checkout path is
|
|
|
|
|
# identical to the one recorded in the project directory name.
|
|
|
|
|
claude:
|
|
|
|
|
@test -d $(CLAUDE_HISTORY_DIR) || git clone $(CLAUDE_HISTORY_REPO) $(CLAUDE_HISTORY_DIR)
|
|
|
|
|
@mkdir -p ~/.claude
|
|
|
|
|
@for p in $(CLAUDE_HISTORY_PATHS); do \
|
|
|
|
|
test -e $(CLAUDE_HISTORY_DIR)/$$p || continue; \
|
|
|
|
|
test -L ~/.claude/$$p && continue; \
|
|
|
|
|
if [ -e ~/.claude/$$p ]; then \
|
|
|
|
|
echo "claude: ~/.claude/$$p exists and is not a symlink, leaving it alone"; \
|
|
|
|
|
continue; \
|
|
|
|
|
fi; \
|
|
|
|
|
ln -s $(CLAUDE_HISTORY_DIR)/$$p ~/.claude/$$p; \
|
|
|
|
|
echo "claude: linked $$p"; \
|
|
|
|
|
done
|
|
|
|
|
@if [ $(OS_NAME) = "linux" ]; then \
|
|
|
|
|
systemctl --user daemon-reload && \
|
|
|
|
|
systemctl --user enable --now claude-save.timer; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
claude-save:
|
|
|
|
|
@cd $(CLAUDE_HISTORY_DIR) && \
|
|
|
|
|
git add -A && \
|
|
|
|
|
if git diff --cached --quiet; then \
|
|
|
|
|
echo "claude-save: nothing to commit"; \
|
|
|
|
|
else \
|
|
|
|
|
git commit -qm "Sync session state" && echo "claude-save: committed"; \
|
|
|
|
|
fi && \
|
|
|
|
|
if git remote get-url origin >/dev/null 2>&1; then \
|
|
|
|
|
git push -q && echo "claude-save: pushed"; \
|
|
|
|
|
else \
|
|
|
|
|
echo "claude-save: no origin remote, skipping push"; \
|
|
|
|
|
fi
|