workspace
Launch a new named Claude Code session, optionally resuming an existing session by ID. The workspace name is only a display label — the working directory is always $WORKSPACES_DIR (default ~/workspace), or the explicitly provided second argument. Never append the name to the path. Use when the user wants to open a new Claude instance with a given name.
What this skill does
# /workspace
Launch a named Claude Code session in a new terminal tab.
Usage: `/workspace <name> [directory] [session_id]`
- `name` — session display name only (never used as a path component)
- `directory` — working directory (optional; defaults to the `WORKSPACES_DIR` env var, or `~/workspace` if unset)
- `session_id` — UUID of an existing session to resume (optional; if provided, tries `--resume` first, then falls back to `--session-id`)
**IMPORTANT: The workspace name is NOT appended to the directory. It is only used as the session title.**
---
## Instructions
### Step 1: Parse Arguments
Inspect `<command-args>`:
- **If empty:** ask the user for a workspace name. **STOP**.
- **First token** = `WORKSPACE_NAME` (display label only, not a path)
- **Second token** (if present) = `WORKSPACE_DIR`
- **Third token** (if present) = `SESSION_ID` (skip Step 4 if provided)
### Step 2: Resolve the Working Directory
If `WORKSPACE_DIR` was **not** provided by the user, run:
```bash
echo "${WORKSPACES_DIR:-$HOME/workspace}"
```
Use the printed value as `WORKSPACE_DIR`.
**Do NOT append `WORKSPACE_NAME` to this path under any circumstances.**
### Step 3: Detect Platform
```bash
if command -v wt.exe &>/dev/null || command -v cmd.exe &>/dev/null; then echo "windows"; else echo "linux"; fi
```
Store as `PLATFORM`.
**If Windows (`windows`):** convert the directory to a Windows-style path for `wt.exe`:
```bash
cygpath -w "<WORKSPACE_DIR>"
```
Use the result as `WORKSPACE_DIR_WIN`. If `cygpath` is unavailable, manually replace a leading `/c/` with `C:\` and convert remaining `/` to `\`.
**If Linux (`linux`):** no path conversion needed.
### Step 4: Resolve the Session ID
If `SESSION_ID` was provided in Step 1, use it and set `RESUME_MODE` to `true`.
Otherwise, generate a new one:
```bash
uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid 2>/dev/null || python3 -c "import uuid; print(uuid.uuid4())"
```
Store as `SESSION_ID` and set `RESUME_MODE` to `false`. The result **must** be a valid UUID — do not fall back to timestamp-based IDs.
### Step 5: Launch the Session
**If `RESUME_MODE` is `true`**, first attempt to launch with `--resume <SESSION_ID>`. If the resume attempt fails (non-zero exit), fall back to launching with `--session-id <SESSION_ID>` instead (same commands below, replacing `--resume` with `--session-id`).
**If `RESUME_MODE` is `false`**, launch directly with `--session-id <SESSION_ID>`.
#### Windows (WSL)
```bash
wt.exe new-tab --title "<WORKSPACE_NAME>" -d "<WORKSPACE_DIR_WIN>" -- "C:\Users\etgarcia\.local\bin\claude.exe" --dangerously-skip-permissions --remote-control --resume <SESSION_ID> --name "<WORKSPACE_NAME>"
```
**Fallback chain** if `wt.exe` fails:
1. `psmux.exe new-window -n "<WORKSPACE_NAME>" -- cmd /c "cd /d <WORKSPACE_DIR_WIN> && C:\Users\etgarcia\.local\bin\claude.exe --dangerously-skip-permissions --remote-control --resume <SESSION_ID> --name <WORKSPACE_NAME>"`
2. `cmd.exe /c start "<WORKSPACE_NAME>" /d "<WORKSPACE_DIR_WIN>" C:\Users\etgarcia\.local\bin\claude.exe --dangerously-skip-permissions --remote-control --resume <SESSION_ID> --name "<WORKSPACE_NAME>"`
3. If all fail, fall through to the Linux method.
If `RESUME_MODE` is `false`, replace `--resume <SESSION_ID>` with `--session-id <SESSION_ID>` in all commands above.
#### Linux
```bash
script -qc 'cd "<WORKSPACE_DIR>" && claude --dangerously-skip-permissions --remote-control --resume <SESSION_ID> --name "<WORKSPACE_NAME>"' /dev/null &
```
If `RESUME_MODE` is `false`, replace `--resume <SESSION_ID>` with `--session-id <SESSION_ID>`.
This allocates a pseudo-TTY (required by Claude Code) and runs the session in the background.
**Fallback** if `script` is unavailable:
1. Print the manual command for the user to run themselves.
**Fallback** if resume fails (non-zero exit, `RESUME_MODE` is `true`):
1. Re-run the same launch command with `--session-id <SESSION_ID>` instead of `--resume <SESSION_ID>`.
### Step 6: Report to User
```
Workspace: <WORKSPACE_NAME>
Directory: <WORKSPACE_DIR>
Session: <SESSION_ID>
Resume: claude --resume <SESSION_ID>
```
To resume this workspace in chat:
```
/workspace "<WORKSPACE_NAME>" <SESSION_ID>
```
---
## Examples
| Command | Result |
|---|---|
| `/workspace hello-world` | Opens session in `$WORKSPACES_DIR` (default `~/workspace`), named "hello-world" |
| `/workspace hello-world ~/projects/my-app` | Opens session in `~/projects/my-app`, named "hello-world" |
| `/workspace hello-world ~/projects/my-app abc-123` | Resumes session `abc-123` in `~/projects/my-app`, named "hello-world" (falls back to new session with that ID if resume fails) |
---
## Notes
- `WORKSPACES_DIR` env var overrides the default root (`~/workspace`).
- On Windows/WSL, `claude.exe` is launched directly (not via bash) so there are no PATH or shell profile issues.
- On Linux, `script -qc ... /dev/null &` allocates a PTY and backgrounds the process.
- `--session-id` enables later resume with `claude --resume <SESSION_ID>`.
- `wt.exe new-tab` is non-blocking — returns immediately after opening the tab.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.