PILOT — Private preview. Progress is saved for this browser session only.
HaiPhai.AI Fluency for Biotech

Agentic Tasks — Safe Autonomy with Claude Code

Lesson 5~16 min1-question check

Module 12 · Lesson 05

Agentic Tasks — Safe Autonomy with Claude Code

Reading time: 16 minutes Track: Claude Fluency for Teams · Developer path


What agentic mode is

In standard use, Claude Code responds to prompts one at a time. You prompt, it responds, you review, you prompt again.

In agentic mode, Claude Code executes a sequence of actions — reading files, running commands, making changes, running tests — with minimal interruption. You give it a goal; it plans and executes multi-step workflows to achieve it.

This is significantly more powerful than turn-by-turn interaction, and significantly more capable of going wrong in hard-to-reverse ways.

When agentic tasks make sense

Good candidates:

  • "Run our full test suite, identify flaky tests, and add retry logic to those tests"
  • "Migrate all uses of the deprecated API X to the new API Y across the codebase"
  • "Add comprehensive JSDoc comments to all public functions in /src/utils"
  • "Find all hardcoded strings in the UI layer and extract them to a constants file"

These share common properties: the goal is clear and verifiable, the scope is bounded, mistakes are reversible (via version control), and the changes are mechanical enough that Claude is unlikely to introduce unexpected logic changes.

Poor candidates:

  • "Refactor the authentication system" (too architectural, requires judgment)
  • "Fix the performance issues" (vague, requires investigation before action)
  • "Add the new feature" (requires design decisions)

Safety setup for agentic tasks

1. Always work on a clean branch

Before any agentic task, create a new branch:

git checkout -b claude/task-description

This makes the work fully reversible with git checkout main.

2. Set clear scope limits in your prompt

Migrate all uses of OldApiClient to NewApiClient.
Scope: only files in /src, not in /tests or /docs.
Do not change the function signatures of any public exports.

Explicit scope prevents Claude from "helpfully" touching things you didn't want touched.

3. Checkpoint on significant decisions

For tasks where judgment calls are required, add: "Before making any architectural decision (not mechanical change), stop and describe the decision to me."

4. Review the plan before execution

For complex tasks:

Before you start, describe your plan: what steps you'll take, in what order,
and what could go wrong. I'll approve the plan before you execute.

This takes 2 minutes and prevents major wrong-turns.

Reviewing agentic output

After Claude completes an agentic task:

git diff main...HEAD --stat    # what changed
git diff main...HEAD           # line-by-line

Review the diff the same way you'd review a PR from a developer you trust but whose work you still check. For large automated changes, focus on:

  • Representative samples of the changes (not exhaustive)
  • Any file that changed significantly more than expected
  • Whether tests still pass

The permission level question

Claude Code has three permission modes:

  • Default (ask before every action): Best for exploratory and first-time tasks
  • Auto-approve-edits: Good for tasks that are clearly mechanical file modifications
  • Full autonomy (--dangerously-skip-permissions): Only in isolated CI/container environments, never on your development machine

Err toward asking more permission prompts, not fewer. The friction of approvals is much lower than the cost of reversing an unexpected change.

Knowledge check

1 question · select an answer to see if you got it
1.Before starting any agentic Claude Code task that will modify files, what's the non-negotiable first step?
Ready to apply this?
Practice with AI →

Bring a real challenge from your work — the AI will help you apply what you just learned.