Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Setup guides

Setup guide · Essentials

Install Claude Code

Claude Code installed, signed in with your own Claude subscription, and answering scripted claude -p calls with JSON output.

15 min Updated 2026-10-31

Claude Code is the agent you'll use for nearly every hands-on exercise. You run it in an empty folder and paste the exercise prompt in, and many exercise projects also call it from code as claude -p when they need a model. Both run on your Claude subscription, so you don't need an API key for them.

Before you start

  • A paid Claude plan: Pro, Max or Ultra on your personal claude.ai account. The free plan doesn't include Claude Code.
  • OS: macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+ or Alpine 3.19+, with 4 GB of RAM or more.
  • Windows: you can run Claude Code natively or inside WSL. Native Windows works without extra software. If you install Git for Windows, Claude Code uses Git Bash for shell commands; without it, it uses PowerShell.

1. Install Claude Code

Use the native installer. It updates itself in the background.

macOS, Linux, WSL

curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell

irm https://claude.ai/install.ps1 | iex

Windows CMD

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

The installer shows no progress while it downloads. When it finishes, open a new terminal window and check the install:

claude --version

If you'd rather use Homebrew, run brew install --cask claude-code. That cask follows the stable channel and doesn't update itself, so run brew upgrade claude-code from time to time.

2. Sign in with your subscription

Start Claude Code in any folder:

mkdir claude-sandbox && cd claude-sandbox
claude

A browser window opens. Sign in with your claude.ai account and approve access. The terminal shows Login successful. If the browser doesn't open, press c to copy the login URL and paste it into a browser yourself.

You can also sign in from the shell without starting a session, and check which credential is active:

claude auth login
claude auth status --text

Keep ANTHROPIC_* variables out of your shell profile

If ANTHROPIC_API_KEY is set, claude -p always uses it, so those calls are billed to that API account instead of your subscription. Interactive sessions ask you first. The same applies to ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN: if you export them for OpenRouter or Ollama, Claude Code spends your OpenRouter credits or talks to Ollama too. Run unset ANTHROPIC_API_KEY ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN and check /status to go back to the subscription; exercise projects keep these variables in their own .env.

3. Run a first session

Inside the session, type a request in plain English:

Create a file hello.py that prints the current date, then run it.

Claude Code shows each file edit and shell command and asks for permission before running it. Useful commands inside a session:

CommandWhat it does
/helpList commands
/statusShow the account, model and credential in use
/modelSwitch model
/mcpShow connected MCP servers
/resumeReopen an earlier conversation
/login, /logoutSwitch or re-authenticate accounts

For exercises, start each one in a fresh, empty folder so earlier files don't confuse it.

4. Use Claude Code headless with claude -p

-p (or --print) runs one prompt non-interactively, prints the answer and exits. It reads stdin too:

claude -p "Explain what a context window is in two sentences."
cat notes.txt | claude -p "Summarise these notes as five bullets."

JSON output

--output-format json returns one JSON object. The answer is in result, and there's also session_id, usage and an estimated total_cost_usd. On a subscription that figure is only an estimate; you aren't billed per call.

claude -p "Name three sorting algorithms." --output-format json | jq -r '.result'

Structured output with a schema

Add --json-schema with a JSON Schema, and the validated object comes back in structured_output:

claude -p "Extract the people and dates from: Ada met Charles on 5 June 1833." \
  --output-format json \
  --json-schema '{"type":"object","properties":{"people":{"type":"array","items":{"type":"string"}},"dates":{"type":"array","items":{"type":"string"}}},"required":["people","dates"]}' \
  | jq '.structured_output'

If Claude can't produce valid output, for example because it declined, the response has no structured_output field. Check that it's there before you use it.

Controlling tools

In a -p run nobody can answer a permission prompt, so any tool call that needs approval is denied. Two flags control this:

  • --tools "Read,Grep" limits which built-in tools exist at all. --tools "" turns them all off, which makes claude -p a pure text-in, text-out model call.
  • --allowedTools "Read,Edit,Bash(npm test *)" lets the listed tools run without asking. Rules use permission syntax: Bash(git diff *) allows any command starting with git diff.

Other flags exercises use: --model sonnet (aliases sonnet, opus, haiku), --max-turns 3, --append-system-prompt "…" and --no-session-persistence.

Calling it from code

Exercise projects run claude -p as a subprocess and parse the JSON:

ask.py
import json, subprocess
 
