Claude Mastery
2026-04-09
⌨️ CLI POWER MOVE
🔥 New🔧 Try It
Focus View — The Three-State Terminal Navigator

v2.1.97 ships Ctrl+O in NO_FLICKER mode — a three-state toggle that changes how you navigate long conversations.

State 1: Normal prompt. Your default view. Input box at the bottom, conversation scrolling above it.

State 2: Transcript mode. Press Ctrl+O once. The full conversation becomes navigable with less-style keys: / to search, j/k to scroll, g/G to jump to top/bottom, Ctrl+u/Ctrl+d for half-page, Space/b for full-page. Press [ to dump the entire transcript into your terminal's native scrollback (so Cmd+f and tmux copy mode work). Press v to open it in your $EDITOR.

State 3: Focus view. Press Ctrl+O again. This strips away everything except your last prompt, a one-line summary of tool calls with edit diffstats, and the final response. Perfect for reviewing what just happened without wading through intermediate output.

Press Ctrl+O a third time (or Esc/q) to return to normal.

Why this matters: NO_FLICKER uses the alternate screen buffer (like vim), so your terminal's native Cmd+f can't see the conversation. Focus View + transcript mode solve that gap completely. The [ key to push everything to native scrollback is especially useful inside tmux, where you want copy-mode access to the full output.

Also new in v2.1.97: refreshInterval for status line scripts — set it in your config and the status line re-runs on a timer instead of only on state changes.

🏗️ AGENT ARCHITECTURE
🔥 New🔧 Try It
v2.1.97 Fixed Four Agent-Killing Bugs

If you run agents — especially long-lived ones with MCP servers — update immediately. v2.1.97 patches four bugs that silently degrade agent sessions:

1. MCP Memory Leak: 50 MB/hour. HTTP/SSE connections to MCP servers accumulated unreleased buffers on every reconnect. A 10-hour agent session could eat 500 MB of RAM just from MCP connection churn. If your agents were mysteriously OOM-ing or slowing down, this was likely why.

2. Subagent Directory Leak. Subagents running with isolation: "worktree" or a cwd: override were leaking their working directory back to the parent session's Bash tool. Your parent session's shell could silently end up in a worktree directory without you knowing. Security implication: a subagent scoped to a read-only directory could have its working directory propagated to the parent, which has broader permissions.

3. 429 Retry Burnout. When the API returned rate-limit errors with a small Retry-After value, the retry logic burned through all attempts in about 13 seconds with no backoff. Now exponential backoff applies as a minimum floor. This was the "agent appears stuck then gives up" behavior some operators were seeing.

4. Compaction Transcript Bloat. When a prompt-too-long retry triggered compaction, the system was writing duplicate multi-megabyte subagent transcript files. On complex multi-agent sessions, this caused transcript files to grow unbounded and slow down --resume.

None of these produced error messages. They all silently degraded performance, ate resources, or introduced subtle state corruption. Update: npm install -g @anthropic-ai/claude-code@latest

🧭 OPERATOR THINKING
🌿 Evergreen
Design for Resumability — Lessons from 7 Resume Fixes

v2.1.97 contains *seven separate --resume fixes*. When a single release patches that many edge cases in one feature, it's telling you something: resume is load-bearing infrastructure, and it was fragile.

The fixes: --resume opening uneditable sessions, Ctrl+A reload wiping the search filter, empty session lists swallowing keyboard navigation, task-status text replacing conversation summaries, cross-project session staleness, file-edit diffs vanishing for files over 10KB, and attachment messages not being persisted to transcripts.

The operator insight: Your agents will be interrupted. Rate limits, context compaction, OOM kills, network drops, machine restarts — interruption isn't the exception, it's the default state. If your agent can't resume cleanly, the interruption becomes permanent.

Design your agent workflows for resumability:

State in files, not context. Put your agent's progress state in a file it reads at startup (a task manifest, a checklist, a ledger). If context is lost, the file survives. CLAUDE.md's "First Steps Every Run" pattern exists for this reason.

Idempotent operations. Each step your agent takes should be safe to re-run. If step 3 wrote half a file before getting killed, step 3 on resume should detect the partial state and redo it cleanly.

Checkpoint after expensive work. If your agent just spent 5 minutes researching something, write the results to a file *before* moving to the next step. Don't carry research only in the conversation context.

Use --resume for long tasks. When running agents via claude -p, capture the session ID from the output. If the process dies, claude --resume picks up with full context. v2.1.97 makes this actually reliable.

The broader principle: treat agent sessions like database transactions. Assume they can fail at any point. Build in the checkpoints and recovery paths *before* you need them.

🌐 ECOSYSTEM INTEL
🔥 New🔧 Try It
claude-on-a-leash: Deterministic Security Without Sandbox Overhead

Last issue covered sandboxing with Bubblewrap — full filesystem isolation at the kernel level. claude-on-a-leash takes the opposite approach: six bash scripts that hook into Claude Code's lifecycle events and block dangerous operations before they execute.

What it intercepts:

  • Destructive commands: rm -rf /, privilege escalation, fork bombs
  • Credential exfiltration: reads of .env, SSH keys, cloud creds; writes containing API tokens
  • SSRF attacks: requests to metadata endpoints, plain HTTP, known exfiltration domains
  • Prompt injection: jailbreak patterns, instruction override attempts

How the feedback loop works: Each hook receives JSON on stdin describing the intended action. Exit 0 allows it. Exit 2 blocks it — and stderr becomes feedback that Claude reads and adapts to. Claude sees "this was blocked because it reads SSH keys" and tries an alternative approach. Your guardrails aren't just walls; they're teachers.

Audit trail: Every action (allowed and blocked) is logged to .claude/command-audit.log as newline-delimited JSON. This gives you a complete forensic record of what your agent attempted.

Bonus: The same rules are exposed as an MCP server, so non-Claude-Code agents can query the guardrails as advisory tools.

Install: download and inspect the install script, then run it. It drops hooks into .claude/ — project-local or global, your choice.

bash
curl -fsSL https://raw.githubusercontent.com/adityaarakeri/claude-on-a-leash/main/install.sh \
-o /tmp/claude-hooks-install.sh
cat /tmp/claude-hooks-install.sh # always read before running
bash /tmp/claude-hooks-install.sh

MIT licensed. Pairs well with sandboxing — hooks catch intent, sandboxes catch execution.

🔬 PRACTICE LAB
🔥 New🔧 Try It
Master the Three-State Navigator in 10 Minutes

What you'll do: Enable NO_FLICKER mode, explore all three navigation states, and configure scroll speed for your terminal.

Steps:

  1. Enable NO_FLICKER. Add to your shell profile (~/.bashrc or ~/.zshrc):
bash
export CLAUDE_CODE_NO_FLICKER=1

Restart your shell or source the profile. Start Claude Code.

  1. Verify it's active. The input box should stay fixed at the bottom of the screen. Scrolling happens *above* the input, not by moving the whole terminal.
  1. Generate some conversation. Ask Claude to do something that produces output — read a file, explain some code, run a search. You want enough content to scroll through.
  1. Enter transcript mode. Press Ctrl+O. The interface switches to a read-only view of the full conversation. Try these:
  • / to search — type a term, press Enter, then n/N to jump between matches
  • j/k to scroll line by line
  • g to jump to top, G to jump to bottom
  • Ctrl+d/Ctrl+u for half-page scrolling
  • [ to dump everything into your terminal's native scrollback (now Cmd+f works)
  1. Enter focus view. Press Ctrl+O again. You should see only: your last prompt, a one-line tool summary with edit stats, and the final response. This is your "what just happened" view.
  1. Return to normal. Press Ctrl+O once more (or Esc or q).
  1. Tune scroll speed (optional). If mouse wheel scrolling feels sluggish:
bash
export CLAUDE_CODE_SCROLL_SPEED=3

Values from 1-20. 3 matches vim defaults.

  1. tmux users: Make sure set -g mouse on is in your ~/.tmux.conf. Without it, wheel events go to tmux instead of Claude Code.

Expected outcome: You can cycle through all three states (Ctrl+O → transcript → Ctrl+O → focus → Ctrl+O → normal), search within transcript mode, and scroll smoothly.

Verify: In transcript mode, press /, search for a word you know exists in the conversation. Press n to advance to the next match. If highlighting moves, everything is wired correctly. Press Esc or q to return to the prompt.