/btw, /compact, /rewind: what most Claude Code users ignore

The Claude Code features most teams skip: /btw, /compact, /rewind, Stop hooks, and CLAUDE.md import patterns.

/btw, /compact, /rewind: what most Claude Code users ignore
Share

Everyone remembers the flashy Claude Code features — subagents, MCP servers, agent teams. The commands that quietly save the most time are the ones people scroll past. Before you can use /btw, /compact, or /rewind, though, you need a working install and a sane starting config.

Before You Begin

Claude Code requires a paid Pro, Max, Teams, or Enterprise plan, or a Console API key — the free tier has no access at all . Install it natively depending on your OS:

# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex

Homebrew ships claude-code (stable) and claude-code@latest, and WinGet uses winget install Anthropic.ClaudeCode — but neither auto-updates, so you'll pin an older build unless you upgrade manually .

On a new project, run /init to auto-generate a CLAUDE.md from your actual build system, tests, and code patterns. For a guided setup, set CLAUDE_CODE_NEW_INIT=1 to enable an interactive multi-phase flow that also covers skills and lifecycle hooks .

One rule worth enforcing from day one: keep CLAUDE.md under roughly 200 lines. Anthropic's docs confirm adherence degrades past that threshold, and every line costs tokens on every message you send . Short and specific beats long and comprehensive.

/btw, /compact, and /rewind — What Each One Does

/btw, /compact, /rewind: what most Claude Code users ignore

These four commands govern the single most consequential variable in a long Claude Code session: what stays in context. /btw answers a side question without polluting history, /compact condenses with a directive, /clear wipes the slate between tasks, and /rewind lets you branch a conversation the way you branch a repo. Each targets a different failure mode of a growing token count [1].

CommandWhat it doesContext effect
/btwAnswers a quick side question in a dismissible overlayNever enters history — zero token growth
/compact <focus>Condenses history around a directiveKeeps root CLAUDE.md + auto memory
/clearWipes all conversation historyRe-reads CLAUDE.md next turn
/rewind (double-tap Esc)Restores a saved checkpointConversation-only, code-only, or both

/btw, introduced in March 2026, is the one most people miss. Ask "what does this function return?" and the answer appears in an overlay that never joins the conversation, so your token count stays flat [1]. Creator Boris Cherny highlights it as a low-friction way to keep sessions lean [3].

/compact Focus on the API changes condenses with intent instead of blindly summarizing. Root CLAUDE.md, unscoped rules, auto memory, and up to ~5,000 tokens per skill body survive compaction — but path-scoped rules and nested CLAUDE.md files reload only after matching files are read again [1]. Use /clear instead when the next task is unrelated; Anthropic's docs warn that stale history crowds out the files the current task actually needs and costs tokens on every message [1].

/rewind, or a double-tap of Esc, opens a checkpoint menu to restore conversation-only, code-only, or both. Every prompt auto-creates a checkpoint, and checkpoints persist across sessions — though they track only Claude's edits, not git or external processes [1]. A single Esc halts Claude mid-action while preserving context; press it the moment you see the agent heading the wrong direction [1].

How a Stop Hook Prevents False 'Done' Declarations

/btw, /compact, /rewind: what most Claude Code users ignore

Left to self-assess, Claude declares work finished when it thinks the change is complete — a judgment, not a measurement. A Stop hook replaces that judgment with a pass/fail signal. Add a hook in .claude/settings.json (browse existing ones with /hooks) that points at a linter, test runner, or screenshot diff, and the turn cannot end until the check passes. This turns verification into the main loop instead of an afterthought .

The mechanics are deterministic. A Stop hook that exits with code 2 blocks the turn from ending, and exit code 1 is a non-blocking error . Claude overrides the block after 8 consecutive failures as a safety cap — so design the script to give a reachable exit path, not an infinite gate. Since v2.1.139, macOS and Linux command hooks run in their own session without a controlling terminal, which matters if your check spawns a subprocess .

Stop hooks are one lifecycle point. PreToolUse hooks fire before execution and match Bash, Edit, Write, Read, Glob, Grep, Agent, WebFetch, and MCP tools; they can allow, deny, ask, defer, or modify tool input, with precedence deny > defer > ask > allow. Command hooks receive JSON on stdin; HTTP hooks accept the same payload as a POST body, which is useful for a centralized, authenticated validator .

Pair the enforcement with Anthropic's recommended cadence: press Shift+Tab to enter plan mode for unfamiliar or multi-file work, use Ctrl+G to open the plan in your editor before any edits begin, and commit after each verified increment . As Anthropic's best-practices guide frames it, the goal is to "give Claude a way to check its own work" so it iterates against a concrete result rather than a self-report .

