How to Build with Claude Code – Everything you can configure that the docs don't tell you
Claude Code's docs cover basics, but the real power is in hidden configs. Learn how to customize prompts, manage costs, and integrate with your workflow.
Claude Code is Anthropic's terminal-based AI coding agent. The official docs cover setup and basic commands. But after reading the source code and running it in production for months, I found several configuration options that are not documented. Here is everything you can configure that the docs don't tell you.
1. Custom System Prompts in .claude/settings.json
The docs mention ~/.claude/settings.json for global settings. But you can also place a .claude/settings.json in your project root. This file supports a customPrompts key that lets you inject system-level instructions.
Example:
{
"customPrompts": {
"system": "You are an expert in Go and Kubernetes. Always prefer standard library over third-party packages. Never use `fmt.Println` for logging; use `log/slog`."
}
}
This prompt is appended to the base system prompt. It works for all conversations in that project. I use this to enforce coding standards across my team.
2. Model Selection via --model Flag
The docs say Claude Code uses Claude 3.5 Sonnet by default. But you can switch to Claude 3 Opus or Claude 3 Haiku using the --model flag:
claude --model claude-3-opus-20240229
Opus is better for complex reasoning but costs 3x more. Haiku is cheaper and faster for simple tasks like refactoring. I use Haiku for linting and Opus for architecture decisions.
// stay current
AI & ML insights, weekly
Practical deep-dives on LLMs, developer tools, and AI engineering. No filler. Unsubscribe any time.
// written byFIG. AUTH-01
522
Mahmudul Haque Qudrati
CEO & ML Engineer
CEO and ML Engineer at Pristren. Builds AI-powered software for teams and writes about machine learning, LLMs, developer tools, and practical AI applications.
Claude Code has a maxTokens setting in settings.json that limits total output tokens per response. Default is 4096. You can lower it to 1024 for quick edits to reduce cost.
There is also maxThinkingTokens (default 2048) for the extended thinking mode. Reducing this speeds up responses but may reduce quality on complex tasks.
{
"maxTokens": 2048,
"maxThinkingTokens": 1024
}
4. Disable Automatic Git Commits
By default, Claude Code creates a git commit after each change. You can disable this with --no-auto-commit or set "autoCommit": false in settings. I disable it when experimenting because the commit history gets noisy.
5. Custom Tool Permissions
Claude Code can execute shell commands, read/write files, and use the browser. You can restrict these per project using allowedTools in .claude/settings.json:
Remove "Bash" to prevent arbitrary command execution. Remove "Browser" if you don't need web access. This is useful for security-sensitive projects.
6. Environment Variables for API Keys
The docs tell you to set ANTHROPIC_API_KEY. But Claude Code also respects ANTHROPIC_BASE_URL for custom endpoints (e.g., self-hosted proxies). I use this to route traffic through a logging proxy for debugging.
Claude Code has a --verbose flag that prints raw API requests and responses. This is invaluable for debugging why the agent made a certain decision. Combine with --log to save logs to a file:
claude --verbose --log /tmp/claude.log
8. Session Persistence and Resuming
Claude Code saves sessions in ~/.claude/sessions/. You can resume a previous session with --resume <session-id>. This is useful if the agent crashes or you want to continue a long task.
9. Disable Confirmation Prompts
By default, Claude Code asks for confirmation before executing commands. You can skip this with --yes or set "autoConfirm": true in settings. Use with caution - I only enable this in CI pipelines.
10. Custom Output Format
Claude Code outputs markdown by default. You can change to JSON with --output json. This is useful for programmatic consumption:
claude "Refactor this function" --output json | jq '.response'
Tradeoffs and Honest Advice
Custom prompts are powerful but can make the agent overly rigid. Test with a small set of instructions first.
Model switching costs add up. Opus can be 10x more expensive than Haiku for the same task. Monitor usage with claude stats.
Disabling auto-commit saves git history clutter but you lose the safety net. Use branches instead.
Verbose mode generates a lot of output. Pipe to a file and grep for specific events.
Real-World Example: CI Pipeline Integration
I use Claude Code in a GitHub Action to auto-fix lint errors. Here's the config:
- name: Fix lint issues
run: |
claude --yes --no-auto-commit --model claude-3-haiku-20240307 \
"Fix all ESLint errors in src/"
This runs Haiku (fast and cheap), skips confirmations, and doesn't commit. The action then creates a PR with the changes.
Claude Code is more configurable than the docs suggest. Custom prompts, model selection, cost controls, and tool permissions let you tailor it to your workflow. Start with the defaults, then gradually add these settings as you understand the tradeoffs.
If you want a managed AI coding agent that handles configuration and cost optimization out of the box, try Zlyqor.
Frequently Asked Questions
What is Claude Code - Everything you can configure that the docs don't tell you?
Claude Code is Anthropic's terminal-based AI coding agent. This article covers undocumented configuration options like custom prompts, model selection, cost controls, and tool permissions that are not in the official documentation.
How does Claude Code - Everything you can configure that the docs don't tell you work?
Claude Code reads settings from `~/.claude/settings.json` and project-level `.claude/settings.json`. You can customize system prompts, choose models (Opus, Sonnet, Haiku), limit token usage, disable auto-commit, restrict tools, and set environment variables for custom API endpoints.
What are the best practices for Claude Code - Everything you can configure that the docs don't tell you?
Start with default settings. Add custom prompts gradually. Use Haiku for simple tasks and Opus for complex reasoning. Disable auto-commit in experiments. Enable verbose logging for debugging. Always test new configurations on a branch.
How much does Claude Code - Everything you can configure that the docs don't tell you cost?
Claude Code uses Anthropic's API pricing. Claude 3 Haiku costs $0.25 per million input tokens and $1.25 per million output tokens. Claude 3 Sonnet costs $3/$15. Claude 3 Opus costs $15/$75. Using `maxTokens` and `maxThinkingTokens` can reduce costs.
Is Claude Code - Everything you can configure that the docs don't tell you worth it in 2026?
Yes, if you need a terminal-based AI coding agent with deep customization. The undocumented features make it more powerful than alternatives like GitHub Copilot CLI. However, it requires careful cost management and configuration tuning.
How do I disable auto-commit in Claude Code?
Use the `--no-auto-commit` flag when running Claude Code, or set `"autoCommit": false` in your `.claude/settings.json` file.
Can I use Claude Code with a custom API endpoint?
Yes, set the `ANTHROPIC_BASE_URL` environment variable to your custom endpoint. This is useful for proxying or logging API requests.