docs: add Claude Code integration guide#115
docs: add Claude Code integration guide#115ianjamesburke wants to merge 1 commit intosatococoa:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughA new documentation guide was added explaining integration of Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
docs/claude-code-integration.md
| hooks: | ||
| post_create: | ||
| - type: copy | ||
| from: .env | ||
| to: .env | ||
| ``` |
There was a problem hiding this comment.
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.
| 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.
| ``` | ||
| .claude/worktrees/ | ||
| ``` |
There was a problem hiding this comment.
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.
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
EnterWorktreetool and a growing ecosystem of agent skills that usewtp addandwtp 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:base_dir: .claude/worktrees) so agents have a predictable relative pathwtpand Claude'sEnterWorktreeare used in the same repowtp execfor multi-branch verification before a batch mergeHow
Documentation only — no code changes.
Testing
Verified the
.wtp.ymlsnippet andwtp execcommand against wtp v2.8.0 locally.Breaking Changes
None.
Summary by CodeRabbit
wtpworktrees 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.