skills/cli-agents/claude-code-invoke-persist/SKILL.md
Create and resume Claude Code CLI sessions with a persistent session-name-to-session_id mapping (plus last-used model and reasoning effort) stored in a workspace-scoped JSON file under system temp. Use when the user wants deterministic, session-persistent Claude Code automation across turns and processes.
npx skillsauth add igamenovoer/magic-context claude-code-invoke-persistInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Invoke this skill explicitly by name ($claude-code-invoke-persist) because it may execute the claude CLI.
If the user provides a claude-compatible wrapper command (drop-in replacement for claude), use it by passing --claude-cmd "<wrapper command...>" to scripts/invoke_persist.py (or set CLAUDE_CMD). The wrapper must be an executable command (not a shell alias) and must accept the claude flags used here (-p, --output-format, --resume, --model, --effort, --append-system-prompt, and streaming flags).
resume-stream) so stdout emits a steady heartbeat (one JSON object per line).--deadline-seconds to the helper.The skill itself is triggered by name, but once invoked, pick a stage based on user intent:
Creation (create-session)
session name (the user may call it a "session alias").md (system prompt): --role-definition-md /abs/path/to/role.md (appended via claude --append-system-prompt)--model ... (stored as last_model for later resumes)--reasoning-effort ... (mapped to claude --effort; stored as last_reasoning_effort)--claude-cmd "..." / CLAUDE_CMD--deadline-seconds ... only when the user explicitly requested a time limit.md (if provided).bad.<pid> and .tmp.<pid>)Invocation (resolve, resume-json, resume-stream)
prompt plus session_id or session namesession name via the workspace mapping JSON (unless session_id is provided)claude --resume <session_id> (or wrapper via --claude-cmd/CLAUDE_CMD)--model / --reasoning-effort from stored last_model / last_reasoning_effort when not explicitly providedlast_* values after a successful call--deadline-seconds only when the user explicitly requested a time limitListing (list-sessions)
workspace dir or explicit mapping fileDeletion (delete-session, delete-all-sessions)
session_id or session name, or explicit "all sessions"workspace dir or explicit mapping file.bad.<pid>/.tmp.<pid>) or deletes the mapping file entirely; does not call claudeManagement file (session mapping JSON): <system-tmp>/agent-sessions/<workspace-basename>-<md5(abs-workspace-dir)>/claude-code-alias-mapping.json (override with --mapping-file).
references/creation.md.references/invocation.md.references/listing.md.references/deletion.md.session name (the user may call it a "session alias").session_id, always use it as the resume target.session_id or session name in this conversation. If none exists, ask which session to use.last_model and last_reasoning_effort per session name.--model / --reasoning-effort, use the stored last_model / last_reasoning_effort.--model and/or --reasoning-effort, use those values for this call and persist them as the new last_* defaults for next time.references/creation.mdreferences/invocation.mdreferences/listing.mdreferences/deletion.mdscripts/invoke_persist.py (create-session, resolve, list-sessions, delete-session, delete-all-sessions, resume-json, resume-stream)data-ai
Create readable Mermaid diagrams inside Markdown files. Use for flowcharts and sequence diagrams that must render cleanly in common Markdown renderers (e.g., GitHub) without horizontal scrolling. Covers fenced mermaid blocks, init/theme styling, label wrapping with <br/>, and sequenceDiagram layout rules (short IDs, wrapped labels, don’t break identifiers).
development
Manual invocation only; use only when the user explicitly requests `make-program-tutorial` by exact name, OR when the user asks to use a skill to create an SDK/API/library tutorial. Create a clear, reproducible, step-by-step tutorial for a specific API/SDK/library (or a set of functions/classes), with runnable examples, expected outputs, and basic troubleshooting.
testing
Use when the user wants to create a self-hosted, offline-installable Conda channel (mirror) containing a specific subset of packages using Pixi.
tools
Guides the agent to setup a new or existing Pixi environment for compiling C++ and CUDA code. It ensures the correct compilers, toolkits, and CMake configurations are in place for a robust user-space build.