# P4 Changelist Management

> Changelist Management

- Skill: `perforce/p4-changelist-management` (Agent Skill)
- Install (CLI): `npx skillmds@latest add perforce/p4-changelist-management`
- Raw SKILL.md: https://api.skillmd.com/api/skills/perforce/p4-changelist-management/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: perforce (https://skillmd.com/u/perforce)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/perforce/p4-changelist-management

---


# Changelist Management

Use the `query_changelists`, `modify_changelists`, `query_shelves`, and `modify_shelves` tools to manage P4 changelists and shelved files.

## Querying Changelists

| Action | Purpose | Key Parameters |
|--------|---------|----------------|
| `list` | List changelists with filters | `status`, `user`, `workspace_name`, `depot_path`, `max_results` |
| `get` | Get full changelist details | `changelist_id` |

## Modifying Changelists

| Action | Purpose | Key Parameters |
|--------|---------|----------------|
| `create` | Create a new pending changelist | `description` |
| `update` | Update changelist description or fields | `changelist_id`, `description` |
| `submit` | Submit a pending changelist | `changelist_id` |
| `delete` | Delete an empty pending changelist (requires approval) | `changelist_id` |
| `move_files` | Move files to a target changelist | `changelist_id`, `file_paths` |

## Querying Shelves

| Action | Purpose | Key Parameters |
|--------|---------|----------------|
| `list` | List shelved changelists | `user`, `max_results` |
| `diff` | View diff of shelved files | `changelist_id` |
| `files` | List files in a shelved changelist | `changelist_id` |

## Modifying Shelves

| Action | Purpose | Key Parameters |
|--------|---------|----------------|
| `shelve` | Shelve files from a pending changelist | `changelist_id`, `file_paths` |
| `unshelve` | Unshelve files back to the same changelist | `changelist_id`, `file_paths` |
| `unshelve_to_changelist` | Unshelve files into a different changelist | `changelist_id`, `target_changelist`, `file_paths` |
| `update` | Update shelved files with new edits | `changelist_id`, `file_paths` |
| `delete` | Delete shelved files (requires approval) | `changelist_id`, `file_paths`, `force` |

## Common Workflows

### Make and submit a change

1. `modify_changelists` → `create` a pending changelist
2. `modify_files` → `edit` (or `add`/`delete`) to open files for edit in the changelist
3. `modify_changelists` → `submit` to commit the change

### Shelve work in progress

1. `modify_changelists` → `create` a pending changelist
2. `modify_files` → `edit` to open files
3. `modify_shelves` → `shelve` to store changes server-side
4. `modify_files` → `revert` local copies (shelve is preserved)

### Resume shelved work

1. `query_shelves` → `list` to find your shelved changelists
2. `modify_shelves` → `unshelve` to restore files to your workspace
3. Continue editing, then `modify_changelists` → `submit`

### Organize files across changelists

1. `query_changelists` → `list` with `status=pending` to see your open changelists
2. `modify_changelists` → `move_files` to reorganize files between changelists

## Best Practices

- Always provide a meaningful description when creating changelists.
- Shelve before sharing work with others (e.g., for code review).
- Use `query_shelves` → `diff` to verify shelved content before unshelving.
- Submit changelists promptly to avoid long-lived pending changes.
- Use `move_files` to keep changelists focused on a single logical change.

