SE

session-isolation

Prevents file collisions in multi-artifact workflows using isolated session directories.

Install

mkdir -p .claude/skills/session-isolation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9162" && unzip -o skill.zip -d .claude/skills/session-isolation && rm skill.zip

Installs to .claude/skills/session-isolation

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when orchestrating workflows that generate multiple files (designs, reviews, reports) to prevent file collisions across concurrent or sequential sessions with unique session directories.
190 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Generate unique session directories for artifact storage.
  • Prevent file overwrites in concurrent or sequential workflows.
  • Organize generated files by session and artifact type.
  • Pass session paths to sub-agents for consistent file saving.
  • Update session metadata upon workflow completion.

How it works

The orchestrator generates a unique session path and creates a corresponding directory structure. This path is then passed to sub-agents, which use it to save all generated artifacts, ensuring isolation.

Inputs & outputs

You give it
Orchestrator command with `TARGET_NAME`, `WORKFLOW_TYPE`, `USER_REQUEST` variables, and agent prompts with `SESSION_PATH`.
You get back
A directory structure like `ai-docs/sessions/agentdev-seo-20260105-143022-a3f2/` containing artifacts and `session-meta.json`.

When to use session-isolation

  • Isolating files for concurrent AI runs
  • Preventing overwrite in multi-phase tasks
  • Organizing report artifacts by session
  • Managing temporary workflow data

About this skill

Session Isolation Pattern

Session-based artifact isolation for multi-artifact workflows. Use when orchestrating workflows that generate multiple files (designs, reviews, reports) to prevent file collisions across concurrent or sequential sessions.

Problem

When multiple workflows run (even sequentially), artifacts with the same name collide:

Session 1 (SEO): writes ai-docs/plan-review-grok.md
Session 2 (API): writes ai-docs/plan-review-grok.md  <-- OVERWRITES!

Solution

Use unique session folders to isolate artifacts:

ai-docs/sessions/agentdev-seo-20260105-143022-a3f2/
├── session-meta.json      # Session tracking
├── design.md              # Primary artifact
├── reviews/
│   ├── plan-review/       # Plan review phase
│   │   ├── internal.md
│   │   ├── grok.md
│   │   └── consolidated.md
│   └── impl-review/       # Implementation review phase
│       ├── internal.md
│       └── consolidated.md
└── report.md              # Final report

Implementation Pattern

1. Session Initialization (Orchestrator)

Add to Phase 0 of your orchestrator command:

# Generate unique session path
TARGET_SLUG=$(echo "${TARGET_NAME:-workflow}" | tr '[:upper:] ' '[:lower:]-' | sed 's/[^a-z0-9-]//g' | head -c20)
SESSION_BASE="${WORKFLOW_TYPE}-${TARGET_SLUG}-$(date +%Y%m%d-%H%M%S)-$(head -c4 /dev/urandom | xxd -p | head -c4)"
SESSION_PATH="ai-docs/sessions/${SESSION_BASE}"

# Create directory structure
mkdir -p "${SESSION_PATH}/reviews/plan-review" \
         "${SESSION_PATH}/reviews/impl-review" || {
  echo "Warning: Cannot create session directory, using legacy mode"
  SESSION_PATH="ai-docs"
}

# Create session metadata (if not legacy mode)
if [[ "$SESSION_PATH" != "ai-docs" ]]; then
  cat > "${SESSION_PATH}/session-meta.json" << EOF
{
  "session_id": "${SESSION_BASE}",
  "type": "${WORKFLOW_TYPE}",
  "target": "${USER_REQUEST}",
  "started_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
  "status": "in_progress"
}
EOF
fi

2. Pass SESSION_PATH to Sub-Agents

Include in all agent prompts:

SESSION_PATH: ${SESSION_PATH}

{actual task description}

Save output to: ${SESSION_PATH}/{artifact_path}

3. Sub-Agent SESSION_PATH Detection

Add to agent <critical_constraints>:

<session_path_support>
  **Check for Session Path Directive**

  If prompt contains `SESSION_PATH: {path}`:
  1. Extract the session path
  2. Use it for all output file paths
  3. Primary artifact: `${SESSION_PATH}/{type}.md`
  4. Reviews: `${SESSION_PATH}/reviews/{phase}/{model}.md`

  **If NO SESSION_PATH**: Use legacy paths (ai-docs/)
</session_path_support>

4. Session Completion

Update metadata when workflow completes:

if [[ -f "${SESSION_PATH}/session-meta.json" ]]; then
  jq '.status = "completed" | .completed_at = (now | strftime("%Y-%m-%dT%H:%M:%SZ"))' \
    "${SESSION_PATH}/session-meta.json" > "${SESSION_PATH}/session-meta.json.tmp" && \
  mv "${SESSION_PATH}/session-meta.json.tmp" "${SESSION_PATH}/session-meta.json"
fi

Artifact Path Mapping

Artifact TypeSESSION_PATH FormatLegacy Format
Design/Context${SESSION_PATH}/design.mdai-docs/agent-design-{name}.md
Plan Review${SESSION_PATH}/reviews/plan-review/{model}.mdai-docs/plan-review-{model}.md
Impl Review${SESSION_PATH}/reviews/impl-review/{model}.mdai-docs/impl-review-{model}.md
Consolidated${SESSION_PATH}/reviews/{phase}/consolidated.mdai-docs/{phase}-consolidated.md
Final Report${SESSION_PATH}/report.mdai-docs/{workflow}-report-{name}.md

Backward Compatibility

