From theclauu
Use for session continuity — saving progress, resuming work, labeling a session for /resume.
npx claudepluginhub artemis-xyz/theclauu --plugin theclauuThis skill uses the workspace's default tool permissions.
Three modes plus a lightweight checkpoint pattern. Pick based on intent:
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Three modes plus a lightweight checkpoint pattern. Pick based on intent:
========================================
Validate, prune, capture, and write. Counterpart to /context-resume.
Target: 2-3 minutes interactive, under 1 minute with --auto.
Parse $ARGUMENTS:
--auto: Fully non-interactive. Never ask the user anything. Auto-fix verifiable issues, silently skip ambiguous ones, auto-save learnings, auto-write handoff.This step runs first, before capturing anything new. Review what's currently saved and prune stale or incorrect items.
Read the project's MEMORY.md (at ~/.claude/projects/<project-path>/memory/MEMORY.md). For each memory entry:
With --auto: Silently update or remove stale memories. Keep unverifiable ones. No user interaction.
Without --auto: Present stale items and proposed fixes. Ask once: "Update these? Pick numbers, edit, or skip."
If a previous handoff file exists at ~/.claude/notes/projects/<slug>/context-resume.md:
gh pr view)This informs Step 4 — the new handoff overwrites the old one, but knowing what changed helps write better next steps.
If ~/.claude/notes/ contains project-scoped notes or lessons, scan for:
With --auto: Silently remove or update verifiably stale notes.
Without --auto: Flag stale notes and ask once.
Gather everything automatically — no user interaction needed.
Run in parallel:
git log --oneline --since="8 hours ago" (adjust if user specifies a timeframe)git diff --stat + git stash listgh pr list --author @me --json number,title,state,updatedAtdocumentation/planning/ for status markers (IN PROGRESS, PENDING, COMPLETE)Present a brief summary of findings.
Dirty working tree:
--auto: Leave uncommitted changes as-is. Note them in the handoff file.--auto: Ask once: "Uncommitted changes — commit first or leave them?"Review the session for knowledge worth persisting. Look for:
Scope each item:
~/.claude/projects/<project-path>/memory/~/.claude/notes/ (use /notes or /lessons conventions)With --auto: Auto-save all identified learnings without asking. Classify and write silently. Skip anything ambiguous about scope — default to project-scoped.
Without --auto: Present all candidates in a numbered list grouped by destination. Ask once: "Add any? Pick numbers, edit, or skip." Do not ask separate rounds for notes vs lessons.
Size checks (mention only if exceeded):
--auto by removing lowest-value entries)Changelog: If CHANGELOG.md exists, compare session commits against [Unreleased]. Flag missing entries.
--auto: Auto-add missing changelog entries.--auto: Offer to add them.If no changelog, skip silently.
Stale plans: If documentation/planning/ exists, check for:
✅ COMPLETE but still in documentation/planning/.--auto: Auto-archive completed plans via git mv. Flag stale plans in the handoff file for next session's attention.--auto: Offer archive/delete/skip.If none found, skip silently.
Location: ~/.claude/notes/projects/<project-slug>/context-resume/<branch-key>.md
Per-branch handoff files coexist — you get a separate handoff for each branch/worktree, overwritten each session on that branch but not across branches.
Slug derivation: Git remote org/repo with / replaced by --. Fallback: directory name. Must match what /context-resume uses.
Branch key derivation (in this order):
git branch --show-current → if non-empty, sanitize by replacing / with - (e.g., feat/auth-redesign → feat-auth-redesign). This is the branch key._detached-<sha-short> (e.g., _detached-abc1234)_unknownWorktree note: Worktrees are branch-scoped in git — a worktree = a branch checked out at a different path. The branch name is the right key; worktree path is not needed.
Write tool creates parent directories automatically.
Required output shape (YAML frontmatter at top, then free-form body):
---
written_at: <ISO 8601 timestamp w/ timezone, e.g. 2026-04-22T14:45:32-04:00>
branch: <branch-key>
slug: <project-slug>
summary: <one-line summary of what the session did — max 120 chars; used by /gm hivemind briefing to orient the next session>
---
# Session handoff — <repo> / <branch> — <YYYY-MM-DD local date>
## Session summary
<1-3 sentence narrative: what did we do, why>
## Current state
<repo / branch / working tree / open PRs or tags>
## Shipped this session
<concise bullets or table>
## Next steps
<what should the next session pick up>
## Notes for next session
<surprising/gotchas/context not obvious from the code>
The frontmatter is parsed by TheClauu's hive-mind cache (bin/sources/handoffs.py) to surface a one-liner at session-start (e.g., "Last handoff 2h ago — '…summary…'"). The written_at timestamp and summary are therefore non-optional; other frontmatter fields are informational.
The handoff file is agent-optimized — structured for machine parsing, not human reading. It's ephemeral and overwritten each session on the same branch.
After writing:
--auto: Silent.--auto: "Handoff written to ~/.claude/notes/projects/<slug>/context-resume/<branch>.md. Use /context-resume next session on this branch."After writing the local handoff file, also push the session context to the shared Notion "Data Team Session Log" database so teammates can see exactly where you left off.
Run (in the background, non-blocking):
python3 <plugin-root>/bin/dump_session_context.py <cwd> <transcript_path>
Where <plugin-root> is the TheClauu plugin install root (available as $CLAUDE_PLUGIN_ROOT in hooks, or derive from the skill's own path).
Graceful degradation: If notion_session_log_db_id is not set in ~/.theclauu/config.json, the script is a silent no-op. Never block or error-message the user because of a missing Notion config.
What this writes to Notion:
With --auto: run silently, no output.
Without --auto: if the dump succeeded and Notion was configured, optionally note "Session context also written to Notion (Data Team Session Log)."
Other skills should trigger /session-handoff --auto at natural end-of-work boundaries:
/commit-push-pr — after PR is created, suggest or auto-run handoff/implement-plan — after final phase is completesystemctl restart or session teardown&&, ||, or ;. Make separate parallel tool calls instead — allowed-tools patterns only match simple commands, not compound ones.--auto, never ask. Auto-fix verifiable issues, skip ambiguous ones, save learnings, write handoff. Zero interaction.========================================
Restore context fast. Target: under 30 seconds.
Derive the project slug:
git remote get-url origin — extract org/repo (e.g., artemis-xyz/api-server)/ with -- for the file path (e.g., artemis-xyz--api-server)Derive the branch key:
git branch --show-current → if non-empty, replace / with - (e.g., feat/auth-redesign → feat-auth-redesign)_detached-<sha-short>_unknownHandoff lookup, in order:
Notion Session Log (v0.4+, team-visible): If notion_session_log_db_id is set in ~/.theclauu/config.json, query the "Data Team Session Log" DB for a page matching the current branch. Use bin/sources/notion.py::find_session_page_by_branch. If found, read its Done / In progress / Gotchas / Resume sections and surface them. Attribution line: "(from team Notion log — last edited by <Engineer> <N>h ago)". This means a teammate's handoff is visible even if they never ran /session-handoff locally — the SessionEnd hook writes to Notion automatically.
If the Notion lookup fails (API down, token missing, db_id not configured), fall through silently to step 1.
Branch-specific (v0.3.5+): ~/.claude/notes/projects/<slug>/context-resume/<branch-key>.md
Legacy single-file fallback: ~/.claude/notes/projects/<slug>/context-resume.md (from v0.3.4 and earlier)
Cross-context fallback (v0.3.25+): If nothing found for the current slug, look at the TheClauu hive-mind cache at ~/.theclauu/cache.json. Read handoffs.all[0] — if it exists and age_seconds < 86400 (<24h), it's a recent handoff from a different slug (e.g. user ran /session-handoff from a subrepo then opened the next session in the parent workspace). Surface it explicitly: "Fresh handoff on <slug>/<branch> from N minutes ago — <summary>. To fully resume that thread: cd <slug-short> && claude then /context-resume. Otherwise continuing fresh here."
No handoff found: list any sibling context-resume/*.md files (i.e., handoffs for other branches) and print: "No handoff for this branch. Other branches have handoffs: [list]. Work fresh, or manually read one of those?"
When a handoff is found, read it — this is the most valuable context. Staleness check: if older than 14 days, flag it ("Last handoff was N days ago — context may be stale") but still read it. Weight the live scan more heavily when stale.
Do NOT fall back to stale legacy handoffs (e.g., a 2+ week old file) when a fresh cross-slug handoff exists — the cross-slug one is always higher signal than a stale current-slug one. Prefer recent over exact-match.
Run these in parallel:
Git: git status, git log --oneline -15, git branch --list, git stash list
PRs: gh pr list --author @me, gh pr list --review-requested @me
Plan docs: ONLY if the repo has a documentation/planning/ directory (exact path, not a generalized plans/ search). Grep for IN PROGRESS and PENDING status markers. Check for 00_OVERVIEW.md or 00_TECH_DEBT.md. Also flag any sessions where all phases are ✅ COMPLETE but haven't been archived to documentation/archive/ — suggest archiving. Do NOT scan docs/superpowers/plans/ or other legacy claudefather paths — those belong to a deprecated system and surfacing them as "active" adds noise.
Project context: Skim CHANGELOG.md unreleased section if present.
Do NOT read CLAUDE.md or MEMORY.md here — Claude already has those in context.
Use the format from references/templates.md.
Suggest what to work on, prioritized:
<slug>/<branch> N minutes ago: <summary>. Resume that thread?" (Always wins; even over current-repo signals, because it's the engineer's last action in any context.)/implement-plan?"/review-pr N?"Ask: "What would you like to focus on?"
&&, ||, or ;. Make separate parallel tool calls instead — allowed-tools patterns only match simple commands, not compound ones.org/repo with / to --, directory name fallback.========================================
Generate a descriptive session name in the format: DESCRIPTION - REPO#PR - BRANCH (all caps).
The session name must reflect what this session actually did — not just whatever branch is currently checked out. Sessions often switch branches, run in worktrees, or do investigative work unrelated to the current HEAD. Ground the name in the conversation, then use git state to confirm (or flag divergence).
Before running any commands, write down in your head:
This synthesis is the primary input. Steps 2–4 gather evidence to reconcile it with git state.
Run these in parallel:
git branch --show-current
git worktree list
git log --walk-reflogs --oneline -20 HEAD # branches visited recently
git log --oneline -10 --all --source # commits across all branches
git status --short # uncommitted work on current branch
basename $(git remote get-url origin) .git
If the session mentioned a specific PR/branch not on this checkout, also check it directly:
gh pr view <number> --json number,title,headRefName
gh pr list --head <branch> --json number,title --limit 1
Compare the Step 1 synthesis against the Step 2 signals. One of these is true:
A. Match — current branch and its PR (if any) reflect the session's work.
→ Use DESCRIPTION - REPO#PR - BRANCH.
B. Mismatch (the common failure mode) — current branch is unrelated; real work was elsewhere. Signs of mismatch:
reflog shows we switched away from the work branch recently.When mismatched, do not silently take the current branch. Choose one:
DESCRIPTION alone.C. No git context — not in a repo, or session spanned unrelated repos.
→ Use DESCRIPTION alone.
AUTH FLOW REFACTOR, FIX STALE CACHE BUG, DEXS SWAP PAIRS DEDUP DIAGNOSISDESCRIPTION - REPO#NUMBER - BRANCHDESCRIPTION - BRANCHDESCRIPTIONAll caps. Output as:
/rename DESCRIPTION - REPO#NUMBER - BRANCH
If you detected a mismatch in Step 3, append one short note after the command explaining what you chose and why — so the user can correct you in one turn instead of getting a wrong name silently.
Matched:
/rename AUTH FLOW REFACTOR - HUNTRESS#53 - FEAT/AUTH-REDESIGN
Investigative, current branch unrelated:
/rename DEXS SWAP PAIRS DEDUP DIAGNOSIS
Note: current branch FEAT/NATIVE-TRANSFERS-P2P-CLASSIFICATION (PR #3769) is unrelated to this session's work — dropped branch/PR from the name.
Session ended on wrong branch after context switch:
/rename FIX STALE CACHE BUG - DBT#3443 - FIX/CACHE-INVALIDATION
Note: HEAD is on main, but this session's work landed on fix/cache-invalidation (PR #3443) per reflog — named by the work branch, not HEAD.
========================================
Consolidated from legacy skills. Pick the mode/lens based on intent.