01 / THE UNIT OF WORK
A small prompt.
A long conversation.
What Claude Code reads, writes, and reuses.
Start with a sentence. →
An interactive seminar · Claude Code only · Synthetic examples
02 / TEXT BECOMES TOKENS
Words are not the unit.
Text fragments map to numeric IDs. IDs select learned embeddings; the model produces scores for the next token.
A token can be a word part, punctuation, whitespace, or bytes—not necessarily a word.
IDs → embeddings → model → next-token scores → next token
Start with small pieces. Each step merges an adjacent pair from the teaching vocabulary.
Teaching tokenizer · illustrative vocabulary, not Claude token IDs or an exact count. The token-counting API ↗ estimates model-specific totals. Response usage is the accounting record.
03 / THE REQUEST LEDGER
One request. Four billing buckets.
Total input = cache read + cache write + uncached input
API field names and output retention
- Cache read
cache_read_input_tokens- Cache write
cache_creation_input_tokens- Uncached input
input_tokens- Output
output_tokens
The answer is separate.
The current answer is output, not part of this request’s input bar. If retained, it joins the next request as input.
Claude Code manages prompt caching automatically. A warm request reuses an eligible, matching prefix.
Output can include billed thinking; retention is model-dependent. API cache accounting ↗
04 / INSIDE THE TOOL LOOP
One prompt can make many requests.
IN = uncached input · OUT = output · CR = cache read · CW = cache write. Synthetic payload sizes; tool service charges excluded.
05 / CONVERSATION → CONTEXT → CHARGES
Watch the conversation—and the bill—grow.
Rates, retained context & assumptions
charge = (IN × rate + CW × rate + CR × rate + OUT × rate) / 1,000,000
Retained content after response, by origin
Conversation excerpts are synthetic, not transcripts or exact token counts. Each repeat is another review pass. TTL reprices writes; expiry is simulated separately. Context support varies by model. Old chat remains visible after compaction, but is no longer all active context. Subscription allowance is not this API bill. API pricing ↗
06 / BACK TO YOUR TERMINAL
Read your own session.
/context- Inspect the current window.
/usage- Inspect token buckets / plan usage.Version and sign-in dependent; older versions may use
/cost. /model- Inspect the active model and window.
Keep the useful context
- Read focused files and relevant ranges.
- Compact at task boundaries.
- Clear context for unrelated tasks.
- Avoid unnecessary model or tool changes mid-session.
A big cache-read number is often reuse working—not a bigger context window.
All examples are synthetic and run locally. No data leaves this page; no telemetry. Saved HTML behaves the same offline; source links need a network. Usage & costs ↗ Model configuration ↗
07 / THE PUBLIC PRICE LIST
API prices are the public baseline.
| Model | Input | Write · 5m | Write · 1h | Read | Output |
|---|---|---|---|---|---|
| Haiku 4.5 | $1 | $1.25 | $2 | $0.10 | $5 |
| Sonnet 5 | $2 | $2.50 | $4 | $0.20 | $10 |
| Sonnet 4.6 | $3 | $3.75 | $6 | $0.30 | $15 |
| Sonnet 4.5 | $3 | $3.75 | $6 | $0.30 | $15 |
| Opus 5 | $5 | $6.25 | $10 | $0.50 | $25 |
| Opus 4.8 | $5 | $6.25 | $10 | $0.50 | $25 |
| Opus 4.7 | $5 | $6.25 | $10 | $0.50 | $25 |
| Opus 4.6 | $5 | $6.25 | $10 | $0.50 | $25 |
| Opus 4.5 | $5 | $6.25 | $10 | $0.50 | $25 |
| Fable 5 | $10 | $12.50 | $20 | $1 | $50 |
| Fable 5.1 | $10 | $12.50 | $20 | $0.25 | $50 |
Retired versions still listed for some cloud providers
| Model | Input | Write · 5m | Write · 1h | Read | Output |
|---|---|---|---|---|---|
| Haiku 3.5 | $0.80 | $1 | $1.60 | $0.08 | $4 |
| Sonnet 4 | $3 | $3.75 | $6 | $0.30 | $15 |
| Opus 4.1 | $15 | $18.75 | $30 | $1.50 | $75 |
| Opus 4 | $15 | $18.75 | $30 | $1.50 | $75 |
Reference rates, not a guarantee of availability. Provider, region, fast mode, contract and other modifiers can change the bill.
Official rates checked 15 Sep 2026. API cache reads are not free. Included subscription allowance is a separate meter. Published pricing ↗
08 / MY ACCOUNT OBSERVATIONS · 15 SEP 2026
The subscription is a different meter.
API-equivalent dollars describe work. They do not define the plan.
- Opus 5 only · 5 hours
- ~$100
- Opus 5 only · 7 days
- ~$666 was ~$800; reduced Sep 14
- Fable · 5 hours
- ~$33 not the expected ~$100
- Fable · weekly allocation
- ≤50%
Reported by the presenter for their account. Not a published quota, invoice, or guarantee for another account.
Compare the same non-read token mix
Why usage can feel inconsistent
My observations: cache reads do not consume the measured subscription allowance; Sonnet, Haiku, and different Opus versions do not map consistently to the API price list. I have not established fixed multipliers for those models. Treat the 3× Fable penalty as an observation for this comparison—not a universal conversion rule.
Assumptions: same input/write/output mix, 2× Fable non-read API rates relative to Opus 5, comparable five-hour measurements, and the same observed weighting continuing weekly. Hidden thinking, model/tokenizer changes, other sessions, tools and rate changes complicate comparisons. The 1/12 result estimates the Fable portion; it does not erase the rest of the weekly allowance.
Cache reads: free in my observed subscription accounting; charged on the API. Confirm your own plan with /usage. Public docs do not establish these dollar-equivalent limits. Billing distinctions ↗
09 / CLAUDE.md · WHAT ENTERS CONTEXT
Instructions load from broad to local.
/etc/claude-code/CLAUDE.mdCompany · Linux example~/.claude/CLAUDE.mdYou · all projects/work/CLAUDE.mdAncestor directory└─ acme/CLAUDE.mdWorking directory · shared CLAUDE.local.mdPersonal · gitignore it ├─ api/CLAUDE.mdOn demand · API subtree └─ web/CLAUDE.mdOn demand · web subtreeContext · appended in this order
Append, not replace. A nested file does not erase the parent.
Locations, imports & path-scoped rules
Project instructions: CLAUDE.md or .claude/CLAUDE.md. At launch, discovery includes every ancestor up to the filesystem root. Each directory’s CLAUDE.local.md follows its shared instructions.
Managed paths: Linux/WSL /etc/claude-code/CLAUDE.md; macOS /Library/Application Support/ClaudeCode/CLAUDE.md; Windows C:\Program Files\ClaudeCode\CLAUDE.md.
@docs/conventions.md imports content; relative paths resolve from the importing file. Imports consume context too. Project imports outside the working directory require approval.
.claude/rules/*.md without paths loads at launch. With paths: ["api/**/*.ts"] frontmatter, it loads when matching files are read. --add-dir does not load extra CLAUDE.md files by default; the docs describe the opt-in.
Confirm with /context → Memory files. Conflicting prose is not reliable policy enforcement. Official loading order ↗
10 / settings.json · NOT config.json
Settings are JSON. Scope decides who.
Highest precedence first Click a scope
Scalar keys: higher value wins.
Permission lists: combine, then evaluate rules.
/config personal options/status loaded sources/permissions rules + sourceclaude doctor rejected entriesSet up the file without replacing existing settings
- Start Claude Code at the repository root. Create
.claude/if it is absent. - Merge the example keys into
.claude/settings.json; do not overwrite existing rules. Use strict JSON: no comments or trailing commas. The$schemaURL enables editor validation. - Commit the shared file. For personal exceptions use
.claude/settings.local.json; if you create it by hand, add it to.gitignore. - Check
/statusand/permissions. Most rule edits reload live; startup-only keys need a new session. Trust the repository only after reviewing its settings.
~/.claude.json is separate Claude-managed state, including sign-in, trust and some MCP configuration—not the permissions file. Nested settings files do not follow the CLAUDE.md read-triggered loading model. Managed controls can restrict local changes; environment-variable precedence is key-specific.
Example only; no company policy assumed. Project allow rules require workspace trust. Official scopes, setup & precedence ↗
11 / PERMISSIONS · THE HARNESS ENFORCES THIS
A rule decides whether a tool runs.
Same example settings Manual / default mode
No matching rule? The permission mode and built-in checks decide. A narrower allow cannot override a matching deny or ask.
CLAUDE.md guides behavior. Permissions gate tool calls.
Modes, rule syntax & security limits
default- Manual approvals; permitted reads need none.
acceptEdits- Also auto-approves in-scope edits and common filesystem commands.
plan- Explore without editing source; may run classifier-approved commands.
auto- A classifier reviews actions; availability and company policy apply.
dontAsk- Deny what would prompt; preapproved actions still run.
bypassPermissions- Skips routine approvals. Isolated environments only; explicit deny/ask safeguards still apply.
CLI: Shift+Tab cycles available modes; claude --permission-mode plan starts in Plan. Built-in defaults vary by plan, version and surface—not always Manual.
Bash(npm run lint) matches that exact command. Bash(npm run *) is broader and can run any matching project script. Review scripts before allowing them.
Read(./.env) is a file-tool restriction, not a guarantee that an allowed Python or Node process cannot read secrets. Bash patterns likewise are not program-level isolation. Use sandboxing for filesystem/network enforcement and hooks for additional checks.
“Yes, and don’t ask again” for a Bash command saves a local allow rule; file-edit approval is session-only. Inspect actual sources with /permissions. Existing company policy wins; do not copy a bypass configuration.
Teaching examples only; buttons run no commands. Rules ↗ · Modes ↗ · Sandboxing ↗
12 / SKILLS
A skill is a reusable procedure.
Instructions on demand. Not additional model training.
Keep standing rules short.
CLAUDE.md: project conventions that remain relevant across tasks. A skill: the checklist for one repeatable job.Load the procedure when needed.
Normally, descriptions enter context; the body loads on use. This manual-only example keeps its description out too.
Choose when it runs.
Save the file shown here, then type
/review-change. It asks for evidence, not edits or a commit.
.claude/skills/review-change/SKILL.md
---
description: Review local changes for behavioral risks.
disable-model-invocation: true
---
Do not edit files, stage changes, or commit.
1. Inspect `git status --short`, `git diff`,
and `git diff --cached`. Read relevant
code and untracked files without staging.
2. Identify behavioral risks and inspect
the callers or evidence needed to assess them.
3. Report each finding with file, line,
evidence, and user-visible impact.
If none are supported, say so.
An instruction is not a permission boundary. Keep normal tool approvals in place. Skills reference ↗
13 / MODEL CONTEXT PROTOCOL
MCP connects the tools.
A protocol for tools and data—not a skill, a model, or free context.
Example: resolve one documentation question.
Through an authorized read-only integration, retrieve one issue and the relevant documentation section. Answer the issue’s question with linked evidence. Do not post a comment.
/mcp shows the servers actually available. This example does not assume one is installed.
What enters context?
Where tool search is available, full schemas are deferred by default. Names and server instructions still load; selected schemas and returned content enter context when used. Scope the query instead of loading an entire knowledge base.
Use a CLI when it is enough.
An existing authorized CLI can fetch the same evidence without another integration. Use MCP when you need its external tools or data access.
Grant the smallest access.
Trust the server. Start read-only. Require approval before writes; a connection is not permission to change everything.
Treat source text as data.
Issues and documents can contain prompt injection. Their instructions do not override your task or security boundaries.
Deferred schemas reduce upfront overhead; returned evidence is still input. MCP reference ↗
14 / TOKENMAXXING
Maximize useful work,
not token burn.
Read evidence, not everything.
Target file ranges, relevant callers, and filtered logs. Preserve enough surrounding context to explain the behavior.
Define what done looks like.
Give an outcome, constraints, and acceptance criteria. Verify in the actual app or command—not just a confident summary.
Keep context purposeful.
On-demand skills beat a giant
CLAUDE.md. Keep the cache prefix stable within a task; compact at boundaries and clear unrelated work.Choose by results and real economics.
Use observed subscription usage and task quality—not API rates alone. Add focused subagents only when their independent work earns the overhead.
Free cache reads ≠ free context. Even where reads have no observed marginal charge, they occupy a finite window and compete for attention. New input and generated output are not free.
No idle busywork, quota bypass, or rate-chasing model switches. Usage & costs ↗ · Prompt caching ↗ · Subagents ↗
15 / LIVE DEMONSTRATION
One real task.
One reusable procedure.
Demo candidates, adapted from my workflows; no company data.
Choose one candidate.
- Change a small public website; inspect desktop and mobile.
- Build a source-backed comparison with linked evidence.
- Use a read-only documentation lookup to answer one concrete issue.
Ready-to-paste review for this presentation
Review the keyboard navigation of this
presentation. Do not edit.
Identify any interaction where typing or
arrow keys unexpectedly changes slides.
Cite the handler and reproduce it in the
browser, including the context-window select.
If no issue is supported, report what you
checked. Do not manufacture a bug.
Do not commit or deploy.
Run it live.
- Select a throwaway or public repo. Inspect
/contextas the baseline. - Run
/review-changeafter saving the example skill, or give one focused task. - Inspect the diff. Run the actual app or appropriate command; show the evidence.
- Show
/contextand/usageafterward. Separate window size from cumulative usage.
Public repo and sanitized terminal only. No credentials, private transcripts, or company data on screen. Skills and integrations need real setup. Skills ↗ · Usage ↗
16 / AGENT TEAMS · SESSIONS, NOT JUST TASKS
Teammates are sessions you can enter.
Subagent / focused delegation
Main → delegated task → result back
The main agent manages the assignment. You usually care about the returned result.
Not strictly one-shot. Recent versions let you resume a subagent. Named subagents can also message peers.
Talk to each other.
Teammates exchange findings and coordinate directly—not only through the lead.
Stay available.
Long-lived Claude Code sessions retain their context between assignments. Send another task without starting a fresh worker.
Enter any teammate.
Inspect its conversation and redirect it yourself. In tmux split-pane mode, each teammate has a terminal pane you can view and control directly.
Live demonstration: inspect and steer a teammate in tmux
In an approved environment with tmux installed, enable teams and explicitly request split-pane mode:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude --teammate-mode tmux
Ask for two review teammates. Show them sharing findings, enter one pane and give it a follow-up, then return to the lead. In-process mode is also available: select a teammate in the agent panel and press Enter to inspect or message it.
Experimental and disabled by default. Long-lived does not mean guaranteed survival across quitting or resuming the lead session. Confirm company permissions before the demonstration.
The benefit: direct collaboration and easier inspection. The trade-off: every session adds context and usage. Agent-team sessions & display modes ↗
17 / FUTURE · DEPENDS ON APPROVED PROVIDER ACCESS
Own the harness.
Own the trade-offs.
Not available at our company today. An architecture proposal—not a promised rollout.
Model ≠ harness
The model predicts output and tool calls. The harness owns session state, tool execution, permissions, scheduling, context, cache boundaries, compaction, and recovery.
Before building
- Approved OpenAI or other provider access, API entitlements, and billing. A subscription does not automatically fund APIs.
- Provider-specific token accounting and cache semantics. Cache reads are not universally free.
- Approved security boundaries, secret storage, data policy, and human approval points.
- Evaluations against the current workflow: quality, latency, and total spend.
- Recovery ownership: durable state, bounded retries, safe replay, and protection against duplicate side effects.
Four useful possibilities
- Route by task. Choose an approved provider and model for the work.
- Own session lifecycle. Explicit start, resume, compact, and close—with durable history.
- Bound parallel work. Schedule workers with per-session spend limits.
- Keep the evidence. Recorded-event replay, audit, and verification before approval.
More control also means migration and operational responsibility—not automatic savings. SDKs provide building blocks, not company approval. Claude Agent SDK ↗ OpenAI agent runtimes ↗