Session 06

Claude Code·in depthfor power users

Program
Agentic engineering
With
Arndt Voges
From
Arndt Voges Consulting
Where
Remote

A cheat sheet, with live demos

The prompt, context, modelsSkills, hooks, headless, setupClose

30 min the prompt, context and models, 50 min skills, hooks, headless and setup, live demos throughout

0:00
At the prompt, context and sessions, models and effort·with live demos
0:30
Break
0:35
Skills and frontmatter, hooks, headless, setup checkups·with live demos
1:25
Homework, close
1:30
End

Where we are

  1. 01Core concepts
  2. 02Preparing the codebase for agents
  3. 03Writing a good spec
  4. 04Feedback loops
  5. 05Workflow integration and code review
  6. 06TodayClaude Code in depth
  7. 07Orchestration and subagents
  8. 08Claude Code alternatives, your system anywhere, and what the future holds
The path of one ticket is complete. From here: the tool in depth, parallel work, the alternatives.

Some of you probably already know some of this.
All of you will hopefully be surprised.

This deck is the reference.
We will try my favorites live.

Everything is in one place, and on the A4 cheat sheet you take home.

What we cover today

Esc EscFrontmatter/btw
HooksSkillsultrathink
! shell modeRewindHeadless/context
--json-schemaRemote controlSafe mode

Part one

At theprompt

The keys that save you minutes, every hour.

At the prompt: the keys

KeyWhat it does
! commandRuns a shell command. Claude sees the output and responds to it.
Type while it worksYour messages queue and go out when Claude is ready.
EscStops the turn. Anything you queued is sent right away.
Esc EscOn an empty prompt: the rewind menu. Restore code, conversation or both.
Ctrl+GOpens the prompt, or the plan, in your editor.
Ctrl+RSearches your prompt history.
Ctrl+VPastes an image, for example a screenshot of a bug.

More keys worth knowing

KeyWhat it does
@ filePoints at a file instead of describing it.
Shift+TabCycles the permission modes, including plan mode.
Ctrl+BSends a running command to the background.
Ctrl+TShows or hides Claude's to-do list.
Ctrl+SStashes the prompt you are writing, for later.
\ then Enter, or Ctrl+JA new line without sending.

! runs it, and Claude reads the output

claude
> ! npm test

✔ spec: one reduced item at 49.90 EUR totals 44.91 EUR
✖ spec: three reduced items at 19.95 EUR total 53.86 EUR
  AssertionError: 5388 !== 5386

● The branch rounds the discount down per item. The spec
  rounds once per order. The code is wrong. Should I fix it?
No copy and paste between terminal and chat. The output is already in the context.

Claude time!

Part two

Context andsessions

What the agent knows, and how to get back.

Context under control

CommandWhat it does
/btw questionAsks a side question. The answer never enters the conversation.
/contextShows what fills the context window, as a grid.
/compact focus on the APISummarizes the conversation and keeps what you name.
/clearStarts empty. Use it between unrelated tasks.
/usageShows tokens and cost for the session, and what drives them.
/insightsWrites a report of how you use Claude Code.

/btw without derailing the task

claude
● Writing tests for src/cart.js ... (3 of 7)

> /btw what does node --test do with nested describe blocks?

  It runs them as subtests and reports each one separately.
  (This answer does not enter the conversation.)

● Writing tests for src/cart.js ... (4 of 7)
The main task keeps a clean context. Your side question costs it nothing.

Rewind undo inside a session

Every prompt you send makes a checkpoint. Files are saved before each edit. prompt 1 prompt 2 prompt 3 prompt 4 prompt 5 Esc Esc or /rewind code only conversation only code and conversation summarize from here Tracks Claude's file edits only. Not shell commands, not other processes. Git stays the safety net.

After two failed corrections,
/clear and rewrite the prompt.

A context full of wrong attempts makes the next attempt worse. Session 01 called it context poisoning.

Sessions you can come back to

CommandWhat it does
/rename voucher fixNames the session so you find it again.
claude -r "voucher fix"Resumes a session by its name.
claude --from-pr 123Lists the sessions linked to that pull request.
/cd, /add-dirMoves to, or adds, another repository and keeps the conversation.
/remote-controlContinues the same session on your phone or in a browser.

