p4-workspace-setup

p4-workspace-setup is a skill for Claude Code, Codex from perforce/p4mcp-server. It costs 56 tokens per session (575 once invoked), scanned A, original, MIT.

A set of procedures for managing P4 workspaces, which are local working folders connected to files stored in a Perforce server. It covers creating, configuring, synchronising, switching, inspecting, and deleting those workspaces.

In plain words
What is it for?
Use it to create stream or classic workspaces, configure depot-to-local mappings, sync files, switch the active workspace, and check workspace type or status.
Why use it?
It provides the correct operations for getting a project’s files locally and keeping them connected to the right depot or stream. This reduces mistakes when changing workspace mappings or switching between projects.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/perforce/p4mcp-server/p4-workspace-setup
Any agent
npx skills add perforce/p4mcp-server --skill p4-workspace-setup
Clone the repo
git clone --depth 1 https://github.com/perforce/p4mcp-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for p4-workspace-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/perforce/p4mcp-server/p4-workspace-setup.svg)](https://agentmods.dev/skills/perforce/p4mcp-server/p4-workspace-setup)
Your own site
<a href="https://agentmods.dev/skills/perforce/p4mcp-server/p4-workspace-setup"><img src="https://agentmods.dev/badge/skills/perforce/p4mcp-server/p4-workspace-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.00575
Opus 5 $0.00028 $0.00287
Sonnet 5 $0.00011 $0.00115
Haiku 4.5 $0.00006 $0.00057

Measured 5d ago against content hash 5dc26bc57bf7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

p4-workspace-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/p4-workspace-setup/SKILL.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workspace Setup & Management

Use the query_workspaces and modify_workspaces tools to manage P4 client workspaces.

Querying Workspaces

Action Purpose Key Parameters
list List workspaces with filters user, max_results
get Get full workspace spec workspace_name
type Check if workspace is stream or classic workspace_name
status Get workspace sync status workspace_name

Modifying Workspaces

Action Purpose Key Parameters
create Create a new workspace name, specs
update Update workspace spec fields name, specs
delete Delete a workspace (requires approval) name
switch Switch active workspace name

Common Workflows

Create a stream workspace

  1. query_streamslist to find available streams
  2. modify_workspacescreate with specs containing the stream depot path
  3. modify_filessync to populate the workspace

Create a classic workspace

  1. modify_workspacescreate with specs containing view mappings (depot-to-local paths)
  2. modify_filessync to populate the workspace

Check workspace state

  1. query_workspacesget to see the current spec
  2. query_workspacestype to check if it's stream-bound or classic
  3. query_workspacesstatus to see sync state (have vs head revisions)

Switch between workspaces

  1. query_workspaceslist to see available workspaces
  2. modify_workspacesswitch to set the active workspace

Best Practices

  • Use stream workspaces when working with P4 streams — they auto-configure the view mapping from the stream spec.
  • Set the workspace root to a directory that exists and is writable.
  • Use query_workspacesstatus to check for out-of-date files before starting work.
  • Delete workspaces only when you're sure no pending changelists reference them.
  • Each workspace must have a unique name on the P4 server.

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 59 lines · 0 tokens per session scan A 5dc26bc57bf7

Subscribe to this mod's changes

p4-workspace-setup is a skill published in the GitHub repository perforce/p4mcp-server (114 stars, last pushed 1mo ago), licensed MIT. It adds 56 tokens to every session and 575 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

p4-plan-search-queries

P4 Plan Find query syntax for advanced searching. Use when user needs to search, filter, or find items by status, assignee, priority, severity, dates, custom fields, or any combination.

perforce/p4plan-mcp · 48 tokens

p4-plan-comment-html-format

Author HTML-formatted comments and multiline field values that render correctly in both the Qt desktop client and the React web client. Use when posting/editing comments, setting Multiline Text custom fields, or writing detailedDescription/stepsToReproduce on a Bug.

perforce/p4plan-mcp · 58 tokens

p4-plan-mentions

Format @user mentions inside HTML comments and multiline fields so they render as a proper link in both the Qt desktop client and the React web client. Use when the user wants to ping someone, notify a teammate, address @-name, or reference a user inside a comment / description / steps to reproduce.

perforce/p4plan-mcp · 67 tokens

p4-plan-task-management

Manage tasks, status updates, assignments, comments, and attachments in P4 Plan. Use when user mentions tasks, status, updates, assignments, my work, todo list, assign, comments, attachments, or collaboration.

perforce/p4plan-mcp · 50 tokens

p4-plan-planning

Manage sprints, releases, and sprint commitment in P4 Plan. Use when user mentions sprints, sprint planning, capacity, velocity, committing work, iterations, burndown, releases, milestones, versions, or tagging.

perforce/p4plan-mcp · 52 tokens

p4-plan-bug-tracking

Guide bug tracking workflows including creation, triage, severity classification, and resolution in P4 Plan QA. Use when user mentions bugs, defects, QA, triage, severity, quality assurance, create bug, or fixing issues.

perforce/p4plan-mcp · 54 tokens