Skip to content
Back to skills

Save

BSecurity

Save current session transcript to markdown with per-turn token counts, cost breakdown, and context usage.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
toolsbashgit

Works with

  • claude code

Security analysis

B88/100
  • criticalSends environment variables or credentials to an external URL

Pro scans all 4 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add AI-native-Systems-Research/ai-native-storage-certus --skill save --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Save?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Save
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/ai-native-systems-research-save/badge)](https://www.skillsdirectory.com/skills/ai-native-systems-research-save)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: save
description: Save current session transcript to markdown with per-turn token counts, cost breakdown, and context usage.
allowed-tools: Bash(*)
argument-hint: "[output_path]"
---

Save the current Claude Code session transcript as a markdown file with token usage, cost stats (/cost), and context window utilization (/context). Never overwrites existing files — appends -1, -2, etc. suffixes.

The user may pass an optional output path as an argument. If provided, use it as OUT. Otherwise default to the current directory.

## Steps

1. Find the most recent session JSONL. Try exact project key first, then fall back to the most recently modified JSONL across all projects (which is almost certainly this session):

```bash
PROJECT_KEY=$(pwd | sed 's|/|-|g')
JSONL=$(ls -t ~/.claude/projects/${PROJECT_KEY}/*.jsonl 2>/dev/null | head -1)
if [[ -z "$JSONL" ]]; then
    JSONL=$(find ~/.claude/projects/ -maxdepth 2 -name '*.jsonl' -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-)
fi
if [[ -z "$JSONL" ]]; then
    echo "No session JSONL found" >&2
    exit 1
fi
echo "JSONL: $JSONL"
```

2. Determine output path — use the argument if provided, otherwise save to current directory. If the argument is a directory, create the transcript file inside it:

```bash
SESSION_ID=$(basename "$JSONL" .jsonl)
DATE=$(date +%Y-%m-%d)
DEFAULT_NAME="transcript_${SESSION_ID}_${DATE}.md"
if [[ -n "$ARGUMENTS" ]]; then
    if [[ -d "$ARGUMENTS" ]]; then
        OUT="${ARGUMENTS%/}/${DEFAULT_NAME}"
    else
        OUT="$ARGUMENTS"
    fi
else
    OUT="$(pwd)/${DEFAULT_NAME}"
fi
```

3. Find and run the save script relative to the repo root:

```bash
SAVE_SCRIPT="$(git rev-parse --show-toplevel 2>/dev/null)/.claude/skills/save/save.sh"
if [[ ! -f "$SAVE_SCRIPT" ]]; then
    echo "save.sh not found at: $SAVE_SCRIPT" >&2
    exit 1
fi
bash "$SAVE_SCRIPT" "$JSONL" "$OUT"
```

4. Report the output path and total estimated cost.

Files in this skill

  • README.md2.2 KB
  • SKILL.md1.9 KB
  • autosave.sh876 B
  • save.sh5.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.