PulseAugur
EN
LIVE 05:25:13

Claude CLI loads project context unexpectedly, breaking auth when bypassed

A developer discovered that the `claude -p` command-line tool, when invoked without specific flags, automatically loads and processes a project's CLAUDE.md file. This occurs even when the prompt is self-contained and unrelated to the project's general instructions, leading to unexpected context loading and potential behavioral changes. The developer found that using the `--bare` flag, intended to disable such auto-discovery, unfortunately breaks the script's authentication method, which relies on an OAuth session rather than a direct API key. AI

IMPACT Unexpected context loading in LLM CLIs can lead to silent behavioral shifts and complicate prompt engineering.

RANK_REASON The item describes a specific behavior of a command-line tool and a potential workaround, which falls under tool-specific functionality rather than a broader industry release or research.

Read on dev.to — Claude Code tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

Claude CLI loads project context unexpectedly, breaking auth when bypassed

COVERAGE [1]

  1. dev.to — Claude Code tag TIER_1 English(EN) · Enjoy Kumawat ·

    I Ran `claude -p` for One Commit Message. My Whole CLAUDE.md Came Along Uninvited.

    <p>I have a 20-line script called <code>git_commit.py</code> that reads <code>git diff --staged</code> and shells out to <code>claude -p</code> to turn it into a Conventional Commit message. It's about as narrow a task as an LLM call gets: one diff in, one line out. No file explo…