{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "onmyway133-claude-code-tips-tricks--run-claude-in-scripts-with-bare",
 "repo": "onmyway133/claude-code-tips-tricks",
 "repo_url": "https://github.com/onmyway133/claude-code-tips-tricks",
 "repo_slug": "onmyway133-claude-code-tips-tricks",
 "title": "Speed up Claude Code calls in scripts with --bare",
 "page_title": "How to speed up Claude Code calls in scripts with --bare with Claude Code Tips Tricks",
 "summary": "Pass the --bare flag with explicit config so scripted runs skip local file discovery.",
 "who": "A developer or CI maintainer calling Claude Code from a script where the inputs are already known.",
 "problem": "Claude Code searches the filesystem for CLAUDE.md, settings, and MCP configs before every run, which slows down scripted use.",
 "outcome": "Scripted runs start faster because they load only the config you pass in explicitly.",
 "steps": [
  "Decide which system prompt, MCP config, and settings the script needs.",
  "Pass them explicitly with --system-prompt, --mcp-config, and --settings.",
  "Run `claude -p \"summarize this codebase\" --output-format=stream-json --verbose --bare` from your script. (inferred, check the README)",
  "Check that the output stream arrives and that the run starts faster than before."
 ],
 "agent_prompt": "In the repo at <repo-path>, run claude -p with --bare and explicit --system-prompt, --mcp-config, and --settings values to summarize <target-directory>. Expected output: a stream-json summary of the codebase. Verify that the command exits successfully and that no CLAUDE.md file was loaded by discovery.",
 "agents": [
  "claude-code"
 ],
 "difficulty": "Advanced",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The README says the local file search default may change in a future version, so re-check the --bare behavior after updates.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "",
 "requirements": [
  "Claude Code installed and running in a terminal",
  "A project folder or git repository to work in",
  "Access to a Claude account that Claude Code can use"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/onmyway133-claude-code-tips-tricks/run-claude-in-scripts-with-bare/",
 "md": "https://dedupedai.com/use-cases/onmyway133-claude-code-tips-tricks/run-claude-in-scripts-with-bare/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/onmyway133-claude-code-tips-tricks--run-claude-in-scripts-with-bare.json",
 "api_version": "v1"
}
