Key Points

Before We Use AI: What Are We Practising?


  • This lesson teaches you to inspect, question, constrain and validate AI output. It does not teach you to hand off your thinking.
  • Generation, understanding and validation are different skills. Generation is the easy one.
  • Reviewing unfamiliar generated code can cost real effort, especially when it brings in ideas you do not know.
  • Working code is not the same as trustworthy code. A result can pass one check and still be wrong.
  • Permission to run an action is separate from approval of its result.

CLI-Based AI


  • Ask what an AI tool can see and do, in its actual configuration, before you trust it.
  • A CLI agent can read, run and edit your real files, so checking what it changed is part of the work.
  • Run /init once to create CLAUDE.md, then edit it by hand.
  • An instruction file records constraints for people and tools to read. It is not an enforced boundary. Tests check the result.
  • Check which instruction file your tool loaded before you rely on it.

Best Practices for Prompting


  • Name four things in a prompt: input, intended change, constraints and evidence.
  • Review the plan before the agent acts. Mark an unsupported assumption and approve one bounded action.
  • Plan mode restricts source edits. It is not a universal sandbox.
  • Prefer prompts that preserve learning: ask for plans, hints and the simplest version.
  • An agent’s self-review is a lead to check, not proof.

Data Cleaning with AI


  • Predict the inconsistencies yourself before you prompt, so you can judge the AI’s plan.
  • Ask for a plan first, mark the assumption the data do not support, then generate code.
  • Read the diff and explain a changed line before you run it.
  • Check with concrete evidence (row count, missing values, dates), not because the script ran.

Validation Strategies: The Approval Gate


  • The approval gate supports one decision: accept, revise or reject a bounded piece of code.
  • Passing checks does not validate the study or the scientific claim.
  • Take expected values from the source documentation, not from the code under test.
  • A check earns trust when it fails on a known-bad input.
  • Rewrite time is a local signal about your workflow, not a productivity score.
  • You cannot validate what you cannot explain.

Limitations and Cautions


  • Avoid AI for security-critical tasks, sensitive data and basic syntax practice.
  • Know when AI supports learning and when it gets in the way.
  • Compare code with your approved requirements. Do not sync the requirements to the code without evidence.
  • Check a package against the official registry. Existence on the registry is not proof of fit.
  • Archive code, inputs, environment and commands so your analysis reruns without the model.
  • You are responsible for the final output.

From AI Output to a Review-Ready Bundle


  • A review-ready bundle holds requirements, code, checks, a result, the environment, exact commands, provenance and a decision. A script that runs is not enough.
  • Another person rerunning your work without AI is the strongest test of the bundle.
  • A descriptive plot is not a statistical finding.
  • A plot can render cleanly and still be wrong. Domain plausibility is your job.
  • “Revise” is an honest outcome when the evidence does not yet cover the claim.

Resources and Next Steps


  • The workflow transfers across tools. Match the tool and backend to the task and the data category.
  • Credit AI use openly. It cannot be an author.
  • Leave with a plan for your own data, including one check that would catch a likely error.
  • Before adopting a tool, check its scope claims, transparency, citations and privacy terms.