spectre-capture
Capture durable project decisions, accepted corrections, verified reusable patterns or gotchas, disproved guidance, and changed…
Clear session memory - archive all session files so next session starts fresh
$ npx -y skills add joenandez/spectre --skill spectre-forget --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spectre-forgetContext preview
The summary Claude sees to decide when to auto-load this skill.
Clear session memory - archive all session files so next session starts fresh
name: "spectre-forget" description: "Clear session memory - archive all session files so next session starts fresh" user-invocable: true disable-model-invocation: true
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)
canonical_dir=".spectre/handoffs/${branch}"
legacy_dir="docs/tasks/${branch}/session_logs"
archived_count=0
for session_dir in "$canonical_dir" "$legacy_dir"; do
[ -d "$session_dir" ] || continue
archive_dir="${session_dir}/archive"
while IFS= read -r -d '' session_file; do
mkdir -p "$archive_dir"
mv "$session_file" "$archive_dir/"
archived_count=$((archived_count + 1))
done < <(
find "$session_dir" -maxdepth 1 -type f \
\( -name '*_handoff.json' -o -name '*_todos.json' -o -name 'todos_history.json' \) \
-print0
)
done
if [ "$archived_count" -eq 0 ]; then
echo "NO_SESSIONS"
exit 0
fi
echo "ARCHIVED:${archived_count}"Archive only the current branch's active, top-level files in `.spectre/handoffs/{branch}/` and the matching legacy `docs/tasks/{branch}/session_logs/`. Do not scan another branch, descend into an existing `archive/`, merge the roots, or restore an archived file. The raw branch name is used directly; slash-containing branches intentionally nest.
**If** output is `NO_SESSIONS`: > No session logs found for this branch. Memory is already clear.
**Else** (output is `ARCHIVED:N`): > ✓ Session memory cleared > > Archived {N} session file(s) under the matching `.spectre/handoffs/{branch}/archive/` and legacy `docs/tasks/{branch}/session_logs/archive/` directories. > > **Next**: Start a new session with `/clear` or close this terminal. Your next session will start fresh without auto-loaded context.
SPECTRE is an Agentic Engineering workflow for Claude Code and Codex designed to help you do ONE THING more, faster, and with higher quality.
Capture durable project decisions, accepted corrections, verified reusable patterns or gotchas, disproved guidance, and changed…
Run final adversarial review through a pinned high-effort opposing runtime with one native fallback. Use at the final boundary to…
Generate a grounded draft pull request from the actual diff and open it via gh. Use when wrapping up a branch or writing a PR…
Assess and repair a project's Spectre knowledge, work history, tags, and retrieval quality through primary-led decisions,…
Execute tasks/plans with checks/reviews/proof. Use after planning/resume. Not for planning, unplanned fixes, or pruning.
Internal initializer for a missing Spectre feature root. Invoke only from a standalone workflow with no confirmed managed root.…