$ recombobulate _
home / tips / speed-up-ci-scripts-with-bare-mode
speed-up-ci-scripts-with-bare-mode

Every time Claude Code starts a regular session, it scans for CLAUDE.md files, loads skills, discovers plugins, connects to MCP servers, and applies hooks. For scripted tasks in CI, all of that startup work is unnecessary overhead. The --bare flag skips it entirely.

# Fast, minimal invocation for a CI check
claude --bare -p "Review this diff for obvious bugs" < diff.txt

# Works great in lightweight automation
echo "Summarise recent commits" | claude --bare -p

In bare mode, Claude only has access to Bash, file read, and file edit tools. There are no MCP servers, no hooks, no CLAUDE.md context, and no auto-memory. It also sets the CLAUDE_CODE_SIMPLE environment variable so scripts can detect that they are running in bare mode.

This is ideal for:

  • GitHub Actions steps where startup latency matters
  • Cron jobs running simple, well-defined tasks
  • Testing prompts in isolation without any project context bleeding in

Because bare mode ignores your CLAUDE.md and configured rules, make sure your prompt is self-contained and includes everything Claude needs to complete the task. There is no fallback context from previous sessions or project files.

Combine with --max-turns and --output-format json for a fully controlled, fast CI step:

claude --bare -p --max-turns 3 --output-format json "Check this function for null pointer issues"

When you need Claude Code fast and without side effects, --bare is the flag to reach for.


via Claude Code CLI Reference

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Filter Test Output with a PreToolUse Hook to Cut Token Costs

A PreToolUse hook can intercept test runner commands and filter output to show only failures, cutting thousands of tokens from Claude's context.

bagwaa @bagwaa · 3 hours ago
0
Move Specialised CLAUDE.md Instructions into Skills to Shrink Context

CLAUDE.md loads into every message. Move workflow-specific instructions into skills that load on demand to reduce token costs across your session.

bagwaa @bagwaa · 3 hours ago
0
Use prompt.id to Trace All Activity from a Single User Prompt

Every event emitted while processing a single prompt shares a prompt.id UUID, letting you trace the complete chain of API calls and tool executions.

bagwaa @bagwaa · 3 hours ago