NewsCrawler.org

Choosing between Claude Code's /btw, /branch, /fork and /rewind commands

作業を止めずに進めるClaude Codeの/btw・/fork・/rewindなどの使い分け
Image: zenn.dev

This Japanese tutorial on Zenn explains the Claude Code commands /btw, /branch, /fork and /rewind and when to use each. /btw asks a side question while Claude keeps working; the question and answer do not stay in the main conversation history, and the answer uses only the conversation so far, without reading files or running commands. /branch copies the conversation and switches to the copy, and the original can be returned to with /resume, but the working folder stays the same. /fork copies the conversation into a separate session that runs in the background, and before changing code it usually creates a worktree[1], so the two sessions do not conflict over files.

/rewind returns the code and the conversation to an earlier point, and the author recommends rolling back only the conversation when instructions went wrong. Only files changed with Claude's edit tool are restored; changes made through Bash commands, manual edits, and database updates or API calls are not, so the author suggests committing at good stopping points. Messages sent while Claude is working are queued, and Ctrl+B moves long-running commands or a subagent[2] run to the background.

The article also covers claude --bg for background sessions managed with claude agents, claude -w for separate worktrees, and /loop and /schedule for checking CI or deployments. The author recommends /btw and Ctrl+B to readers who have not used them yet.

Repository Claude Code github.com

Agentic coding tool that runs in the terminal, reads your codebase, and runs routine tasks and git workflows from natural language commands.

Stars: 157,135Forks: 25,124Updated:

Read the original zenn.dev

Sources

  • Zenn JA

    作業を止めずに進めるClaude Codeの/btw・/fork・/rewindなどの使い分け

    16 likes4 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page