What
First-class support for Perforce version control workspaces, including read-only file detection and checkout guidance.
Usage
export CLAUDE_CODE_PERFORCE_MODE=1Details
- When enabled, Claude Code detects files that haven't been opened for edit in Perforce
- Write tool returns a specific error message guiding users to run
p4 edit <file>before modifying - Prevents
chmodworkarounds that would bypass Perforce tracking - System prompt includes Perforce-specific guidance for the model
Evidence
Perforce mode (search for "CLAUDE_CODE_PERFORCE_MODE" and "File is read-only — it has not been opened for edit in Perforce")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Added CLAUDE_CODE_PERFORCE_MODE env var: when set, Edit/Write/NotebookEdit fail on read-only files with a p4 edit hint instead of silently…