# 25 Claude Code Tips & Tricks the Docs Don’t Tell You | Alher Tech

> Undocumented Claude Code shortcuts, session management tricks and prompting patterns that save senior engineers hours every week on real B2B SaaS work.

- Canonical page: https://alhertech.com/en/claude-code/tips/
- Site: Alher Tech (custom software, AI agents and SEO engineering, https://alhertech.com/)
- Contact: https://alhertech.com/en/contact/

---

Shortcuts, undocumented behaviors and small habits that compound into hours saved every week. Each tip has shipped value on at least one live B2B SaaS project.

Updated: July 22, 2026

## Session management

Use `claude --resume` to continue yesterday's session with full transcript. Use `claude --continue <id>` to branch from any point. Pin the session id in your terminal title for quick context.

## Prompting

Prefix any task with the acceptance criteria. End the prompt with "if uncertain, ask before editing". These two habits raise first-pass success from ~60% to ~85% on our projects.

## Debugging

When the agent loops, dump the last 20 turns with `/export` and feed them to a fresh session. A fresh context often sees what the stuck one missed.

## CLAUDE.md discipline

Treat CLAUDE.md as a contract, not a wiki: build commands, naming conventions, forbidden patterns and the one-line reason behind each rule. Keep it under ~300 lines and delete anything the code already explains. When the agent repeats a mistake, the fix is a new line in CLAUDE.md, not a longer prompt next time.

## Plan mode before big changes

For refactors or features touching more than a couple of files, press Shift+Tab to enter plan mode: the agent explores and proposes a plan you approve before any edit. Rejecting a bad plan costs seconds; rejecting a bad diff costs a review cycle. Approve plans, not surprises.

## Context management

Long sessions degrade: use /compact at natural checkpoints to summarize history and free the window, and /clear when switching to an unrelated task. Delegate broad codebase exploration to subagents so the main session receives conclusions instead of file dumps. One task per session beats one giant session for everything.

## Hooks that enforce quality

PostToolUse hooks run your linter and tests after every edit, so the agent fixes its own breakage before you ever see it. PreToolUse hooks can block dangerous commands (rm -rf, git push) by policy instead of by hope. Ten minutes configuring hooks in settings.json saves the daily "please run lint" ritual forever.

## MCP servers and skills

Connect the tools you already use (Search Console, databases, browsers, ticketing) through MCP servers and the agent operates them directly. Repeatable workflows belong in a skill (a slash command with instructions): /deploy, /review-pr, /release-notes. If you type the same three-step instruction twice a week, it should be a skill.

## Permissions without friction

Allowlist the read-only commands you approve every day (git status, npm test, grep) in settings.json so prompts only appear for actions that matter. Never blanket-approve writes outside the repo. The goal is zero prompts for safe operations and a deliberate pause for irreversible ones.

## Headless and CI

claude -p "prompt" runs one-shot without the interactive UI: perfect for cron jobs, commit-message generation or nightly dependency reports. In CI, combine it with a strict allowlist and a read-only token. The same agent that pairs with you by day can do janitorial work by night.

## Frequently asked questions

### What's the single biggest productivity boost?

A disciplined CLAUDE.md plus PostToolUse hooks for lint and tests. Everything else is small incremental gains.

### How do I stop Claude Code from touching files it should not?

Three layers: say it in CLAUDE.md (the agent reads it every session), deny the paths in settings.json permissions, and add a PreToolUse hook as the hard stop. Policy beats vigilance.

### Is Claude Code worth it for a solo developer?

It is where it compounds hardest: a solo senior with Claude Code covers the mechanical half of a small team. The habits above (CLAUDE.md, hooks, plan mode) are what separate a 2x gain from a 10x one.
