[{"data":1,"prerenderedAt":56},["ShallowReactive",2],{"blog-claude-code-test-driven-development":3,"blog-related-claude-code-test-driven-development":39},{"slug":4,"title":5,"description":6,"category":7,"categoryId":8,"keyword":9,"date":10,"minutes":11,"body":12,"html":13,"headings":14},"claude-code-test-driven-development","Test-driven development with Claude Code: a practical loop","How to do test-driven development with Claude Code: write the failing test first, keep Claude from rewriting it, and enforce green with a Stop hook.","Workflows","workflows","claude code test driven development","2026-11-17",6,"Test-driven development fits Claude Code well because it gives the agent what it lacks most: a pass or fail result it can read. Write the failing test (or have Claude write it and approve it), then let Claude change the code until the test passes. This page shows the loop, the prompts, and the two guardrails that stop the usual failure, which is Claude \"fixing\" the test instead of the code.\n\n## Why does TDD suit Claude Code?\n\nClaude Code's own best-practices page puts it plainly: Claude stops when the work looks done, and if it has nothing to run that says whether the work really is done, \"looks done\" is all it has. In practice you become the test suite.\n\nA test turns that around. Claude makes a change, runs the check, reads the output, and fixes what broke before running it again, without you in the loop. The check can be a test file, a build's exit code, a linter, or a script that diffs output against a fixture. A failing test written before the code is the sharpest version, because it also tells Claude exactly what \"done\" means.\n\n## How to run the red-green-refactor loop\n\nKeep each step as its own prompt, and keep each cycle small: one behavior, one test.\n\n**1. Red.** Ask for the test only, and tell Claude not to touch the implementation:\n\n```text\nWrite a failing test for rate limiting in src\u002Fapi\u002Flimiter.test.ts: a 6th request\nwithin one minute from the same IP returns 429. Do not change src\u002Fapi\u002Flimiter.ts.\nRun the test and show me the failure output.\n```\n\nRead the failure. A test that fails for the wrong reason (an import error, a typo) proves nothing. You want it to fail on the assertion.\n\n**2. Green.** Approve the test, then:\n\n```text\nMake that test pass with the smallest change. Run the whole limiter test file after\neach change and keep going until it passes. Don't edit the test.\n```\n\n**3. Refactor.** Once green, ask for cleanup with the suite as a safety net:\n\n```text\nRefactor limiter.ts for readability. Run the tests; they must stay green.\n```\n\nFor a bug, the same shape works: the docs' own example asks Claude to \"write a failing test that reproduces it, then fix it\". The reproduction test stays in the repo as a regression test.\n\n## What should the CLAUDE.md say about tests?\n\nClaude needs the exact commands, including how to run a single file. The best-practices page calls the command that runs your check the single most useful line in a `CLAUDE.md`:\n\n```md\nTests:\n- Run one test file: pnpm vitest run path\u002Fto\u002Ffile.test.ts\n- Run everything: pnpm test\n- Typecheck: pnpm tsc --noEmit\n- Write the failing test first, show the failure, then implement.\n- Never edit an existing test to make it pass; ask me first.\n```\n\nThe last two lines are guidelines, and Claude is allowed to weigh a guideline. If a rule must hold every time, enforce it, as below. More on writing this file in [How to write a CLAUDE.md that Claude Code actually follows](\u002Fblog\u002Fclaude-md-guide).\n\n## How do you stop Claude from editing the test to pass?\n\nThis is the real risk of TDD with an agent. Faced with a red test, the cheapest fix is sometimes to loosen the assertion. Three layers help, from soft to hard.\n\n**Say it in the prompt.** \"Don't edit the test\" in the green step catches most cases, and a diff review catches the rest. Always look at whether the test file changed.\n\n**Ask for evidence.** Request the command Claude ran and its output, not just \"all tests pass\". Reading the output takes seconds.\n\n**Lock the tests with a hook.** A `PreToolUse` hook can block `Edit` and `Write` on test files while a marker file exists. Claude Code's hooks guide shows this mechanism for protected files: the script reads the tool input as JSON on stdin and exits with code 2 to block the edit, and what it prints to stderr goes back to Claude as the reason.\n\n```bash\n#!\u002Fbin\u002Fbash\n# .claude\u002Fhooks\u002Flock-tests.sh\nINPUT=$(cat)\nFILE_PATH=$(echo \"$INPUT\" | jq -r '.tool_input.file_path \u002F\u002F empty')\n\nif [ -f \"$CLAUDE_PROJECT_DIR\u002F.claude\u002Ftests-locked\" ] && [[ \"$FILE_PATH\" == *.test.* ]]; then\n  echo \"Tests are locked. Change the code, or ask the user to unlock.\" >&2\n  exit 2\nfi\nexit 0\n```\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Edit|Write\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"\\\"$CLAUDE_PROJECT_DIR\\\"\u002F.claude\u002Fhooks\u002Flock-tests.sh\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\nRun `chmod +x` on the script, and create the marker (`touch .claude\u002Ftests-locked`) once you approve the red test. Remove it when you want new tests. Note that Claude can still change files through shell commands, so treat this as a guardrail, not a vault. See [Claude Code hooks](\u002Fblog\u002Fclaude-code-hooks) for the full model.\n\n## How do you make Claude keep going until the suite is green?\n\nThree options, in rising order of strictness:\n\n- **In the prompt:** \"run the auth tests after, and keep going until they pass\". No setup.\n- **A goal:** `\u002Fgoal all tests in tests\u002Fauth pass and lint is clean` sets a condition that a separate model checks after every turn. It helps most on long unattended runs, where Claude sometimes ends a turn with a progress summary while items are still open.\n- **A Stop hook:** it runs your script whenever Claude tries to end its turn, and sends Claude back to work if the script exits with code 2.\n\n```json\n{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"pnpm test 1>&2 || exit 2\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe test output goes to stderr, so Claude reads the failures as the reason it cannot finish. The hook is enforced by Claude Code itself, not by the model. There is a cap: if it blocks eight stops in a row with no tool call between them, Claude Code overrides the next block and ends the turn. Keep the command fast, or run only the affected tests, since it fires every time Claude tries to stop.\n\n## Should you plan the tests first?\n\nFor anything bigger than one function, yes. Switch to plan mode (`claude --permission-mode plan`, or Shift+Tab until the status bar shows plan mode) and have Claude propose the test list: the cases, the edge cases, the files. Edit the list, write it to a `SPEC.md`, then start a fresh session to build from it, so the build begins with a clean context and a written definition of done. See [Plan mode in Claude Code](\u002Fblog\u002Fclaude-code-plan-mode).\n\nTo check the result against the plan, the docs suggest a reviewer subagent with a narrow brief:\n\n```text\nuse a subagent to review the diff against SPEC.md, check every requirement is\nimplemented and the listed edge cases have tests, report gaps that affect correctness and skip style\n```\n\nKeep \"skip style\". A reviewer asked to find problems will always find something, and fixing every finding is how you end up with abstraction layers and tests for cases that cannot happen. More in Using Claude Code to review code.\n\n## What if a cycle goes wrong?\n\nSmall cycles make this cheap. Press Esc as soon as Claude drifts. `\u002Frewind`, or Esc twice on an empty prompt, rolls code, conversation, or both back to an earlier prompt. Checkpoints cover files Claude edited with its own file tools, not files a Bash command touched, and they work alongside git rather than replacing it. After two failed corrections, `\u002Fclear` and write a better prompt rather than a third correction. Committing after each green step gives you a hard floor; see [How to undo what Claude Code changed](\u002Fblog\u002Fundo-claude-code-changes).\n\n### Checklist for each cycle\n\n- One behavior per cycle, with the test command in `CLAUDE.md`.\n- The red test fails on the assertion, not on an import.\n- \"Don't edit the test\" in the green prompt, or the lock hook.\n- Evidence in the answer: the command and its output.\n- Tests green, then a commit, then refactor.\n\n## In Relais\n\nRelais is a desktop app on top of Claude Code, so everything above works as is. Three parts help this loop: the Run tab saves your test command per folder (for example `pnpm test`) and its \"Send logs to Claude\" drops the tail of a failing run into the composer; the undo arrow on any of your messages puts back every file Claude changed after it, even outside git; and the Changes tab shows the diff so you can see whether a test file moved. Details on [the features page](\u002Ffeatures).","\u003Cp>Test-driven development fits Claude Code well because it gives the agent what it lacks most: a pass or fail result it can read. Write the failing test (or have Claude write it and approve it), then let Claude change the code until the test passes. This page shows the loop, the prompts, and the two guardrails that stop the usual failure, which is Claude &quot;fixing&quot; the test instead of the code.\u003C\u002Fp>\n\u003Ch2 id=\"why-does-tdd-suit-claude-code\">\u003Ca class=\"anchor\" href=\"#why-does-tdd-suit-claude-code\" aria-label=\"Link to this section\">#\u003C\u002Fa>Why does TDD suit Claude Code?\u003C\u002Fh2>\n\u003Cp>Claude Code&#39;s own best-practices page puts it plainly: Claude stops when the work looks done, and if it has nothing to run that says whether the work really is done, &quot;looks done&quot; is all it has. In practice you become the test suite.\u003C\u002Fp>\n\u003Cp>A test turns that around. Claude makes a change, runs the check, reads the output, and fixes what broke before running it again, without you in the loop. The check can be a test file, a build&#39;s exit code, a linter, or a script that diffs output against a fixture. A failing test written before the code is the sharpest version, because it also tells Claude exactly what &quot;done&quot; means.\u003C\u002Fp>\n\u003Ch2 id=\"how-to-run-the-red-green-refactor-loop\">\u003Ca class=\"anchor\" href=\"#how-to-run-the-red-green-refactor-loop\" aria-label=\"Link to this section\">#\u003C\u002Fa>How to run the red-green-refactor loop\u003C\u002Fh2>\n\u003Cp>Keep each step as its own prompt, and keep each cycle small: one behavior, one test.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>1. Red.\u003C\u002Fstrong> Ask for the test only, and tell Claude not to touch the implementation:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"text\">\u003Ccode>Write a failing test for rate limiting in src\u002Fapi\u002Flimiter.test.ts: a 6th request\nwithin one minute from the same IP returns 429. Do not change src\u002Fapi\u002Flimiter.ts.\nRun the test and show me the failure output.\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Read the failure. A test that fails for the wrong reason (an import error, a typo) proves nothing. You want it to fail on the assertion.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>2. Green.\u003C\u002Fstrong> Approve the test, then:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"text\">\u003Ccode>Make that test pass with the smallest change. Run the whole limiter test file after\neach change and keep going until it passes. Don't edit the test.\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>3. Refactor.\u003C\u002Fstrong> Once green, ask for cleanup with the suite as a safety net:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"text\">\u003Ccode>Refactor limiter.ts for readability. Run the tests; they must stay green.\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>For a bug, the same shape works: the docs&#39; own example asks Claude to &quot;write a failing test that reproduces it, then fix it&quot;. The reproduction test stays in the repo as a regression test.\u003C\u002Fp>\n\u003Ch2 id=\"what-should-the-claude-md-say-about-tests\">\u003Ca class=\"anchor\" href=\"#what-should-the-claude-md-say-about-tests\" aria-label=\"Link to this section\">#\u003C\u002Fa>What should the CLAUDE.md say about tests?\u003C\u002Fh2>\n\u003Cp>Claude needs the exact commands, including how to run a single file. The best-practices page calls the command that runs your check the single most useful line in a \u003Ccode>CLAUDE.md\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"md\">\u003Ccode>Tests:\n- Run one test file: pnpm vitest run path\u002Fto\u002Ffile.test.ts\n- Run everything: pnpm test\n- Typecheck: pnpm tsc --noEmit\n- Write the failing test first, show the failure, then implement.\n- Never edit an existing test to make it pass; ask me first.\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>The last two lines are guidelines, and Claude is allowed to weigh a guideline. If a rule must hold every time, enforce it, as below. More on writing this file in \u003Ca href=\"\u002Fblog\u002Fclaude-md-guide\">How to write a CLAUDE.md that Claude Code actually follows\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-stop-claude-from-editing-the-test-to-pass\">\u003Ca class=\"anchor\" href=\"#how-do-you-stop-claude-from-editing-the-test-to-pass\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you stop Claude from editing the test to pass?\u003C\u002Fh2>\n\u003Cp>This is the real risk of TDD with an agent. Faced with a red test, the cheapest fix is sometimes to loosen the assertion. Three layers help, from soft to hard.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Say it in the prompt.\u003C\u002Fstrong> &quot;Don&#39;t edit the test&quot; in the green step catches most cases, and a diff review catches the rest. Always look at whether the test file changed.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Ask for evidence.\u003C\u002Fstrong> Request the command Claude ran and its output, not just &quot;all tests pass&quot;. Reading the output takes seconds.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Lock the tests with a hook.\u003C\u002Fstrong> A \u003Ccode>PreToolUse\u003C\u002Fcode> hook can block \u003Ccode>Edit\u003C\u002Fcode> and \u003Ccode>Write\u003C\u002Fcode> on test files while a marker file exists. Claude Code&#39;s hooks guide shows this mechanism for protected files: the script reads the tool input as JSON on stdin and exits with code 2 to block the edit, and what it prints to stderr goes back to Claude as the reason.\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"bash\">\u003Ccode>#!\u002Fbin\u002Fbash\n# .claude\u002Fhooks\u002Flock-tests.sh\nINPUT=$(cat)\nFILE_PATH=$(echo &quot;$INPUT&quot; | jq -r '.tool_input.file_path \u002F\u002F empty')\n\nif [ -f &quot;$CLAUDE_PROJECT_DIR\u002F.claude\u002Ftests-locked&quot; ] &amp;&amp; [[ &quot;$FILE_PATH&quot; == *.test.* ]]; then\n  echo &quot;Tests are locked. Change the code, or ask the user to unlock.&quot; &gt;&amp;2\n  exit 2\nfi\nexit 0\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cpre class=\"code\" data-lang=\"json\">\u003Ccode>{\n  \u003Cspan class=\"hljs-string\">\"hooks\"\u003C\u002Fspan>: {\n    \u003Cspan class=\"hljs-string\">\"PreToolUse\"\u003C\u002Fspan>: [\n      {\n        \u003Cspan class=\"hljs-string\">\"matcher\"\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">\"Edit|Write\"\u003C\u002Fspan>,\n        \u003Cspan class=\"hljs-string\">\"hooks\"\u003C\u002Fspan>: [\n          { \u003Cspan class=\"hljs-string\">\"type\"\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">\"command\"\u003C\u002Fspan>, \u003Cspan class=\"hljs-string\">\"command\"\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">\"\\\"$CLAUDE_PROJECT_DIR\\\"\u002F.claude\u002Fhooks\u002Flock-tests.sh\"\u003C\u002Fspan> }\n        ]\n      }\n    ]\n  }\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Run \u003Ccode>chmod +x\u003C\u002Fcode> on the script, and create the marker (\u003Ccode>touch .claude\u002Ftests-locked\u003C\u002Fcode>) once you approve the red test. Remove it when you want new tests. Note that Claude can still change files through shell commands, so treat this as a guardrail, not a vault. See \u003Ca href=\"\u002Fblog\u002Fclaude-code-hooks\">Claude Code hooks\u003C\u002Fa> for the full model.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-make-claude-keep-going-until-the-suite-is-green\">\u003Ca class=\"anchor\" href=\"#how-do-you-make-claude-keep-going-until-the-suite-is-green\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you make Claude keep going until the suite is green?\u003C\u002Fh2>\n\u003Cp>Three options, in rising order of strictness:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>In the prompt:\u003C\u002Fstrong> &quot;run the auth tests after, and keep going until they pass&quot;. No setup.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A goal:\u003C\u002Fstrong> \u003Ccode>\u002Fgoal all tests in tests\u002Fauth pass and lint is clean\u003C\u002Fcode> sets a condition that a separate model checks after every turn. It helps most on long unattended runs, where Claude sometimes ends a turn with a progress summary while items are still open.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A Stop hook:\u003C\u002Fstrong> it runs your script whenever Claude tries to end its turn, and sends Claude back to work if the script exits with code 2.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cpre class=\"code\" data-lang=\"json\">\u003Ccode>{\n  \u003Cspan class=\"hljs-string\">\"hooks\"\u003C\u002Fspan>: {\n    \u003Cspan class=\"hljs-string\">\"Stop\"\u003C\u002Fspan>: [\n      {\n        \u003Cspan class=\"hljs-string\">\"hooks\"\u003C\u002Fspan>: [\n          { \u003Cspan class=\"hljs-string\">\"type\"\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">\"command\"\u003C\u002Fspan>, \u003Cspan class=\"hljs-string\">\"command\"\u003C\u002Fspan>: \u003Cspan class=\"hljs-string\">\"pnpm test 1&gt;&amp;2 || exit 2\"\u003C\u002Fspan> }\n        ]\n      }\n    ]\n  }\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>The test output goes to stderr, so Claude reads the failures as the reason it cannot finish. The hook is enforced by Claude Code itself, not by the model. There is a cap: if it blocks eight stops in a row with no tool call between them, Claude Code overrides the next block and ends the turn. Keep the command fast, or run only the affected tests, since it fires every time Claude tries to stop.\u003C\u002Fp>\n\u003Ch2 id=\"should-you-plan-the-tests-first\">\u003Ca class=\"anchor\" href=\"#should-you-plan-the-tests-first\" aria-label=\"Link to this section\">#\u003C\u002Fa>Should you plan the tests first?\u003C\u002Fh2>\n\u003Cp>For anything bigger than one function, yes. Switch to plan mode (\u003Ccode>claude --permission-mode plan\u003C\u002Fcode>, or Shift+Tab until the status bar shows plan mode) and have Claude propose the test list: the cases, the edge cases, the files. Edit the list, write it to a \u003Ccode>SPEC.md\u003C\u002Fcode>, then start a fresh session to build from it, so the build begins with a clean context and a written definition of done. See \u003Ca href=\"\u002Fblog\u002Fclaude-code-plan-mode\">Plan mode in Claude Code\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>To check the result against the plan, the docs suggest a reviewer subagent with a narrow brief:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"text\">\u003Ccode>use a subagent to review the diff against SPEC.md, check every requirement is\nimplemented and the listed edge cases have tests, report gaps that affect correctness and skip style\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Keep &quot;skip style&quot;. A reviewer asked to find problems will always find something, and fixing every finding is how you end up with abstraction layers and tests for cases that cannot happen. More in Using Claude Code to review code.\u003C\u002Fp>\n\u003Ch2 id=\"what-if-a-cycle-goes-wrong\">\u003Ca class=\"anchor\" href=\"#what-if-a-cycle-goes-wrong\" aria-label=\"Link to this section\">#\u003C\u002Fa>What if a cycle goes wrong?\u003C\u002Fh2>\n\u003Cp>Small cycles make this cheap. Press Esc as soon as Claude drifts. \u003Ccode>\u002Frewind\u003C\u002Fcode>, or Esc twice on an empty prompt, rolls code, conversation, or both back to an earlier prompt. Checkpoints cover files Claude edited with its own file tools, not files a Bash command touched, and they work alongside git rather than replacing it. After two failed corrections, \u003Ccode>\u002Fclear\u003C\u002Fcode> and write a better prompt rather than a third correction. Committing after each green step gives you a hard floor; see \u003Ca href=\"\u002Fblog\u002Fundo-claude-code-changes\">How to undo what Claude Code changed\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch3 id=\"checklist-for-each-cycle\">\u003Ca class=\"anchor\" href=\"#checklist-for-each-cycle\" aria-label=\"Link to this section\">#\u003C\u002Fa>Checklist for each cycle\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>One behavior per cycle, with the test command in \u003Ccode>CLAUDE.md\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>The red test fails on the assertion, not on an import.\u003C\u002Fli>\n\u003Cli>&quot;Don&#39;t edit the test&quot; in the green prompt, or the lock hook.\u003C\u002Fli>\n\u003Cli>Evidence in the answer: the command and its output.\u003C\u002Fli>\n\u003Cli>Tests green, then a commit, then refactor.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"in-relais\">\u003Ca class=\"anchor\" href=\"#in-relais\" aria-label=\"Link to this section\">#\u003C\u002Fa>In Relais\u003C\u002Fh2>\n\u003Cp>Relais is a desktop app on top of Claude Code, so everything above works as is. Three parts help this loop: the Run tab saves your test command per folder (for example \u003Ccode>pnpm test\u003C\u002Fcode>) and its &quot;Send logs to Claude&quot; drops the tail of a failing run into the composer; the undo arrow on any of your messages puts back every file Claude changed after it, even outside git; and the Changes tab shows the diff so you can see whether a test file moved. Details on \u003Ca href=\"\u002Ffeatures\">the features page\u003C\u002Fa>.\u003C\u002Fp>\n",[15,18,21,24,27,30,33,36],{"id":16,"text":17},"why-does-tdd-suit-claude-code","Why does TDD suit Claude Code?",{"id":19,"text":20},"how-to-run-the-red-green-refactor-loop","How to run the red-green-refactor loop",{"id":22,"text":23},"what-should-the-claude-md-say-about-tests","What should the CLAUDE.md say about tests?",{"id":25,"text":26},"how-do-you-stop-claude-from-editing-the-test-to-pass","How do you stop Claude from editing the test to pass?",{"id":28,"text":29},"how-do-you-make-claude-keep-going-until-the-suite-is-green","How do you make Claude keep going until the suite is green?",{"id":31,"text":32},"should-you-plan-the-tests-first","Should you plan the tests first?",{"id":34,"text":35},"what-if-a-cycle-goes-wrong","What if a cycle goes wrong?",{"id":37,"text":38},"in-relais","In Relais",[40,46,51],{"slug":41,"title":42,"description":43,"category":7,"categoryId":8,"keyword":44,"date":10,"minutes":45},"claude-code-multi-repo-projects","Claude Code across several repositories: --add-dir and layouts","How to work with Claude Code on a project split across repos: launch from a parent folder, --add-dir, what config loads from extra folders, and commits.","claude code multiple repositories",5,{"slug":47,"title":48,"description":49,"category":7,"categoryId":8,"keyword":50,"date":10,"minutes":45},"claude-code-commit-and-pull-requests","Commit, push and open a pull request with Claude Code","How to have Claude Code write commit messages, push a branch and open a PR with gh: prompts that work, permission rules, attribution settings and checks.","claude code commit and pull request",{"slug":52,"title":53,"description":54,"category":7,"categoryId":8,"keyword":55,"date":10,"minutes":45},"claude-code-git-worktrees","Git worktrees with Claude Code: parallel features, no conflicts","Run Claude Code in a git worktree with one flag: separate branches, no stepping on each other's files. Setup, cleanup, base branches and the gotchas.","claude code git worktrees",1794931098788]