Merge pull request 'chore: remove AI session save/resume helpers' (#56) from chore/remove-ai-session-save into main
Generate documentation / build-docs (push) Successful in 36s
Generate documentation / build-docs (push) Successful in 36s
Reviewed-on: #56
This commit was merged in pull request #56.
This commit is contained in:
@@ -133,14 +133,11 @@ logging=## 5.11 Pager and Logging
|
||||
logs=### logs
|
||||
smart-exit=### smart_exit
|
||||
ai=## 5.12 AI and Developer Tools
|
||||
antigravity=### antigravity-resume
|
||||
antigravity-ide=### antigravity-ide
|
||||
agy=### agy
|
||||
claude-cli=### claude
|
||||
claude=### claude-resume
|
||||
claude-docs=### claude-docs
|
||||
claude-pr=### claude-pr
|
||||
code-resume=### code-resume
|
||||
superpowers=### superpowers
|
||||
media=## 5.13 Media and Utilities
|
||||
dng2avif=### dng2avif
|
||||
|
||||
+4
-24
@@ -1124,13 +1124,6 @@ Add -i (interactive confirmation) to destructive commands:
|
||||
Synopsis: antigravity-ide [args...]
|
||||
Runs the antigravity-ide editor with warnings filtered.
|
||||
|
||||
### antigravity-resume
|
||||
|
||||
Synopsis: antigravity-resume
|
||||
Resumes the most recent Antigravity session from the .antigravity_session
|
||||
file in the current directory, or opens an interactive fzf picker if no
|
||||
session file is found.
|
||||
|
||||
### agents-init
|
||||
|
||||
Synopsis: agents-init [--agents | --plugins]
|
||||
@@ -1163,12 +1156,6 @@ Add -i (interactive confirmation) to destructive commands:
|
||||
claude
|
||||
claude --resume
|
||||
|
||||
### claude-resume
|
||||
|
||||
Synopsis: claude-resume
|
||||
Resumes the most recent Claude Code session from the .claude_session
|
||||
file in the current directory, or opens an interactive fzf picker.
|
||||
|
||||
### claude-docs
|
||||
|
||||
Synopsis: claude-docs
|
||||
@@ -1182,12 +1169,6 @@ Add -i (interactive confirmation) to destructive commands:
|
||||
conventional commit, verification, push, and open a PR with a manual
|
||||
verification checklist.
|
||||
|
||||
### code-resume
|
||||
|
||||
Synopsis: code-resume
|
||||
Resumes the most recent AI session (Claude or Antigravity), preferring
|
||||
the newest session file found in the current directory.
|
||||
|
||||
### superpowers
|
||||
|
||||
Synopsis: superpowers [on|off] [-g]
|
||||
@@ -1471,11 +1452,10 @@ fish-deps manages these tools. Run `fish-deps` to check status, or
|
||||
trash Safe delete (trash-cli)
|
||||
kitty GPU-accelerated terminal (primary)
|
||||
wezterm GPU-accelerated terminal (alternative)
|
||||
python3 Standalone interpreter — used by the AI session helpers
|
||||
(save_claude_session / save_antigravity_session) and the
|
||||
paru/yay log cleaner. Note: uv does not provide python3 on
|
||||
PATH, and Arch's base does not include it, so it is listed
|
||||
separately. All consumers degrade gracefully without it.
|
||||
python3 Standalone interpreter — used by the paru/yay log cleaner.
|
||||
Note: uv does not provide python3 on PATH, and Arch's base
|
||||
does not include it, so it is listed separately. All
|
||||
consumers degrade gracefully without it.
|
||||
|
||||
## Install Methods
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# SYNOPSIS
|
||||
# antigravity-resume
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Resumes an Antigravity (agy) AI session using the session ID saved in
|
||||
# .antigravity_session in the current directory. Falls back to the interactive
|
||||
# session browser if no local session file exists.
|
||||
#
|
||||
# RETURNS
|
||||
# 0 Session resumed or interactive picker opened
|
||||
# 1 Required binaries (agy or save_antigravity_session) are not found
|
||||
#
|
||||
# EXAMPLE
|
||||
# antigravity-resume
|
||||
function antigravity-resume --description 'Execute antigravity-resume'
|
||||
if not type -q agy
|
||||
echo "Error: The 'agy' command is not installed or not in PATH." >&2
|
||||
return 1
|
||||
end
|
||||
if not type -q save_antigravity_session
|
||||
echo "Error: The companion function 'save_antigravity_session' is missing." >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if test -f .antigravity_session
|
||||
set -l sid (cat .antigravity_session)
|
||||
# Use --resume (or -r) to jump back in
|
||||
agy --resume $sid
|
||||
else
|
||||
# Fallback to the interactive session browser
|
||||
agy --resume
|
||||
end
|
||||
end
|
||||
@@ -1,35 +0,0 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# SYNOPSIS
|
||||
# claude-resume
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Resumes a Claude Code session using the ID saved in .claude_session in the
|
||||
# current directory. Falls back to the interactive session picker if no file
|
||||
# exists.
|
||||
#
|
||||
# RETURNS
|
||||
# 0 Session resumed or interactive picker opened
|
||||
# 1 Required binaries (claude or save_claude_session) are not found
|
||||
#
|
||||
# EXAMPLE
|
||||
# claude-resume
|
||||
function claude-resume --description 'Execute claude-resume'
|
||||
if not type -q claude
|
||||
echo "Error: The 'claude' command is not installed or not in PATH." >&2
|
||||
return 1
|
||||
end
|
||||
if not type -q save_claude_session
|
||||
echo "Error: The companion function 'save_claude_session' is missing." >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if test -f .claude_session
|
||||
set -l sid (cat .claude_session)
|
||||
claude --resume $sid
|
||||
else
|
||||
echo "No saved session found in this directory."
|
||||
claude --resume # Fallback to the interactive picker
|
||||
end
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# SYNOPSIS
|
||||
# code-resume
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Resumes the most recent AI coding session in the current directory. Prefers
|
||||
# Claude Code (.claude_session), then Antigravity (.antigravity_session),
|
||||
# falling back to the Claude interactive session picker.
|
||||
#
|
||||
# EXAMPLE
|
||||
# code-resume
|
||||
function code-resume --description 'Execute code-resume'
|
||||
if test -f .claude_session
|
||||
set -l sid (cat .claude_session)
|
||||
echo "Resuming Claude session: $sid"
|
||||
claude --resume $sid
|
||||
else if test -f .antigravity_session
|
||||
set -l sid (cat .antigravity_session)
|
||||
echo "Resuming antigravity-cli session: $sid"
|
||||
agy --resume $sid
|
||||
else
|
||||
echo "No local AI session found. Opening picker..."
|
||||
claude --resume # Default to Claude picker
|
||||
end
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# SYNOPSIS
|
||||
# Invoked as an Antigravity session hook; reads JSON from stdin.
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Hook script called by the Antigravity CLI (agy) on session start.
|
||||
# Reads a JSON payload from stdin, extracts the session_id field, and
|
||||
# writes it to .antigravity_session in the current directory. Ensures
|
||||
# that file is excluded via .gitignore. Sets the universal variable
|
||||
# LAST_ANTIGRAVITY_SESSION for cross-terminal access. Falls back to a
|
||||
# no-op (emitting "{}") when python3 is unavailable (Convention §6).
|
||||
#
|
||||
# ARGUMENTS
|
||||
# stdin JSON payload from the Antigravity CLI containing a "session_id" key
|
||||
#
|
||||
# RETURNS
|
||||
# 0 Always; emits "{}" to stdout as required by the hook contract
|
||||
#
|
||||
# EXAMPLE
|
||||
# echo '{"session_id":"abc123"}' | fish save_antigravity_session.fish
|
||||
# cat .antigravity_session # → abc123
|
||||
# echo $LAST_ANTIGRAVITY_SESSION # → abc123
|
||||
|
||||
# 1. Read the JSON from stdin
|
||||
set -l input (cat)
|
||||
|
||||
# 2. Extract session_id using Python
|
||||
# If python3 is unavailable, emit valid empty JSON and skip session
|
||||
# tracking rather than erroring (see AGENTS.md Convention §6).
|
||||
if not type -q python3
|
||||
echo '{}'
|
||||
exit 0
|
||||
end
|
||||
set -l sid (echo $input | python3 -c "import sys,json; print(json.load(sys.stdin).get('session_id', ''))")
|
||||
set -l session_file ".antigravity_session"
|
||||
|
||||
if test -n "$sid"
|
||||
# 3. Save the session ID locally
|
||||
echo "$sid" >$session_file
|
||||
|
||||
# 4. Smart .gitignore check
|
||||
# We only attempt this if we are inside a Git repository
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1
|
||||
# If 'git check-ignore' fails, it means the file is NOT currently ignored
|
||||
if not git check-ignore -q $session_file
|
||||
# Append a labeled entry to .gitignore
|
||||
echo -e "\n# AI Session IDs\n$session_file" >>.gitignore
|
||||
end
|
||||
end
|
||||
|
||||
# 5. Update universal variable for cross-terminal access
|
||||
set -U LAST_ANTIGRAVITY_SESSION "$sid"
|
||||
end
|
||||
|
||||
# MANDATORY: Every hook must output valid JSON or an empty object
|
||||
echo '{}'
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# SYNOPSIS
|
||||
# Invoked as a Claude Code session hook; reads JSON from stdin.
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Hook script called by Claude Code on session start. Reads a JSON payload
|
||||
# from stdin, extracts the session_id field, and writes it to .claude_session
|
||||
# in the current directory. Ensures that file is excluded via .gitignore.
|
||||
# Sets the universal variable LAST_CLAUDE_SESSION for cross-terminal access.
|
||||
# Falls back to a no-op (emitting "{}") when python3 is unavailable
|
||||
# (Convention §6).
|
||||
#
|
||||
# ARGUMENTS
|
||||
# stdin JSON payload from Claude Code containing a "session_id" key
|
||||
#
|
||||
# RETURNS
|
||||
# 0 Always; emits "{}" to stdout as required by the hook contract
|
||||
#
|
||||
# EXAMPLE
|
||||
# echo '{"session_id":"abc123"}' | fish save_claude_session.fish
|
||||
# cat .claude_session # → abc123
|
||||
# echo $LAST_CLAUDE_SESSION # → abc123
|
||||
|
||||
# 1. Read input and extract session ID
|
||||
# python3 parses the session_id out of the hook's JSON payload. If it is
|
||||
# unavailable we emit valid empty JSON and skip session tracking rather
|
||||
# than erroring (see AGENTS.md Convention §6).
|
||||
set -l input (cat)
|
||||
if not type -q python3
|
||||
echo '{}'
|
||||
exit 0
|
||||
end
|
||||
set -l sid (echo $input | python3 -c "import sys,json; print(json.load(sys.stdin).get('session_id', ''))")
|
||||
set -l session_file ".claude_session"
|
||||
|
||||
if test -n "$sid"
|
||||
# 2. Save the session ID locally
|
||||
echo "$sid" >$session_file
|
||||
|
||||
# 3. Smart .gitignore check
|
||||
# We check if git even knows about this file.
|
||||
# If 'git check-ignore' returns 1, it means the file is NOT ignored.
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1
|
||||
if not git check-ignore -q $session_file
|
||||
# Append the filename to .gitignore
|
||||
echo -e "\n# AI Session IDs\n$session_file" >>.gitignore
|
||||
echo "Added $session_file to .gitignore"
|
||||
end
|
||||
end
|
||||
|
||||
# 4. Update universal variable
|
||||
set -U LAST_CLAUDE_SESSION "$sid"
|
||||
end
|
||||
|
||||
# MANDATORY: Every hook must output valid JSON
|
||||
echo '{}'
|
||||
Reference in New Issue
Block a user