Claude time!

Part three

Models andeffort

How hard Claude thinks, and with which model.

Models and effort on demand

CommandWhat it does
ultrathinkOne word in the prompt: deeper reasoning for that turn only.
/effort highSets the effort for the session, from low to max.
/model opusplanOpus plans, Sonnet carries out the plan.
/advisor opusSonnet does the work and asks Opus at the hard decisions.
Alt+PSwitches the model and keeps your draft.
/fastA faster mode of the same model.
Switching models mid-session starts the cache over. Pick before you start, and switch when the task changes.

ultrathink for the one hard turn

prompt
> ultrathink: the voucher rules and the shipping rules interact.
  List every case where a reduced item changes free shipping,
  then write a failing test for each one.
One word, one turn. The rest of the session stays fast.

Part four

Skills andfrontmatter

When and how a skill runs, not only what it does.

The frontmatter decides when and how a skill runs.
The body decides what it does.

A skill: the frontmatter

.claude/skills/pr-summary/SKILL.md
---
name: pr-summary
description: Summarizes the current branch as a pull
  request description. Use when the user asks for one.
argument-hint: [ticket-id]
arguments: [ticket]
disable-model-invocation: true
allowed-tools:
  - Bash(git diff *)
  - Bash(git log *)
model: sonnet
effort: low
---

A skill: the body

.claude/skills/pr-summary/SKILL.md
Ticket: $ticket

## Changes on this branch
!`git diff --stat main...HEAD`

## Commits
!`git log --oneline main..HEAD`

Write a pull request description with the sections
Ticket, What changed, Not included, Evidence and Risk.
/pr-summary SHOP-1234 runs it. Both git commands run before Claude reads a single line.

Frontmatter: when it runs

FieldWhat it does
descriptionWhat Claude matches tasks against. Keep it specific.
when_to_useMore trigger phrases, added to the description.
disable-model-invocationtrue: only you can call it. Claude never loads it on its own.
user-invocablefalse: hidden from the / menu. Only Claude calls it.
pathsLoads it automatically only for matching files.
argument-hintThe hint you see while typing the command.

Frontmatter: how it runs

FieldWhat it does
allowed-toolsPre-approved for this run only. It does not restrict other tools.
disallowed-toolsRemoved while the skill is active.
model, effortA model and an effort level for this skill only.
context: forkRuns as a fresh subagent without your conversation, in the background by default.
agentWhich subagent type runs it, for example Explore.
hooksHooks that are registered when the skill runs.
argumentsNames the arguments: $ticket instead of $0.

Who can call it

user-invocable: true
user-invocable: false
disable-model-
invocation: false
You and Claude
The default. Claude loads it when a task matches.
Only Claude
Background knowledge, hidden from the / menu.
disable-model-
invocation: true
Only you
For anything with side effects: deploy, commit, send.
Nobody
A skill that never runs. Usually a mistake.

Arguments and live data

in the skill body
$ARGUMENTS            everything typed after the name
$0, $1                the first, the second argument
$ticket               a named argument from arguments:
${CLAUDE_SKILL_DIR}   the skill's own folder, for scripts