def ask(prompt: str) -> str:
    out = subprocess.run(
        ["claude", "-p", prompt, "--output-format", "json", "--tools", ""],
        capture_output=True, text=True, check=True,
    )
    return json.loads(out.stdout)["result"]
 
print(ask("Reply with the single word: ready"))

Passing arguments as a list avoids shell quoting, which matters for JSON schemas on Windows.

Don't add --bare for subscription runs

The docs recommend --bare for CI because it skips local hooks, skills and MCP servers. But bare mode never reads your subscription login, so it needs an API key. Leave it off for these exercises.

Check it works

claude -p "Reply with the single word: ready" --output-format json | jq -r '.result'

Expected output:

ready

Without jq, drop the pipe and look for "result":"ready" in the JSON.

Troubleshooting

claude: command not found after installing. Open a new terminal. If it still fails, the install directory (~/.local/bin on macOS and Linux) isn't on your PATH; claude doctor and the install troubleshooting page show the fix.

'irm' is not recognized or The token '&&' is not a valid statement separator. You ran the PowerShell command in CMD, or the other way round. Use the command for the shell you're in.

claude -p says you're not logged in, or charges show up on an API or OpenRouter account. Run claude auth status. If authMethod is api_key, or /status inside a session shows an OpenRouter or Ollama base URL, unset ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, then run claude auth login.

A -p run stops without doing the work. A tool it needed was denied. Add it to --allowedTools, or run the task interactively once to see which permission it asks for.

Going further

  • MCP servers in Claude Code
  • OpenRouter or a local model? for exercises whose code calls a model API directly
  • Point Claude Code at a local model

Sources

  • Advanced setupDocs · AnthropicSystem requirements, the native installer for each OS, updates and uninstalling.
  • Run Claude Code programmaticallyDocs · AnthropicEverything about `claude -p`, including JSON output, `--json-schema` and auto-approving tools.
  • AuthenticationDocs · AnthropicHow subscription login works and the order in which Claude Code picks a credential.
  • CLI referenceDocs · AnthropicEvery flag, including `--tools`, `--allowedTools`, `--model` and `--max-turns`.