Legacy Mode Triggers:

  1. SESSION_PATH not provided in prompt
  2. Directory creation fails (permissions)
  3. Explicit LEGACY_MODE: true in prompt

Behavior:

  • Fall back to flat ai-docs/ paths
  • Log warning about legacy mode
  • All features still work, just without isolation

Session Metadata Schema

{
  "session_id": "agentdev-seo-20260105-143022-a3f2",
  "type": "agentdev",
  "target": "SEO agent improvements",
  "started_at": "2026-01-05T14:30:22Z",
  "completed_at": "2026-01-05T15:45:30Z",
  "status": "completed",
  "phases_completed": ["init", "design", "plan-review", "implementation", "quality-review"],
  "models_used": ["claude-embedded", "x-ai/grok-code-fast-1", "google/gemini-3-pro"],
  "artifacts": {
    "design": "design.md",
    "plan_reviews": ["reviews/plan-review/internal.md", "reviews/plan-review/grok.md"],
    "impl_reviews": ["reviews/impl-review/internal.md", "reviews/impl-review/gemini.md"],
    "report": "report.md"
  }
}

Plugins Using Session Isolation

PluginCommandSession Pattern
agentdev/developagentdev-{target}-{timestamp}-{random}
frontend/review, /implementreview-{timestamp}-{random}
seo/review, /alternativesseo-review-{timestamp}-{random}
multimodel/teamteam-{task-slug}-{timestamp}-{random}

Team Session Example

The /team command creates a session for multi-model blind voting:

ai-docs/sessions/team-stats-validation-20260209-143022-a3f2/
├── task.md                 # Raw task description (shared by all models)
├── grok-result.md          # Grok's investigation findings
├── gemini-result.md        # Gemini's investigation findings
├── deepseek-result.md      # DeepSeek's investigation findings
├── internal-result.md      # Internal Claude's findings
└── verdict.md              # Aggregated verdict with vote breakdown

Key difference from other plugins: Team sessions contain results from multiple AI models investigating the same task independently. Each model writes to its own result file to prevent conflicts during parallel execution.

Best Practices

  1. Always initialize early: Session creation should happen in Phase 0
  2. Include SESSION_PATH in all prompts: Sub-agents need it for output paths
  3. Use descriptive slugs: Include workflow type and target in folder name
  4. Update metadata on completion: Track status changes
  5. Fallback gracefully: Never fail the workflow due to session creation issues

When not to use it

  • When `SESSION_PATH` is not provided in the prompt.
  • When directory creation fails due to permissions.
  • When `LEGACY_MODE: true` is explicitly set in the prompt.

Limitations

  • The skill falls back to legacy mode if the session directory cannot be created.
  • The skill falls back to legacy mode if `SESSION_PATH` is not provided in the prompt.
  • The skill falls back to legacy mode if `LEGACY_MODE: true` is explicitly set.

How it compares

This pattern automatically creates and manages unique directories for each workflow run, unlike manual approaches that risk file collisions from identically named outputs.

Compared to similar skills

session-isolation side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
session-isolation (this skill)06moReviewIntermediate
pptx3936moReviewAdvanced
nano-pdf632moReviewBeginner
video-downloader1017moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by MadAppGang

View all by MadAppGang

claudish-usage

MadAppGang

CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models). NEVER run Claudish directly in main context unless user explicitly requests it. Use when user mentions external AI models, Claudish, OpenRouter, Gemini, OpenAI, Ollama, or alternative models. Includes mandatory sub-agent delegation patterns, agent selection guide, file-based instructions, and strict rules to prevent context window pollution.

442

golang-performance

MadAppGang

Use when profiling Go applications (pprof), running benchmarks, optimizing memory/CPU usage, or debugging performance bottlenecks in production Go code.

47

golang

MadAppGang

Use when building Go backend services, implementing goroutines/channels, handling errors idiomatically, writing tests with testify, or following Go best practices for APIs/CLI tools.

313

schemas

MadAppGang

YAML frontmatter schemas for Claude Code agents and commands. Use when creating or validating agent/command files.

34

external-model-selection

MadAppGang

Choose optimal external AI models for code analysis, bug investigation, and architectural decisions. Use when consulting multiple LLMs via claudish, comparing model perspectives, or investigating complex Go/LSP/transpiler issues. Provides empirically validated model rankings (91/100 for MiniMax M2, 83/100 for Grok Code Fast) and proven consultation strategies based on real-world testing.

218

adr-documentation

MadAppGang

Architecture Decision Records (ADR) documentation practice. Use when documenting architectural decisions, recording technical trade-offs, creating decision logs, or establishing architectural patterns. Trigger keywords - "ADR", "architecture decision", "decision record", "trade-offs", "architectural decision", "decision log".

12

You might also like

pptx

anthropics

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

393763

nano-pdf

openclaw

Edit PDFs with natural-language instructions using the nano-pdf CLI.

63300

video-downloader

ComposioHQ

Downloads videos from YouTube and other platforms for offline viewing, editing, or archival. Handles various formats and quality options.

101255

youtube-transcript

michalparkola

Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.

68277

using-superpowers

obra

Use when starting any conversation - establishes mandatory workflows for finding and using skills, including using Skill tool before announcing usage, following brainstorming before coding, and creating TodoWrite todos for checklists

95205

browser-automation

browserbase

Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Triggers include "browse", "navigate to", "go to website", "extract data from webpage", "screenshot", "web scraping", "fill out form", "click on", "search for on the web". When taking actions be as specific as possible.

39230

Search skills

Search the agent skills registry