!`git status --short`   runs first, the output replaces it
a fenced block opened with ```!   the same, over several lines
A failing command stops the skill before Claude sees it. Exit 1 passes only for grep and diff. For anything else, append || true.

Frontmatter gotchas

Typos

A field name Claude Code does not know is ignored, without a warning. disable_model_invocation does nothing.

First line

Frontmatter only counts when --- is the very first line of the file.

Bad YAML

If it does not parse, the skill loads with no fields at all.

Live data

A command your permission rules do not allow aborts the skill. Pre-approve it in allowed-tools.

Portability

On claude.ai and the API, only six fields are allowed. Anything else is an error there.

Skills and subagents spell it differently

SkillSubagent
File.claude/skills/x/SKILL.md.claude/agents/x.md
Requirednothing, description recommendedname and description
Toolsallowed-tools, disallowed-toolstools, disallowedTools
Stylehyphenated, except when_to_usecamelCase
Only herearguments, paths, contextmemory, isolation, maxTurns
Subagents in depth: next session.

Skill tools worth knowing

Stacking

/pr-summary /risk-check SHOP-1234 runs two skills in one message. A forked skill does not stack.

/skill-doctor

Shows what each skill costs in context, and which you never use.

/fewer-permission-prompts

Builds an allowlist from the prompts you keep approving.

Commands

.claude/commands/ still works. A skill adds a folder for scripts and data.

Claude time!

Part five

Hooksbeyond tests

Rules that run every time, without asking the model.

Four hooks worth copying

EventUse it to
NotificationGet a desktop notification when Claude needs you.
PostToolUse on Edit|WriteFormat every file Claude changes.
PreToolUseBlock an action. Exit code 2, and Claude reads your reason.
SessionStart, matcher compactPut key context back after a compaction.
/hooks shows what is configured. Or ask Claude to write the hook for you.

The hooks, in settings

.claude/settings.json
{
  "hooks": {
    "Notification": [{ "hooks": [{ "type": "command",
      "command": "osascript -e 'display notification \"Claude needs you\"'" }] }],
    "PreToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command",
      "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-env.sh" }] }]
  }
}

A hook that says no

.claude/hooks/block-env.sh
#!/usr/bin/env bash
# Exit 2 blocks the action. Claude reads stderr as the reason.
file=$(node -e 'let s="";process.stdin.on("data",d=>s+=d)
  .on("end",()=>console.log(JSON.parse(s).tool_input.file_path||""))')
case "$file" in
  .env|*/.env) echo "Edits to .env are blocked. Ask a person." >&2; exit 2 ;;
esac
exit 0
Exit 0 lets it through. Exit 2 blocks it. Anything the script prints to stderr goes back to Claude.

Claude time!

Part six

Headlessand scripts

Claude without the chat window.

Logs in, JSON out

terminal
cat logs/error.log | claude -p "Find the root cause of these errors" \
  --output-format json \
  --json-schema "$(cat error-schema.json)" \
  --max-turns 5

# .structured_output in the response
{ "rootCause": "subtotal reads priceCents from null cart items",
  "file": "src/cart.js", "line": 5, "confidence": "high" }
Structured output a script can use. For logs, reports, CI checks and nightly jobs.

Guardrails for unattended runs

FlagWhat it does
--max-turns 10Stops after ten turns.
--max-budget-usd 2Stops at a cost limit.
--allowedTools "Read,Grep"Only these tools run without asking.
--permission-mode dontAskDenies everything that is not pre-approved.
--bareSkips hooks, MCP servers and CLAUDE.md, for a fast, clean start.
--append-system-promptAdds instructions and keeps the built-in ones.

Claude time!

Part seven

Setupcheckups

When something feels off.

Checkups for your setup

CommandWhat it does
/doctorChecks your installation and configuration.
/doctor prompt-auditFinds stale or conflicting instructions in CLAUDE.md.
Code intelligence pluginSymbol navigation and type errors after every edit.
claude --safe-modeStarts without CLAUDE.md, skills, plugins, hooks and MCP.
A CLI before an MCP servergh, aws, gcloud: cheaper in context, and Claude learns them from --help.

Stop doing this

Instead ofUse
.claudeignoreIt does not exist. Deny rules: Read(./.env).
/ultraplanPlan mode: Shift+Tab or /plan.
/vim/config.
claude config/config or settings.json.

Everything today was one agent at a time.
Next session: many at once.

ultracode, /workflows, /batch, agent view, worktrees.
Example homework, to be tailored to your team

Homework: your five favorite tricks, live

Pick five

Each team picks its five favorite tricks from the deck or the cheat sheet.

Show them live

A live demo in the Claude Code CLI, on a real task in your own codebase. No slides.

Each team gets 5 minutes in the terminal. At the start of the next session.

Next session:
Orchestration and subagents.

Arndt Voges Consulting · hello@arndtvoges.com · arndtvoges.com

<stop>