claudio.cool
CCAR-PLessons

CCAR-P · Developer Productivity and Operational Enablement

Configuring Claude Code and the Agent SDK, permission modes, hooks, subagents and CI

⏱ 3 min readDraft

Three requests to the same platform team: an assistant for developers that explores a monorepo without touching it, a nightly job that updates dependencies and opens pull requests, and an automatic CI review that gives the same result on any runner. All three use Claude Code or the Agent SDK, and each needs a different configuration.

The permission mode is the level of autonomy

Permission modes set what runs without asking:

Mode What it does When
default reads without asking; edits, commands and network ask for approval interactive work with an attentive person
acceptEdits also approves edits and basic file commands inside the working directory bounded coding tasks with review afterwards
plan explores and proposes; doesn’t edit until the plan is approved investigating a monorepo, large changes
auto everything runs, but a classifier reviews each action and blocks risky ones autonomy with a safety net, where available
dontAsk anything that would prompt is denied; only pre-approved tools and reads run CI and locked-down scripts
bypassPermissions skips prompts and safety checks; deny rules still apply only in isolated environments (container or VM without internet)

For unattended work the question is: what is the most it can do if it gets it wrong? dontAsk with a short list of allowed tools makes that maximum explicit; bypassPermissions leaves it unbounded. Administrators can also disable that mode from managed settings.

Hooks and subagents

A hook is a command that runs at a point in the lifecycle (before or after a tool, at the end). Because it always runs, it is the place for whatever can’t depend on the model: blocking writes to protected paths, running the linter, recording an audit trail. A subagent definition sets its description, its prompt and only the tools it needs: the code reviewer reads, doesn’t write; the one that runs migrations writes but has no network. It is least privilege applied to the workflow.

Headless operation

In CI you use non-interactive mode (claude -p) or the Agent SDK. By default the run loads whatever is on the machine: hooks, plugins, MCP and the runner user’s CLAUDE.md, so each runner gives a different result. Bare mode (--bare) starts without reading any of that and whatever the job needs is passed explicitly: allowed tools, settings, MCP servers, instructions and output format (--output-format json). Hand-configuring each machine’s ~/.claude doesn’t fix reproducibility.

Typical traps

  • Choosing the most permissive mode “so the job doesn’t get stuck”, instead of pre-approving the job’s tools.
  • Putting a security rule only in CLAUDE.md or in the subagent’s prompt.
  • Giving every subagent every tool.
  • Letting the CI runner inherit local configuration.

On the exam

For an unattended automation, look for dontAsk (or auto if the scenario allows it) with pre-approved tools, hooks for non-negotiable limits and subagents with just the right tools. For an exploration assistant, plan. For CI reproducibility, -p with --bare and everything through flags.

Quick question

A practice exam question on this domain. It counts towards your progress.

A travel company's backend team is replacing a legacy payment client across a service that touches about 40 files. A developer asked Claude Code, in a single prompt, to 'migrate everything to the new client', and let it edit freely.

The resulting diff was huge. Some call sites used the new retry options and others did not, two files were missed entirely, and a helper was renamed in a way that broke an unrelated module. Reviewing it took longer than doing the work by hand.

The team has good unit and integration test coverage for the payment flows, which runs in about four minutes.

The tech lead wants a repeatable way of working for similar migrations planned this year.

Which workflow should the tech lead recommend?

Practise this domain in a practice exam →