Exercises that use this

  • Build the Quillmoor environment and grade Claude Code on end stateAgent Benchmarks and Simulations · Stateful environments and end-state grading
  • Simulate customers against Claude CodeAgent Benchmarks and Simulations · Building user simulators
  • Measure the cost of difficult customersAgent Benchmarks and Simulations · Building user simulators
  • Play the customer and swap the simulatorAgent Benchmarks and Simulations · Validating user simulators
  • Build and calibrate a simulator-adherence judgeAgent Benchmarks and Simulations · Validating user simulators
  • Package five Quillmoor tasks for Harbor and run the controlsAgent Benchmarks and Simulations · Task specs, harnesses and sandboxes
  • Run the Quillmoor suite under four infrastructure settingsAgent Benchmarks and Simulations · Noise, reproducibility and eval infrastructure
  • Re-annotate a Quillmoor suite with planted flawsAgent Benchmarks and Simulations · Contamination, saturation and broken tasks
  • Probe a public benchmark for memorisationAgent Benchmarks and Simulations · Contamination, saturation and broken tasks
  • Red-team your Quillmoor benchmarkAgent Benchmarks and Simulations · Auditing benchmarks for exploits
  • Fit, flag and prune the Quillmoor suiteAgent Benchmarks and Simulations · Item analysis, difficulty and time horizons
  • Fit a time horizon and break itAgent Benchmarks and Simulations · Item analysis, difficulty and time horizons
  • Build the Quillmoor benchmark report cardAgent Benchmarks and Simulations · Reporting results and reading model cards
  • Watch the agent loop in Claude CodeAgent Foundations · What is an agent?
  • Run the same task through the Agent SDKAgent Foundations · What is an agent?
  • Build a register tool and give it to Claude CodeAgent Foundations · Tools and the agent-computer interface
  • Turn the tool into an MCP serverAgent Foundations · Tools and the agent-computer interface
  • Measure context and move procedure into a skillAgent Foundations · Context engineering
  • Isolate lease reading in a subagentAgent Foundations · Context engineering
  • Produce and verify grounded title reportsAgent Foundations · Structured outputs and grounding
  • Same report through the Agent SDKAgent Foundations · Structured outputs and grounding
  • Build a chain with a code gate, then add routingAgent Foundations · Workflow patterns
  • Orchestrator-workers and an evaluator loop with subagentsAgent Foundations · Workflow patterns
  • Build and run a 10-case evalAgent Foundations · Risk and first evals
  • Block outbound actions with a hookAgent Foundations · Risk and first evals
  • Build a fleet compute and token cost modelInfrastructure for Agents · Where agents run
  • Measure active CPU against wall timeInfrastructure for Agents · Where agents run
  • Build and attack a local code runnerInfrastructure for Agents · Sandboxes for agent code
  • Egress allowlists and credential brokering in a microVMInfrastructure for Agents · Sandboxes for agent code
  • Build a toy durable execution engineInfrastructure for Agents · Durable execution engines
  • A completion workflow on Temporal with signals and a deadlineInfrastructure for Agents · Durable execution engines
  • Simulate leases, redelivery and fairnessInfrastructure for Agents · Queues, schedules and background jobs
  • An idempotent consumer against a local queueInfrastructure for Agents · Queues, schedules and background jobs
  • Build and test a session store adapterInfrastructure for Agents · State, sessions and checkpoints
  • Find every copy: an erasure dry runInfrastructure for Agents · State, sessions and checkpoints
  • Row-level security that fails closedInfrastructure for Agents · Secrets, identity and tenant isolation
  • A per-firm credential proxyInfrastructure for Agents · Secrets, identity and tenant isolation
  • Simulate fallbacks, correlation and budgetsInfrastructure for Agents · AI gateways
  • A self-hosted gateway with per-firm keysInfrastructure for Agents · AI gateways
  • Build a paired eval gate for CIInfrastructure for Agents · Environments and delivery for agents
  • Roll out a prompt by matter, with shadow runsInfrastructure for Agents · Environments and delivery for agents
  • Inventory the memory of an agent you useAgent Memory · Memory types for agents
  • Measure fact drift across repeated compactionAgent Memory · The context window as working memory
  • Re-inject matter state after compaction in Claude CodeAgent Memory · The context window as working memory
  • Build and attack a per-matter memory-tool handlerAgent Memory · Files, skills and memory tools
  • Write a skill that survives compactionAgent Memory · Files, skills and memory tools
  • Build a miniature knowledge-update benchmarkAgent Memory · Memory frameworks and benchmarks
  • Do due diligence on a memory frameworkAgent Memory · Memory frameworks and benchmarks
  • Build a scoped memory store with provenance-based deletionAgent Memory · Scoping, retention and erasure
  • Build the write-update-forget pipeline for a 12-week matterAgent Memory · Write, update and forget
  • Design a reviewed consolidation jobAgent Memory · Write, update and forget
  • Build shared matter state and attack itAgent Memory · Shared state and memory poisoning
  • Red-team persistence across sessionsAgent Memory · Shared state and memory poisoning
  • Run a memory ablation on synthetic mattersAgent Memory · Evaluating memory
  • Model memory cost for your session patternAgent Memory · Evaluating memory
  • One task, two modes of the same harnessBuilding Agents with Claude and eve · Choosing a harness
  • Guardrails in Claude Code: tool, permissions, hooksBuilding Agents with Claude and eve · The Claude Agent SDK
  • Run the title-review agent on the SDKBuilding Agents with Claude and eve · The Claude Agent SDK
  • Build and break a contract-pack reader in eveBuilding Agents with Claude and eve · Agents as files with eve
  • Make a side-effecting tool safe to replayBuilding Agents with Claude and eve · Agents as files with eve
  • An enquiries skill and a search-reviewer subagent in Claude CodeBuilding Agents with Claude and eve · Skills and subagents
  • Port the skill and subagent to eveBuilding Agents with Claude and eve · Skills and subagents
  • A solicitor-approved send in eveBuilding Agents with Claude and eve · Human approval for high-stakes actions
  • The same gate in the Agent SDKBuilding Agents with Claude and eve · Human approval for high-stakes actions
  • Route auth and tenant isolation, checkedBuilding Agents with Claude and eve · Shipping agents
  • Deploy to Vercel with a deployable modelBuilding Agents with Claude and eve · Shipping agents
  • Build and tune a page triageDocument Ingestion Pipelines · What a real case file contains
  • Unpack and deduplicate a matter's emailDocument Ingestion Pipelines · What a real case file contains
  • Run a four-way parser bake-offDocument Ingestion Pipelines · Parsing: text layers to vision models
  • Self-host an open parsing modelDocument Ingestion Pipelines · Parsing: text layers to vision models
  • Verify tables and plan references in codeDocument Ingestion Pipelines · Tables, plans and handwriting
  • Measure two-reader agreement on handwritingDocument Ingestion Pipelines · Tables, plans and handwriting
  • Extract lease terms with page-verified evidenceDocument Ingestion Pipelines · Structured extraction at scale
  • Compare long-document strategiesDocument Ingestion Pipelines · Structured extraction at scale
  • Build a crash-safe ingest workflowDocument Ingestion Pipelines · Durable ingest pipelines
  • Simulate retry granularityDocument Ingestion Pipelines · Durable ingest pipelines
  • Build incremental re-ingestion with early cutoffDocument Ingestion Pipelines · Re-ingestion, versioning and backfills
  • Build and measure a hybrid PII detectorDocument Ingestion Pipelines · PII detection and redaction
  • Redact a PDF and prove itDocument Ingestion Pipelines · PII detection and redaction
  • Build an ingest eval harnessDocument Ingestion Pipelines · Ingest evals and the hand-off
  • Specify and test the retrieval hand-offDocument Ingestion Pipelines · Ingest evals and the hand-off
  • Write an eval charter for one agentEvaluating and Scoring Agents · Why evals, and their vocabulary
  • Run your first repeated trials in Claude CodeEvaluating and Scoring Agents · Why evals, and their vocabulary
  • Build a trace viewer and a counted taxonomyEvaluating and Scoring Agents · Error analysis from traces
  • Generate a balanced 24-task datasetEvaluating and Scoring Agents · Error analysis from traces
  • Write five eve evals for the enquiries agentEvaluating and Scoring Agents · Code-based graders
  • Mutation-test your gradersEvaluating and Scoring Agents · Code-based graders
  • Build a Claude Code judge and measure its position biasEvaluating and Scoring Agents · LLM-as-judge
  • Wire a judge into your eve evalsEvaluating and Scoring Agents · LLM-as-judge
  • Calibrate your Claude Code judge against your own labelsEvaluating and Scoring Agents · Calibrating judges
  • Pick a t.judge threshold and correct a reported rateEvaluating and Scoring Agents · Calibrating judges
  • Build a per-task rubric grader and check it criterion by criterionEvaluating and Scoring Agents · Rubrics per task
  • Draft rubrics with a model and compare them with yoursEvaluating and Scoring Agents · Rubrics per task
  • Measure the baseline to beatFine-Tuning and RL for Agents · Prompt, optimise or train?
  • Cost the experiment and the deploymentFine-Tuning and RL for Agents · Prompt, optimise or train?
  • Turn teacher trajectories into a TRL datasetFine-Tuning and RL for Agents · Training data from traces
  • Audit the set against the test splitFine-Tuning and RL for Agents · Training data from traces
  • Fine-tune the triage adapter on a free GPUFine-Tuning and RL for Agents · SFT with LoRA on a free GPU
  • A three-run sweep and the noise in picking its winnerFine-Tuning and RL for Agents · SFT with LoRA on a free GPU
  • DPO the free-text fields with on-policy pairsFine-Tuning and RL for Agents · Preference optimisation
  • KTO from thumbs, against DPO on the same budgetFine-Tuning and RL for Agents · Preference optimisation
  • GRPO the verifiable triage fields on a free GPUFine-Tuning and RL for Agents · GRPO in practice
  • Reproduce TRL's loss aggregations by handFine-Tuning and RL for Agents · GRPO in practice
  • Build and validate a composite triage rewardFine-Tuning and RL for Agents · Designing rewards
  • Compare a relative judge with a pointwise oneFine-Tuning and RL for Agents · Designing rewards
  • Wrap the triage tools as a TRL environment and run multi-turn GRPOFine-Tuning and RL for Agents · Multi-turn RL environments
  • Measure step-level credit on your own rolloutsFine-Tuning and RL for Agents · Multi-turn RL environments
  • Hunt the escalation hack and fix the rewardFine-Tuning and RL for Agents · Reward hacking, regressions and shipping
  • Serve two adapters and gate them against the Claude baselineFine-Tuning and RL for Agents · Reward hacking, regressions and shipping
  • Implement and stress-test a byte-level BPE tokenizerLLMs for Engineers · Tokens and embeddings
  • Probe embedding geometryLLMs for Engineers · Tokens and embeddings
  • Implement attention and verify it against PyTorchLLMs for Engineers · Attention, step by step
  • Find an induction head in GPT-2LLMs for Engineers · Attention, step by step
  • Build a block and verify parameter counts against real modelsLLMs for Engineers · The transformer block
  • Prove RoPE is relative, numericallyLLMs for Engineers · The transformer block
  • Fit your own scaling law on a laptopLLMs for Engineers · Pretraining and scaling laws
  • Base model versus assistant on conveyancing promptsLLMs for Engineers · Pretraining and scaling laws
  • Build a verifiable reward and simulate GRPO advantagesLLMs for Engineers · Post-training an assistant
  • Measure and catch hallucinations in lease extractionLLMs for Engineers · Sampling and hallucination
  • Simulate decoding strategiesLLMs for Engineers · Sampling and hallucination
  • Watch prompt caching hit and missLLMs for Engineers · Context windows, KV cache and caching
  • Implement a KV cache and measure the speed-upLLMs for Engineers · Context windows, KV cache and caching
  • Run an effort sweep on conveyancing calculationsLLMs for Engineers · Reasoning models and extended thinking
  • Self-consistency versus more thinkingLLMs for Engineers · Reasoning models and extended thinking
  • Run a model bake-off on title-register extractionLLMs for Engineers · Choosing and comparing models
  • Add an open-weight model to the bake-offLLMs for Engineers · Choosing and comparing models
  • Write, pilot and price a rating guidelineHuman Feedback at Scale · Designing human evaluations
  • Measure and diagnose four ratersHuman Feedback at Scale · Agreement and disagreement among many raters
  • Aggregate labels with Dawid–SkeneHuman Feedback at Scale · Agreement and disagreement among many raters
  • Run a small internal arena for three prompt versionsHuman Feedback at Scale · Pairwise preferences and rankings
  • Measure four feedback signals and correct a satisfaction rateHuman Feedback at Scale · Feedback from users
  • Wire feedback to traces in a live help-centre stubHuman Feedback at Scale · Feedback from users
  • Build and validate a privacy-preserving topic mapHuman Feedback at Scale · Understanding usage at scale, privately
  • Scale the map with a local model and add differential privacyHuman Feedback at Scale · Understanding usage at scale, privately
  • Check PPI's intervals against known ground truthHuman Feedback at Scale · Estimating quality from few labels
  • Active sampling with inverse-probability weightsHuman Feedback at Scale · Estimating quality from few labels
  • Build a review queue and promote what it findsHuman Feedback at Scale · Review queues and the dataset loop
  • Measure what pre-labels do to your own labelsHuman Feedback at Scale · Review queues and the dataset loop
  • Build a per-matter cost model from usage logsLLM Cost Engineering · Token economics of an agent fleet
  • Calibrate the model against real token countsLLM Cost Engineering · Token economics of an agent fleet
  • Simulate cache hits and costs for a matterLLM Cost Engineering · Prompt caching as system design
  • Measure warm-then-fan-out on your subscriptionLLM Cost Engineering · Prompt caching as system design
  • Simulate context policies with and without cachingLLM Cost Engineering · Trimming and compacting context
  • Test what compaction forgetsLLM Cost Engineering · Trimming and compacting context
  • Build a resumable batch extraction jobLLM Cost Engineering · Batch, flex and fast tiers
  • Measure a cost-quality curve and test a cascadeLLM Cost Engineering · Cost-quality curves, routing and cascades
  • Does a learned router beat self-confidence?LLM Cost Engineering · Cost-quality curves, routing and cascades
  • Distil a clause tagger and measure the gapLLM Cost Engineering · Distilling into small models
  • Build a serving cost calculatorLLM Cost Engineering · Self-hosting break-even
  • Benchmark an engine yourselfLLM Cost Engineering · Self-hosting break-even
  • Build a cost ledger with budgets and alertsLLM Cost Engineering · Attribution, budgets and alerts
  • Build the naive server and measure its baselineBuilding MCP Servers · MCP and REST: two mental models
  • Generate the naive server from an OpenAPI descriptionBuilding MCP Servers · MCP and REST: two mental models
  • Write an MCP server without the SDKBuilding MCP Servers · The protocol on the wire
  • Serve 2025-era clients and watch the wireBuilding MCP Servers · The protocol on the wire
  • Build the designed larchmere-desk serverBuilding MCP Servers · Designing tools, not endpoints
  • Add response_format to search_tickets and measure itBuilding MCP Servers · Designing tools, not endpoints
  • Test the server in both protocol erasBuilding MCP Servers · Testing and evaluating servers
  • Compare the naive and designed servers with an agentBuilding MCP Servers · Testing and evaluating servers
  • Add resources, a prompt and signed confirmationsBuilding MCP Servers · Resources, prompts and asking for input
  • Serve the server over Streamable HTTPBuilding MCP Servers · Remote servers and authorization
  • Protect it as an OAuth resource serverBuilding MCP Servers · Remote servers and authorization
  • Harden the server and replay an injected agentBuilding MCP Servers · Securing MCP servers
  • Red-team the server with canaries and claude -pBuilding MCP Servers · Securing MCP servers
  • Gate a server's contract in GitHub ActionsBuilding MCP Servers · Shipping and evolving servers
  • Package the server with logs, limits and a registry entryBuilding MCP Servers · Shipping and evolving servers
  • Explore the inbox and build the baselinesMachine Learning Foundations for LLM Work · Problems, data and baselines
  • Flag the features that arrive too lateMachine Learning Foundations for LLM Work · Problems, data and baselines
  • Split by time, then leak on purposeMachine Learning Foundations for LLM Work · Train, validation, test and leakage
  • Build a contamination checkMachine Learning Foundations for LLM Work · Train, validation, test and leakage
  • Fit a line by gradient descent in numpyMachine Learning Foundations for LLM Work · Loss functions and gradient descent
  • Mini-batches and momentumMachine Learning Foundations for LLM Work · Loss functions and gradient descent
  • Logistic regression in numpy, matched against scikit-learnMachine Learning Foundations for LLM Work · Logistic regression, step by step
  • Softmax cross-entropy and a numerical gradient checkMachine Learning Foundations for LLM Work · Logistic regression, step by step
  • Curves, a cost-based threshold and a calibration checkMachine Learning Foundations for LLM Work · Metrics, thresholds and calibration
  • Boosted trees: ranking against calibrationMachine Learning Foundations for LLM Work · Metrics, thresholds and calibration
  • Learning curves, cross-validated regularisation and a second modelMachine Learning Foundations for LLM Work · Overfitting, regularisation and cross-validation
  • Double descent on a laptopMachine Learning Foundations for LLM Work · Overfitting, regularisation and cross-validation
  • Simulate an eval and compute kappaMachine Learning Foundations for LLM Work · Probability for evaluation
  • Intervals and a paired comparison on the test ticketsMachine Learning Foundations for LLM Work · Standard errors, intervals and paired tests
  • Clustered standard errors by customerMachine Learning Foundations for LLM Work · Standard errors, intervals and paired tests
  • Build a nearest-neighbour duplicate finderMachine Learning Foundations for LLM Work · Vectors, dot products and embeddings
  • A single attention head on four tokensMachine Learning Foundations for LLM Work · Vectors, dot products and embeddings
  • The MLP in numpy, then in PyTorch, then against logistic regressionMachine Learning Foundations for LLM Work · A small neural network from scratch
  • Dropout and weight decay on the validation curveMachine Learning Foundations for LLM Work · A small neural network from scratch
  • Single agent versus lead plus subagents in Claude CodeProduction Agent Systems · Multi-agent systems
  • Build and break an idempotent outboxProduction Agent Systems · Durable, long-running agents
  • Red-team and harden a pack-reading agent in Claude CodeProduction Agent Systems · Security and prompt injection
  • Build a hash-chained audit log and a supervision samplerProduction Agent Systems · Compliance and auditability
  • Audit hook and retention policy in eveProduction Agent Systems · Compliance and auditability
  • Trace Claude Code runs and build a per-matter budget reportProduction Agent Systems · Observability and cost
  • Session budgets and redacted exports in eveProduction Agent Systems · Observability and cost
  • Build a paired upgrade gate for Claude Code runsProduction Agent Systems · Continuous improvement
  • An eval-gated model swap in eve CIProduction Agent Systems · Continuous improvement
  • Rewrite the searches summariser and measure itPrompt and Context Optimisation · Prompting current Claude models
  • Effort versus prose instructionsPrompt and Context Optimisation · Prompting current Claude models
  • Run an example ablation on the enquiries drafterPrompt and Context Optimisation · Choosing few-shot examples
  • Three disciplined iterations on the enquiries drafterPrompt and Context Optimisation · Eval-driven prompt iteration
  • Measure prompt fragilityPrompt and Context Optimisation · Eval-driven prompt iteration
  • Build a small reflective optimiser on claude -pPrompt and Context Optimisation · Automatic prompt optimisation
  • DSPy: MIPROv2 versus GEPAPrompt and Context Optimisation · Automatic prompt optimisation
  • Build a skill-trigger eval in Claude CodePrompt and Context Optimisation · Optimising tools, instructions and skills
  • Transcript-driven tool improvementPrompt and Context Optimisation · Optimising tools, instructions and skills
  • Build and break an experiment analysisPrompt and Context Optimisation · Prompt registries and online tests
  • Wire a registry with labels and trace linkagePrompt and Context Optimisation · Prompt registries and online tests
  • Migrate the summariser behind a regression suitePrompt and Context Optimisation · Model migration and regression suites
  • Gate prompt changes in CIPrompt and Context Optimisation · Model migration and regression suites
  • Structure-aware and contextual chunking, measuredRetrieval and Knowledge Systems · Chunking structured documents
  • Build and run a labelled query setRetrieval and Knowledge Systems · Measuring retrieval
  • Verify citations end to end (stretch)Retrieval and Knowledge Systems · Measuring retrieval
  • Build and measure a hybrid pipelineRetrieval and Knowledge Systems · Hybrid search and reranking
  • Compare single-shot, grep-only and full agentic retrievalRetrieval and Knowledge Systems · Agentic retrieval
  • Build scoped matter tools with the Agent SDK (stretch)Retrieval and Knowledge Systems · Agentic retrieval
  • Build a graph from verified records, and compare with an LLM-extracted oneRetrieval and Knowledge Systems · Knowledge graphs and GraphRAG
  • Trial GraphRAG on a global question (stretch)Retrieval and Knowledge Systems · Knowledge graphs and GraphRAG
  • Compare long context, RAG and a router on your questionsRetrieval and Knowledge Systems · Long context versus RAG
  • Simulate the three buckets and the cache cliffScaling AI Systems · Rate limits and quotas
  • Log rate-limit headers and cache usageScaling AI Systems · Rate limits and quotas
  • Build and test a token-aware, fair limiterScaling AI Systems · Concurrency and flow control
  • Adaptive concurrency under a moving limitScaling AI Systems · Concurrency and flow control
  • Simulate a retry storm and stop itScaling AI Systems · Retries, backoff and overload
  • A circuit breaker with deadlines in front of a flaky mockScaling AI Systems · Retries, backoff and overload
  • Simulate the month-end rushScaling AI Systems · Backpressure, load shedding and batching
  • A deferrable-work batch pipeline against a mockScaling AI Systems · Backpressure, load shedding and batching
  • Instrument and speed up a real agent turnScaling AI Systems · Latency engineering for agents
  • When is speculation worth it?Scaling AI Systems · Latency engineering for agents
  • Measure a semantic cache as a classifierScaling AI Systems · Response caching and failover
  • Simulate failover with a cold cacheScaling AI Systems · Response caching and failover
  • Load test a fleet slice against a mockScaling AI Systems · Load testing and capacity planning
  • Write a capacity plan for doubling the fleetScaling AI Systems · Load testing and capacity planning
  • Build the discovery toolkitScoping and Delivering AI Projects · Landing and discovery
  • Report the contradictionsScoping and Delivering AI Projects · Landing and discovery
  • Build the feasibility-and-value calculatorScoping and Delivering AI Projects · Choosing the problem
  • Which rankings flip when the weights move?Scoping and Delivering AI Projects · Choosing the problem
  • Build the baseline and acceptance packScoping and Delivering AI Projects · Success criteria and baselines
  • Build the data readiness assessorScoping and Delivering AI Projects · Data access and readiness
  • Redaction dry run over the inbox sampleScoping and Delivering AI Projects · Data access and readiness
  • Build the scoping document generatorScoping and Delivering AI Projects · Scoping, phases and pricing
  • Fixed price versus time and materialsScoping and Delivering AI Projects · Scoping, phases and pricing
  • Build the pilot scorecardScoping and Delivering AI Projects · Running the pilot
  • Build the adoption and trust reportScoping and Delivering AI Projects · Trust, adoption and change
  • Build the handover pack with a weekly digestScoping and Delivering AI Projects · Handover and life after launch
  • Build the decision memo generatorScoping and Delivering AI Projects · The conversations that decide
  • Simulate static versus continuous batching with a paged KV cacheServing Open-Weight Models · Inside an inference engine
  • Measure what prefix caching saves on a real serverServing Open-Weight Models · Inside an inference engine
  • A GPU budget calculator from any config.jsonServing Open-Weight Models · GPU sizing arithmetic
  • Compare the calculator with the engine's own KV sizingServing Open-Weight Models · GPU sizing arithmetic
  • Two adapters, one serverServing Open-Weight Models · Serving your adapter
  • A model card, a registry entry and a start guardServing Open-Weight Models · Serving your adapter
  • Quantise and prove itServing Open-Weight Models · Quantisation with evidence
  • FP8 KV cache: tokens gained against evidenceServing Open-Weight Models · Quantisation with evidence
  • Turn ten result files into a benchmark reportServing Open-Weight Models · Latency, throughput and honest benchmarks
  • Reproduce the chunk-budget trade on a GPUServing Open-Weight Models · Latency, throughput and honest benchmarks
  • Build a speculative decoder and prove it is losslessServing Open-Weight Models · Speculative decoding in practice
  • n-gram speculation on a real serverServing Open-Weight Models · Speculative decoding in practice
  • Build a guided sampler, then use the server'sServing Open-Weight Models · Structured outputs and tool calls
  • Tool calls on an open modelServing Open-Weight Models · Structured outputs and tool calls
  • Write the service record and lint the launch commandServing Open-Weight Models · What self-hosting makes you responsible for
  • Deploy with a runbook: shadow, promote, roll backServing Open-Weight Models · Deployment and rollout
  • Kubernetes manifests, validated without a clusterServing Open-Weight Models · Deployment and rollout
  • Dashboard, alerts and a capacity plan, with no GPUServing Open-Weight Models · Observability and operations
  • Simulate prefix-aware routing across two replicasServing Open-Weight Models · Observability and operations
  • Measure what parsing prose costsSystem One Models with Jev · What a System One model is
  • Build a calibration toolkit and test it on two modelsSystem One Models with Jev · Calibrated probabilities
  • Build and test your first requestSystem One Models with Jev · Your first Jev request
  • Log the model that answered, and catch an alias moveSystem One Models with Jev · Your first Jev request
  • Build an enquiry question set and an option-order checkSystem One Models with Jev · Choice, Score and Noul
  • Route through a taxonomy with chained Choices and beam searchSystem One Models with Jev · Choice, Score and Noul
  • Build a state builder and a reads-then-computes pipelineSystem One Models with Jev · State and decomposition
  • Red-team your questions with injected instructionsSystem One Models with Jev · State and decomposition
  • Build a cost-derived confidence routerSystem One Models with Jev · Routing on confidence
  • Build a draft-then-gate reply pipelineSystem One Models with Jev · Jev alongside LLMs
  • Build an eval harness for System One answersSystem One Models with Jev · Evaluating Jev on your data
  • Start the lab notebook and write the hypothesesThink Like a PhD Student · The cycle and the question
  • Build the bibliography tool and ten entriesThink Like a PhD Student · Reading and searching the literature
  • Write metrics.py and the metric panelThink Like a PhD Student · Measuring what matters
  • Build the experiment harnessThink Like a PhD Student · Designing the experiment
  • Does an open model vary the same way?Think Like a PhD Student · Designing the experiment
  • Write and tag the pre-registrationThink Like a PhD Student · Pre-registration and trials
  • Build a blind paired reviewThink Like a PhD Student · Pre-registration and trials
  • Build a failure taxonomy from the pilot tracesThink Like a PhD Student · Open coding of failures
  • Test whether the taxonomy saturatesThink Like a PhD Student · Open coding of failures
  • Pilot the codebook with two annotatorsThink Like a PhD Student · Running an annotation study
  • Fill in the Human Evaluation DatasheetThink Like a PhD Student · Running an annotation study
  • Build the reproducibility packageThink Like a PhD Student · Reproducibility and research hygiene
  • Run the pre-registered analysisThink Like a PhD Student · Analysis and honest reporting
  • Run the multiverseThink Like a PhD Student · Analysis and honest reporting
  • Write the report and review anotherThink Like a PhD Student · Writing it up and peer review

On this page

  • Before you start
  • 1. Install Claude Code
  • macOS, Linux, WSL
  • Windows PowerShell
  • Windows CMD
  • 2. Sign in with your subscription
  • 3. Run a first session
  • 4. Use Claude Code headless with claude -p
  • JSON output
  • Structured output with a schema
  • Controlling tools
  • Calling it from code
  • Check it works
  • Troubleshooting
  • Going further
  • Sources
  • Exercises that use this