Skip to content

Latest commit

 

History

History
240 lines (168 loc) · 4.62 KB

File metadata and controls

240 lines (168 loc) · 4.62 KB
marp true
theme tessl-cheatsheet
paginate false
size 1400px 1200px
style section { columns: 5; }

Claude Code Power Cheatsheet

Prompt Improvements

Plan-First Mode

Forces agreement on approach before code. Prevents scattered implementations.

# Slash command
/plan implement OAuth with JWT refresh

# Or press Shift+Tab to cycle
# permission modes → plan

Extended Thinking

Set reasoning effort for the turn or session.

# Persistent setting (low|medium|high|max)
/effort high

# One-shot nudge in any prompt
ultrathink debug this race condition

# Toggle: Option+T  (always on for Fable 5)

Project Memory (CLAUDE.md)

Mutable context at repo root. Update during PRs to compound learnings.

# CLAUDE.md
## Conventions
- Comments at top of every file
- Modular routing in api/routes/{domain}/
- Run frontend/backend in tmux

## Gotchas
- Legacy auth uses cookies, not JWT

--dangerously-skip-permissions

YOLO mode. Bypass all permission prompts for uninterrupted execution.

$ claude --dangerously-skip-permissions \
  "fix all lint errors"

# Budget limit (print mode only)
$ claude -p --max-budget-usd 5.00 "task"

Safety: Always use git, run in Docker, scope tasks tightly.

--resume

Continue sessions. Picks up context, history, file state.

$ claude --resume          # last session
$ claude --resume auth-refactor

Workflow Improvements

Skills

Auto-activated behaviors. Teach Claude your architecture patterns.

# .claude/skills/api-routes/SKILL.md
---
name: api-routes
description: Activates for API work
---
Place routes in api/routes/{domain}/
Each file = one resource...

Sub-Agents

Isolated contexts for parallel verification. No context pollution.

# .claude/agents/security-reviewer.md
---
name: security-reviewer
description: Reviews code for vulns
tools: Read, Glob, Grep, Bash
model: sonnet
---
Check for SQLi, XSS, auth bypass...

name + description required. Permission patterns like Bash(rg:*) go in settings, not tools:.

Agent Orchestration

Chain sequentially or run squads in parallel. Git worktrees for parallelism.

$ git worktree add ../feat-auth feature/auth
$ git worktree add ../feat-api feature/api

# Run Claude in each terminal
$ cd ../feat-auth && claude

Pro: Use 3-4 worktrees in parallel for real velocity.

Hooks

Deterministic shell triggers on lifecycle events.

// .claude/settings.json
{ "hooks": {
  "Notification": [{ "hooks": [
    { "type": "command",
      "command": "notify-send 'Waiting!'" }
  ]}]
}}

Events: PreToolUse PostToolUse Stop Notification SessionStart…

Custom Commands

Reusable workflows as markdown files. Now merged into Skills — both create a /command.

# .claude/commands/commit-push-pr.md
Stage, commit, push, open PR with
description from commits.

# Usage: /commit-push-pr

MCP Tools

GitHub MCP

Review PRs, merge, manage issues directly from terminal.

$ claude mcp add --transport http github \
  https://api.githubcopilot.com/mcp/ \
  --header "Authorization: Bearer $PAT"

"Review PR #42 for security"
"Merge if CI passes"

Postgres MCP

Read-only DB access for autonomous debugging. Understand data model, verify queries.

$ claude mcp add --transport http \
  postgres <your-postgres-mcp-url>

"Show me the user schema"
"Debug why this query is slow"

Sentry MCP

Query errors, analyze stack traces, debug production issues.

$ claude mcp add --transport http \
  sentry <your-sentry-mcp-url>

"What errors are spiking today?"
"Analyze this stack trace"

Linear MCP

Query backlog, create tickets, update status.

$ claude mcp add --transport http \
  linear https://mcp.linear.app/mcp

"What are my sprint issues?"

Slack MCP

Search messages, post updates, find context from discussions.

$ claude mcp add --transport http \
  slack <your-slack-mcp-url>

"Find discussion about auth flow"

Notion MCP

Read docs, create pages, search knowledge base.

$ claude mcp add --transport http \
  notion https://mcp.notion.com/mcp

"Find API guidelines in Notion"

The Stack

Phase Tools
Plan /plan or Shift+Tab to cycle
Context CLAUDE.md + Skills
Think /effort high or ultrathink
Velocity GitHub + Linear MCP
Verify Sub-agents
Debug Postgres + Sentry MCP
Scale Worktrees
Execute --dangerously-skip-permissions
Tessl · Claude Code Cheat Sheet · __VERSION__