Skip to content

docs: add Claude Code integration guide#115

Open
ianjamesburke wants to merge 1 commit intosatococoa:mainfrom
ianjamesburke:docs/claude-code-integration
Open

docs: add Claude Code integration guide#115
ianjamesburke wants to merge 1 commit intosatococoa:mainfrom
ianjamesburke:docs/claude-code-integration

Conversation

@ianjamesburke
Copy link
Copy Markdown

@ianjamesburke ianjamesburke commented Apr 15, 2026

What

Adds docs/claude-code-integration.md — a guide for using wtp inside a Claude Code workflow.

Why

There's no existing documentation for AI agent workflows. Claude Code has a built-in EnterWorktree tool and a growing ecosystem of agent skills that use wtp add and wtp exec. Users setting this up for the first time have to figure out the configuration from scratch. This doc covers the three things that aren't obvious from the README:

  1. Keeping worktrees inside the repo (base_dir: .claude/worktrees) so agents have a predictable relative path
  2. The coexistence pattern when both wtp and Claude's EnterWorktree are used in the same repo
  3. Using wtp exec for multi-branch verification before a batch merge

How

Documentation only — no code changes.

Testing

Verified the .wtp.yml snippet and wtp exec command against wtp v2.8.0 locally.

Breaking Changes

None.

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive guide for integrating wtp worktrees with Claude Code. Covers recommended configuration settings, environment variable handling, repository directory management, typical workflow steps for branch handling and cleanup, multi-branch verification patterns, and important interoperability considerations with Claude Code's built-in worktree features to prevent conflicts.

Covers recommended .wtp.yml configuration for AI-assisted repos
(worktrees inside the repo at .claude/worktrees/), the EnterWorktree
coexistence pattern, and a multi-branch verification example with
wtp exec.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

A new documentation guide was added explaining integration of wtp worktrees with Claude Code workflows, including recommended configuration, hook setup for .env copying, navigation patterns, cleanup procedures, and multi-branch verification examples.

Changes

Cohort / File(s) Summary
Claude Code Integration Documentation
docs/claude-code-integration.md
New guide covering .wtp.yml configuration for Claude Code, post_create hook for .env copying, worktree path behavior, .gitignore setup, typical workflow steps (add, cd, remove), interoperability notes with Claude Code's EnterWorktree, and multi-branch wtp exec patterns.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A burrow of docs, a guide so bright,
Claude Code worktrees, configured just right,
With hooks and with flows, and branches to explore,
The rabbit hops onward, one chapter more!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add Claude Code integration guide' clearly and concisely summarizes the main change: adding documentation for Claude Code integration, matching the PR's primary objective of introducing a new documentation file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/claude-code-integration.md`:
- Around line 26-28: The fenced code block that currently contains
".claude/worktrees/" lacks a language identifier (triggering markdownlint
MD040); update the fence that surrounds the snippet ".claude/worktrees/" to
include a language identifier such as text or gitignore (e.g., change ``` to
```text) so the block is properly typed in the docs/claude-code-integration.md
file.
- Around line 15-20: The snippet uses a top-level hooks.post_create which
doesn't match the current config schema; move the post_create block under the
Defaults section so it maps to Defaults.PostCreate (see
internal/config/config.go) and will be processed; update the document example to
show defaults: post_create: with the existing entries (type: copy, from: .env,
to: .env) nested under defaults rather than as a top-level hooks entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43c0ed82-09c9-455c-b301-9a32a65d21c4

📥 Commits

Reviewing files that changed from the base of the PR and between 842920d and 8f05a70.

📒 Files selected for processing (1)
  • docs/claude-code-integration.md

Comment on lines +15 to +20
hooks:
post_create:
- type: copy
from: .env
to: .env
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use defaults.post_create instead of a top-level hooks.post_create.

The config snippet here doesn’t match the current config schema, so copied configs may silently skip post-create automation. post_create should be nested under defaults (see internal/config/config.go, Defaults.PostCreate). Please update Lines 15–20.

Suggested fix
 defaults:
   base_dir: ".claude/worktrees"
-
-hooks:
-  post_create:
-    - type: copy
-      from: .env
-      to: .env
+  post_create:
+    - type: copy
+      from: .env
+      to: .env
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
hooks:
post_create:
- type: copy
from: .env
to: .env
```
defaults:
base_dir: ".claude/worktrees"
post_create:
- type: copy
from: .env
to: .env
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/claude-code-integration.md` around lines 15 - 20, The snippet uses a
top-level hooks.post_create which doesn't match the current config schema; move
the post_create block under the Defaults section so it maps to
Defaults.PostCreate (see internal/config/config.go) and will be processed;
update the document example to show defaults: post_create: with the existing
entries (type: copy, from: .env, to: .env) nested under defaults rather than as
a top-level hooks entry.

Comment on lines +26 to +28
```
.claude/worktrees/
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced code block.

Line 26 uses an untyped fence; markdownlint MD040 is triggered. Use text (or gitignore) for this snippet.

Suggested fix
-```
+```text
 .claude/worktrees/
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 26-26: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/claude-code-integration.md` around lines 26 - 28, The fenced code block
that currently contains ".claude/worktrees/" lacks a language identifier
(triggering markdownlint MD040); update the fence that surrounds the snippet
".claude/worktrees/" to include a language identifier such as text or gitignore
(e.g., change ``` to ```text) so the block is properly typed in the
docs/claude-code-integration.md file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant