SOP: Operating Claude Code in the Terminal as a Senior Engineer
To define how a senior engineer configures, operates, and monitors Claude Code in the terminal to maximize throughput across codebases, infrastructure, and external systems — using automation primitives, permission controls, and integration tooling correctly and safely.
Superpowers5min read
This SOP applies to senior engineers running Claude Code in terminal environments with access to CI/CD pipelines, MCP server integrations, and cloud-hosted scheduling infrastructure. It covers session setup, task execution, subagent management, integration configuration, security controls, and visibility tooling.
| Role | Responsibility |
|---|---|
| Senior Engineer (Operator) | Selects permission modes, configures CLAUDE.md, initiates tasks, monitors agents, and escalates blocked actions |
| CI/CD Pipeline Owner | Integrates non-interactive Claude Code runs into pipelines via the -p flag |
| Security Reviewer | Reviews and approves CLAUDE.md rules, hook scripts, and permission mode selections before production use |
- Claude Code is installed and accessible from the terminal
CLAUDE.mdexists at the repository root and is version-controlled- Required MCP servers are configured and authenticated (Postgres, Figma, Jira, Linear, Sentry, or others as needed)
- The engineer understands the four permission modes:
acceptEdits,plan,auto, anddontAsk - Cloud infrastructure access is confirmed if using
/scheduleor/ultrareview - Any custom hook scripts and plugins are reviewed and placed in
bin/before session start
- Open or create
CLAUDE.mdat the repository root. - Define the system prompt, rules, constraints, and relevant context for this codebase.
- Commit
CLAUDE.mdto version control before starting any agent session. - If working across multiple directories, note that
/cdswitches directories mid-session without rebuilding the cache — plan directory scope accordingly.
-
Assess the trust level of the current task using the following criteria:
Trust Level Mode to Use Behaviour Low / Review only planProposes actions without executing Medium / Standard work acceptEditsApplies changes automatically Automated / Scheduled autoSafety classifier gates each action Maximum autonomy dontAskExecutes without interruption -
Apply the selected mode before issuing any task instruction.
- Evaluate the complexity of the task.
- For hard reasoning or refactoring tasks, set effort with:
/effort xhigh <task description>
- For routine or quick tasks, omit the effort flag or use fast mode to conserve plan limits.
- Connect required MCP servers for the task (e.g., Postgres, Jira, Sentry).
- If result payloads are large, configure the MCP server result size up to the 500K character limit per tool call.
- Place any custom commands, agents, or skill executables in
bin/so they auto-load to PATH via the plugin system. - Define hooks for any permission, notification, or tool-use events that require custom script interception before execution proceeds.
- For interactive terminal tasks, type the instruction directly into the session.
- For non-interactive pipeline execution, run:
Terminal window claude -p "<task instruction>" --output json - For parallelizable workstreams, allow or instruct Claude to spawn subagents. Confirm that subagent depth does not exceed five levels.
- For polling conditions, use:
/loop <condition and interval>
- For recurring cloud-hosted tasks, schedule with:
/schedule <task> every <cadence>
- Check the status of all running agents at any time with:
Terminal window claude agents - Review which sessions are running, which are blocked, and which have completed.
- Resolve any blocked actions by reviewing the safety classifier output and either adjusting the permission mode or manually approving the action.
- Run automated correctness and bug detection on changed code with:
/code-review
- For deeper analysis across a branch, run:
or trigger/schedule Run /ultrareview on main branch every Monday at 09:00 UTC
/ultrareviewmanually for immediate cloud-based bug-hunting. - Audit plan consumption broken down by skill, subagent, plugin, and MCP server with:
/usage
- For long sessions, disable terminal flicker by setting:
Terminal window export CLAUDE_CODE_NO_FLICKER=1 - Use
/cdto switch working directories mid-session rather than restarting the session. - Run
/powerupto review interactive lessons on any new features before using them in production.
-
CLAUDE.mdis present, up to date, and committed to version control - Permission mode is explicitly selected and appropriate for the task’s trust level
- Effort level is set correctly for the task complexity
- Required MCP servers are connected and authenticated
- Hook scripts are reviewed and tested before the session begins
- Custom executables are placed in
bin/and auto-loaded - Non-interactive pipeline runs use the
-pflag with structured output - Subagent depth is confirmed at five levels or fewer
-
claude agentshas been checked and no sessions are unexpectedly blocked -
/code-reviewor/ultrareviewhas been run on changed code before merging -
/usagehas been reviewed to ensure plan limits are not approaching exhaustion -
CLAUDE_CODE_NO_FLICKER=1is set for long or rendering-heavy sessions
| Situation | Action |
|---|---|
Safety classifier blocks an action in auto mode |
Review the blocked action in claude agents, determine if the block is correct, and either adjust the hook script or manually approve after Security Reviewer sign-off |
| Subagent depth reaches five levels | Stop spawning additional child subagents; restructure the task into sequential workstreams or elevate to the parent session |
| MCP server returns truncated results | Increase the result size configuration up to the 500K character limit; if still insufficient, split the query |
/schedule or /ultrareview fails to trigger |
Confirm cloud infrastructure access and authentication; escalate to the CI/CD Pipeline Owner if cloud connectivity is unavailable |
CLAUDE.md rules conflict with a task requirement |
Do not override CLAUDE.md at runtime; update the file, commit the change, and restart the session — escalate to Security Reviewer if the rule change affects security constraints |
Plan limits are near exhaustion (visible via /usage) |
Reduce subagent parallelism, switch to fast mode for low-complexity tasks, and notify the team before limits are hit |