Claude Code integration
Capture prompts from Claude Code
PCR.dev supports Claude Code whether installed via the native installer, Homebrew, WinGet, or npm.
File watcher (recommended)
Claude Code stores session files at:
~/.claude/projects/<project-slug>/<session-id>.jsonl
Run pcr init in your project and pcr start to begin capturing automatically.
MCP integration (optional)
Add the PCR MCP server to Claude Code's configuration:
{
"mcpServers": {
"pcr": {
"command": "pcr",
"args": ["mcp"]
}
}
}Or use the Claude Code CLI:
claude mcp add pcr -- pcr mcp
What's captured
| Field | Value |
|---|---|
| source | claude-code |
| capture_method | file-watcher |
| session_id | From the JSONL file |
| model | e.g. claude-sonnet-4-5 |
| tool_calls | List of tools invoked (Read, Write, Edit, Bash, etc.) with file paths |
| prompt_text | Your message |
| response_text | Claude's response text |
| permission_mode | The Claude Code mode active when the prompt was sent (see below) |
Claude Code includes model and tool call data in session files, so these fields are populated automatically when using the file watcher.
Permission modes
PCR captures which Claude Code mode was active for each prompt, recorded in the permission_mode field:
| Value | Mode | Description |
|---|---|---|
default | Normal | Claude asks for permission before running each tool call |
acceptEdits | Auto-accept | Claude runs tool calls without asking. Toggle with Shift+Tab in Claude Code. |
plan | Plan | Claude proposes a plan without executing any tools. Toggle with Shift+Tab or /plan. |
Multi-repo attribution
If you work in a monorepo or multi-repo workspace (e.g. a directory with several sub-repos), PCR automatically tags each prompt with every repo it touched — not just the primary one.
For Claude Code, attribution is derived from tool call file paths: every file Claude edited, read, or ran is matched against your registered projects. A single prompt that touches frontend/ and backend/ will be tagged to both projects.
The badge in pcr bundle reflects this: a prompt that touched both repos shows [frontend,backend] instead of just one name.
Cross-repo drafts also surface in pcr bundle from each touched repo's directory. Running pcr bundle in api/ will show drafts from sessions started in frontend/ if those sessions edited files under api/. Adding the draft to a bundle from one repo keeps it available to bundle from the other.