The division of labor is the point: deterministic scripts in .claude/settings.json enforce, while prose in CLAUDE.md advises. Put blocking logic in callbacks and keep style guidance in the instruction file — memory and instructions are context, not enforcement.

Two Gotchas That Bite Back

/btw, /compact, /rewind: what most Claude Code users ignore

Two defaults quietly undercut people who assume the tool is doing more than it is: auto mode's safety ceiling and auto memory's load limit. Neither is a bug — both are documented — but both fail silently, which is exactly why they bite.

First, auto mode is convenience with guardrails, not a security model. Anthropic runs a separate classifier and background checks, but an independent 2026 AmPermBench paper reported an 81.0% end-to-end false-negative rate on deliberately ambiguous authorization scenarios, versus the 17% Anthropic cites from production traffic . The gap is partly benchmark design, but the takeaway holds: treat auto as risk-aware, and reserve bypassPermissions for isolated VMs or containers only .

Second, auto memory loads only the first 200 lines or 25KB of MEMORY.md, whichever comes first — so a long memory file can leave Claude blind to rules you wrote past the cutoff . Run /memory to audit what is actually loaded before assuming the context is there.

The same restraint applies to instructions. Imports via @path/to/file resolve up to four recursive hops . Rather than one 400-line file, split large rulesets into .claude/rules/ with paths frontmatter globs (e.g. src/**/*.{ts,tsx}) so each rule loads only when matching files are in scope.

Parallel Branches, Scheduling, and Chrome

The same restraint scales outward: run more sessions instead of one overloaded one. Pair git worktrees with Claude Code's desktop multi-session view and each branch gets an independent session with no shared state — kick off a long refactor or research pass in one worktree while you keep editing in another . For unattended work, Routines run on Anthropic-managed infrastructure that keeps scheduled automation going when your machine is off, and non-interactive mode drives CI and pre-commit checks: claude -p 'prompt' --output-format stream-json accepts pipes like cat error.log | claude .

Two mobility features close the loop. claude --teleport pulls a web or iOS session into the terminal (a claude.ai subscription is required), and /remote-control drives a local session from your phone or browser . The Claude-in-Chrome extension is the one integration where screenshot comparison is built in — capture before/after shots and pass them to Claude for visual UI diff verification . The takeaway: verification and parallelism are the same discipline — give each task its own isolated session and a concrete pass/fail signal, then let scheduling and remote control keep it running without you.

Frequently asked questions

What does /compact preserve compared to /clear?

/compact condenses your conversation with an optional focus instruction — for example /compact Focus on the API changes — while keeping the root CLAUDE.md, unscoped global rules, auto memory, and up to roughly 5,000 tokens per skill body intact; path-scoped rules and nested CLAUDE.md files reload lazily only after a matching file is read again . /clear instead wipes all conversation history, but Claude re-reads CLAUDE.md on the next turn and still sees your files. Neither command deletes anything on disk.

How many consecutive Stop hook blocks will Claude respect before overriding?

Claude overrides a Stop hook after 8 consecutive blocks . Because of that ceiling, design the Stop hook to return a clear pass/fail result with a reachable exit path — a check that can genuinely succeed once the work is correct. A gate that can never pass simply burns through the 8-block override budget and then lets the turn end anyway, defeating the point of the guardrail.

Is auto mode safe for unattended production automation?

Treat it as risk-aware, not fully secured. Anthropic's auto mode runs a separate classifier and background safety checks, but an independent 2026 AmPermBench paper reported an 81.0% end-to-end false-negative rate on deliberately ambiguous authorization scenarios, versus Anthropic's cited 17% production-traffic figure . Use bypassPermissions only inside isolated VMs or containers — never on a bare production machine .

How do I audit which CLAUDE.md rules are actually loaded in a session?

Run /memory. It lists every loaded CLAUDE.md, CLAUDE.local.md, and rules file, and opens the auto-memory folder so you can see exactly what is in context . Check this before blaming Claude for ignoring an instruction — a path-scoped rule may simply not have loaded yet because no matching file was read, and memory and instruction files are context, not enforcement. Move anything you need enforced into a hook.

Does /btw grow the conversation context or affect token count?

No. /btw, introduced in March 2026, answers a quick side question in a dismissible overlay, and the exchange never enters conversation history . It has no effect on the context window or downstream reasoning — it is explicitly designed as a throwaway query surface, so you can ask an unrelated question mid-task without paying for it on every later message the way normal conversation turns do.