Claude Code
Section titled “Claude Code”Primary AI development tool. Power user workflow: task-driven delegation with structured plans and verification.
Quick Reference
Section titled “Quick Reference”Additional Cheatsheets
Section titled “Additional Cheatsheets”| Action | Command/Shortcut |
|---|---|
| Initialize project memory | /init |
| Clear context | /clear |
| Compact conversation | /compact |
| Enter Plan Mode | Shift+Tab twice |
| Switch model | Alt+P (Windows) |
| Add memory on the fly | Type # then instruction |
| Check usage | /usage |
| Check status line | /statusline |
| Run insights | /insights |
| Name session | /rename <name> (or -n <name> at startup) |
| Resume session by name/id | claude --resume <name-or-id> / -r, or in-session /resume |
| Resume most recent (same dir) | claude --continue / -c |
Key Workflows
Section titled “Key Workflows”- Plan Mode First: always separate planning from coding for non-trivial work
- Checkpoints + /rewind: fearless experimentation with quick rollbacks
- Context Hygiene:
/clearand/compactto maintain clarity - Named Sessions:
/rename <name>(or-n <name>at launch) for easy resume - Human-Guided Git: manual control over history, let Claude focus on edits
- Short Sessions: ~40 messages or one feature per session as soft limit
Installation
Section titled “Installation”- Use npm version of Claude Code (enables Claude Trace)
- Claude Trace: https://github.com/badlogic/lemmy/tree/main/apps/claude-trace
Max Reasoning Config
Section titled “Max Reasoning Config”In ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "64000", "MAX_THINKING_TOKENS": "31999" }}Launching — the cc alias (2026-09-21)
Section titled “Launching — the cc alias (2026-09-21)”alias cc="claude --permission-mode acceptEdits --remote-control"In ~/.bashrc. Use cc instead of claude. source ~/.bashrc to pick it up in an already-open terminal.
Why --permission-mode acceptEdits. The default auto mode runs a safety classifier that can refuse an action outright with no appeal — not a prompt, a refusal. It blocked a folder restructure for a full round on 2026-09-21 even though the work was explicitly authorized. acceptEdits asks instead, so an unusual action costs one keystroke rather than a round-trip.
- The
permissions.denylist insettings.json(rm -rf /,dd,mkfs) still applies.bypassPermissionswould drop those too — that is why it is not the default here. - No
settings.jsonkey controls the classifier. Verified 2026-09-21 against the live file and~/.claude/PERMISSIONS-GUIDE.md: the schema haspermissions.allow/denyonly, andBashis already unrestricted. Editing settings to “fix” a classifier refusal accomplishes nothing. - A slash command cannot do this either. Permission mode is fixed when the session launches; a command running inside the session cannot change the mode governing it.
- Full mode list:
claude --permission-mode <acceptEdits|auto|bypassPermissions|manual|dontAsk|plan>.
Why --remote-control. Belt and braces with /config → Enable Remote Control for all sessions. The flag guarantees it per-launch even if that setting is off or reset.
Config References
Section titled “Config References”- Global CLAUDE.md:
~/.claude/CLAUDE.md - Monorepo CLAUDE.md:
d:\FSS\Websites\monorepo\CLAUDE.md - Setup docs:
d:\FSS\Websites\monorepo\docs\CLAUDE_CODE_SETUP.md - MCP config:
d:\FSS\Websites\monorepo\docs\MCP_CONFIGURATION.md
Memory System
Section titled “Memory System”Four Scopes (highest to lowest priority)
Section titled “Four Scopes (highest to lowest priority)”- Enterprise:
C:\Program Files\ClaudeCode\CLAUDE.md— org-wide policy - Project:
./CLAUDE.mdor./.claude/CLAUDE.md— team-shared - Project rules:
./.claude/rules/*.md— modular, topic-specific - User:
~/.claude/CLAUDE.md— personal preferences across all projects - Project local:
./CLAUDE.local.md— personal project-specific (auto-gitignored)
Auto Memory
Section titled “Auto Memory”- CC maintains
MEMORY.mdper project:\\wsl$\Ubuntu-24.04\home\ta\.claude\projects\...\memory\MEMORY.md - Automatically read at start of every conversation
CLAUDE.md Best Practices
Section titled “CLAUDE.md Best Practices”- Keep under 100 lines (context efficiency)
- Use as roadmap to docs, not the docs itself — use
@path/to/fileimports - Always use absolute paths in references
- Add subdirectory CLAUDE.md for module-specific rules
- Include: verification requirements, planning instructions, deployment architecture
- Schedule monthly audits: delete stale, add missing
- Hot reload only works for skills; CLAUDE.md changes require session restart
Import Syntax
Section titled “Import Syntax”See @README for project overview and @package.json for npm commands.@docs/git-instructions.md@~/.claude/my-project-instructions.mdRemote Control
Section titled “Remote Control”Access a running local CC session from phone, tablet, or any browser. Session stays on your machine — remote device is just another keyboard into the same conversation.
Requirements
Section titled “Requirements”- Plan: Pro, Max, Team, or Enterprise (not PAYG API)
- CC v2.1.51+ (
claude --version) - Auth via
claude.aiaccount (not Console API key — run/loginif needed) - Team/Enterprise: admin must enable in org admin settings
Starting a Remote Session
Section titled “Starting a Remote Session”| Method | Command | Use when |
|---|---|---|
| Server mode | claude remote-control | Dedicated remote-only session; terminal shows status, no local input |
| Interactive + remote | claude --remote-control or claude --rc | Most common — local terminal + remote both active |
| Mid-session | /remote-control or /rc | Already in a session, want to keep going from another device |
Name your session: claude --remote-control "Auth refactor" or /remote-control Auth refactor
Connecting Another Device
Section titled “Connecting Another Device”- QR code — press spacebar to toggle (server mode); auto-shown in interactive mode. Scan from Claude mobile app.
- Session URL — appears in terminal at startup; open in any browser at
claude.ai/code - Session list — open
claude.ai/codeor Claude app → tap Code → find session (green dot = online)
Push Notifications
Section titled “Push Notifications”Get notified when long tasks finish or decisions are needed.
- Install Claude mobile app (iOS/Android)
- Sign in with same
claude.aiaccount - Accept OS notification permission
- In CC:
/config→ enable Push when Claude decides
Requires CC v2.1.110+. If no notifications: check /config shows a mobile registered; check iOS Focus/notification settings.
Auto-Enable for Every Session
Section titled “Auto-Enable for Every Session”/config → Enable Remote Control for all sessions → true
Each concurrent CC process gets its own remote session with its own URL.
my_OpenClaw Integration
Section titled “my_OpenClaw Integration”Tap Start Claude Remote in Telegram → starts a Remote Control session in the KB vault → connect from Claude mobile app. See \\wsl$\Ubuntu-24.04\home\ta\utils\ai\my_OpenClaw\README.md.
Config changes require a service restart — my_OpenClaw reads config.yaml once at startup. Telegram keyboard buttons reflect the running config, not the file on disk. After editing config.yaml:
systemctl --user restart my-openclaw.serviceThen send any message to the bot — the updated keyboard appears with the reply. The service auto-restarts on failure and on WSL launch, so one restart is all that’s needed.
Common Pitfalls
Section titled “Common Pitfalls”- New directory: run
claudeonce first to accept workspace trust, then start Remote Control - API key login: won’t work —
/loginto switch to claude.ai account auth - Older CC version:
claude updateto upgrade - VS Code: type
/rcin the prompt box; connection status banner appears above prompt
Rate Limits & Resuming
Section titled “Rate Limits & Resuming”What happens on hit — verified exact wording (code.claude.com/docs/en/errors):
You've hit your session limit · resets 3:45pmYou've hit your weekly limit · resets Mon 12:00amYou've hit your Opus limit · resets 3:45pmClaude Code “blocks further requests until the reset time shown in the message” — the process stays open, it does not exit, and it does not auto-retry. There is no built-in auto-resume yet (open request: anthropics/claude-code#35744). The docs don’t say whether resuming needs a specific word, or whether any new message after reset works — treat “send anything after the reset time” as the working assumption until confirmed live.
[!NOTE] Auto-continue
- When you see the “You’ve hit your session limit” message in the Code tab of the Desktop app, look at that card. It has an “Auto-continue when limits reset” checkbox on it.
- Check it, and the Desktop app will automatically retry your interrupted turn once the reset time passes.
Opus-limit escape hatch (no waiting required): if it’s specifically You've hit your Opus limit, switch model with /model — the Opus limit only gates Opus requests, so another model keeps you working immediately.
See it coming, before it hits: the status line JSON includes rate_limits.five_hour.used_percentage / .resets_at and rate_limits.seven_day.* (Pro/Max subscribers, present after the first API response of a session) — the actual live consumption of the exact quota that produces the block above. Talbot’s ~/.claude/statusline-command.sh (source: ~/ai-config/claude/statusline-command.sh) now surfaces this (added 2026-07-14), as a two-line display:
[session-name · id: ab72833c] ← or just [id: ab72833c] when unnameddir | model | Context: X% | Session: Yk tokens | Limit: Z% (resets H:MMam/pm)The id stays visible even when a name shows (added 2026-07-14) because auto-derived display names aren’t reliably matchable by claude --resume <name> — the id is the always-valid resume handle.
⚠️ A fresh session shows less — that’s normal, not broken: context_window and rate_limits data only exist after the first API response, so at startup the status line is just [id: xxxxxxxx] + dir | model. Context/Session/Limit fill in from the first response onward, and the ID line becomes the name once the session is named (auto-named, or /rename). No restart/reboot needed. (Verified live + against the statusline doc — this exact fresh-session state was misread as a broken status line, 2026-07-14.)
This is strictly better than reactive logging (the StopFailure/rate_limit hook below still fires after the block, for a permanent record) — you see the number climbing and the exact reset time before you ever hit the wall.
This is a different quota than transient capacity errors (429/529), which do auto-retry already — 10 retries w/ backoff by default (CLAUDE_CODE_MAX_RETRIES), or set CLAUDE_CODE_RETRY_WATCHDOG=1 for unattended long runs to retry those for up to ~3h. Watchdog does not help with a subscription-limit pause — different system.
To resume, in order of preference:
- Same terminal, limit not yet reset: wait, then send a new message.
- New terminal/session, same directory:
claude --continue(-c) — resumes the most recent conversation with full history restored. - Specific session, any directory:
claude --resume <session-id-or-name>(-r), or in-session/resumeto pick from a list. Sessions persist to disk as JSONL at~/.claude/projects/<project>/<session-id>.jsonlby default (--no-session-persistenceturns this off, print mode only, 30-day retention viacleanupPeriodDays). - ⚠️ Community-reported (2026, unconfirmed by official docs):
--resumesometimes reprocesses full context at original token cost instead of hitting the cache.--continuein the original terminal is the safer/cheaper path when available.
For SMTM task work specifically: a rate limit can pause a session before Claude gets to write anything to the task file. See Simple Markdown Task Management/SMTM_System.md → Resuming After a Rate Limit or Crash — /task-start//task-continue detect an interrupted (Talbot-Response-less) session and resume from the task file’s in-progress **Progress:** checklist instead of waiting on input that isn’t coming.
Identifying & Naming Running Sessions (multiple concurrent instances)
Section titled “Identifying & Naming Running Sessions (multiple concurrent instances)”When several Claude Code sessions run at once (different terminals/tabs, worktrees, or projects), verified ways to tell them apart (code.claude.com/docs/en/sessions):
- Identify the session you’re already in, without leaving it — there is no
/status-style command for this (verified: no such command incode.claude.com/docs/en/commands). Two ways:- Prompt bar shows the name only if one has been set — an unnamed session shows nothing there.
- Status line is the reliable one: the JSON Claude Code feeds it always includes
session_id(unique, always present) andsession_name(only if set) —~/.claude/statusline-command.shdisplays the identity on its own dedicated first line (never pushed off-screen by the rest):[name · id: xxxxxxxx]when named,[id: xxxxxxxx](first 8 chars of session_id) when not — so an unnamed session is still identifiable at a glance, including right after a rate-limit pause when you had no chance to name it in advance. Multi-line status lines are officially supported (eachecho= one row,code.claude.com/docs/en/statusline).
- Name it —
claude -n <name>at startup, or/rename <name>mid-session. The name shows in the prompt bar, terminal title, and the/resumepicker. Unnamed sessions (CC ≥ 2.1.196, Talbot is on 2.1.208 ✓) still get an auto default likemy-app-3f(cwd + 2-char suffix) — better than nothing, but only a name you set is matchable byclaude --resume <name>//resume <name>. - See everything running —
/resume(in-session) orclaude --resume(no args) opens the picker: each row shows name/summary, time since last activity, message count, git branch. It defaults to the current project/worktree — pressCtrl+Ato widen to every project on the machine,Ctrl+Wfor all worktrees of the current repo,Ctrl+Bto filter to the current branch. This is the closest thing to a global “list all my running sessions” command — but it interrupts what you’re doing to open; the status line above is the passive, always-on alternative. - Background agents specifically (started with
--bg/--background) —claude agentslists them;claude agents --jsonfor scripting. - Remote Control — session list at
claude.ai/code(or Claude mobile app → Code tab), green dot = online. Same conversation as the local terminal — a phone/browser is literally “another keyboard into the same conversation,” so a rate-limit pause visible locally is the same pause visible remotely, and resuming from either side has the same effect (not independently re-verified for the rate-limit case specifically — logical consequence of the documented shared-session architecture, flag if it ever behaves otherwise).
Advanced Strategies
Section titled “Advanced Strategies”Thinking Levels
Section titled “Thinking Levels”| Level | Use For |
|---|---|
think | Quick fixes, moderate complexity |
think hard | Design decisions, optimization |
think harder | Architectural decisions |
ultrathink | Debugging hell, race conditions |
Model Selection
Section titled “Model Selection”- Haiku 4.5: sprinter — simple tasks, implementation (much cheaper)
- Sonnet 4.5: steady builder — standard development
- Opus 4.5: careful reviewer — complex refactors, architecture
Subagents
Section titled “Subagents”- Parallelize development: spawn specialized agents for backend, frontend, tests
- Each works in isolated context window
- Parent agent coordinates and runs integration tests
Shell commands that auto-run at lifecycle events:
- PreToolUse: auto-format before tool runs
- PostToolUse: trigger tests after code changes
- Stop: finalize tasks, send notifications
- Exit code 2: block Claude from editing protected files
- Scoping hierarchy: global -> project -> skill -> sub-agent
- Async hooks: run in background, ~3x faster workflows
Skills and Commands (Merged)
Section titled “Skills and Commands (Merged)”- Simple commands: single
.mdin.claude/commands/ - Complex skills: directory in
.claude/skills/skill-name/with SKILL.md, scripts, templates - Skills auto-reload on SKILL.md changes
- Invoke with
/skill-name - See 02_Skills for full skills ecosystem
Plugins
Section titled “Plugins”- Combine /commands with MCP servers
- Marketplace available for community plugins
- CCPlugins: 24 predefined commands extending CC CLI
CC /insights Report Summary (2026-02-05)
Section titled “CC /insights Report Summary (2026-02-05)”3,336 messages across 439 sessions over 31 days
What’s Working
Section titled “What’s Working”- Task-driven workflow with structured backlists
- Confirm-then-implement planning discipline
- Multi-language infrastructure orchestration (Python, TS, YAML, JSON)
- 276 commits (9/day shipping cadence)
Key Friction Points
Section titled “Key Friction Points”- Claude claims “done” without verifying — deployment bugs missed
- Wrong approach on config/deployment — lacks persistent context
- No CLAUDE.md guardrails — no rules about deployment architecture, testing
Priority Actions from Insights
Section titled “Priority Actions from Insights”- Add verification rules to CLAUDE.md: “Never claim done without testing”
- Set up hooks for post-edit deployment validation
- Create
/taskfixskill encoding the full fix-verify workflow - Use headless mode for automated task-list fixes
- Implement verify-before-done protocol
- Per-item verification (fix -> test -> next) instead of batch
Suggested CLAUDE.md Additions
Section titled “Suggested CLAUDE.md Additions”## Workflow Rules- After implementing changes, verify by running deployment/build scripts and checking output. Never claim "done" without testing.- When working from task list, do final grep pass for remaining old/replaced values.
## Deployment and Config- For config changes (YAML, JSON, shell), diff final file contents after editing. Check for: domain names, provider names, URLs, environment-specific values.Resources
Section titled “Resources”- Claude Code Docs
- Everything Claude Code
- Awesome Claude Code
- Anthropic Best Practices
- ClaudeLog - The no.1 Claude Code community resource
- Free Course: Claude Code in Action
- CC Cheatsheet
- The Only CLAUDE.md Guide
- Boris Cherny’s 22 Tips
- 47 CC WSL Tricks
- 30 CC Subagent Templates
- Deep Learning AI Course
- Who to Follow