Files
claude-code/automation/pa-launch
OpenCode Test 89bffd00e6 Use PA-specific tmux config for power mode theme
Both pa-mode and pa-launch now use ~/.tmux-pa.conf which applies
a Dracula purple theme to visually distinguish privileged sessions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 12:29:20 -08:00

38 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# PA Agent Mode - Launch/attach to persistent PA tmux session
set -euo pipefail
SESSION="pa"
CLAUDE="/home/linuxbrew/.linuxbrew/bin/claude"
HISTORY_DIR="$HOME/.claude/state/personal-assistant/history"
INDEX_FILE="$HISTORY_DIR/index.json"
export CLAUDE_AGENT=personal-assistant
get_session_id() {
date +"%Y-%m-%d_%H-%M-%S"
}
record_session_start() {
local session_id="$1"
local tmp_file
tmp_file=$(mktemp)
jq --arg id "$session_id" --arg started "$(date -Iseconds)" \
'.sessions += [{"id": $id, "started": $started, "ended": null, "summarized": false, "topics": []}]' \
"$INDEX_FILE" > "$tmp_file" && mv "$tmp_file" "$INDEX_FILE"
}
# Check if session exists
if tmux has-session -t "$SESSION" 2>/dev/null; then
tmux attach-session -t "$SESSION"
else
session_id=$(get_session_id)
record_session_start "$session_id"
export PA_SESSION_ID="$session_id"
export PA_HISTORY_FILE="$HISTORY_DIR/${session_id}.jsonl"
# Uses PA-specific config for distinct "power mode" visual theme
tmux -f ~/.tmux-pa.conf new-session -s "$SESSION" "$CLAUDE" --dangerously-skip-permissions --agent personal-assistant
fi