guidance-for-claude-code-with-amazon-bedrock
CLAUDE.md405 starsChanged 5 months agoMIT-0View on GitHub
Project rules for AI coding agents. Detailed rules in .claude/rules/. Subdirectory CLAUDE.md files provide focused context per component: - source/CLAUDE.md — Python CLI, tests, config patterns - source/go/CLAUDE.md — Go binaries, --explain contract, Windows guards - deployment/CLAUDE.md — CloudFormation templates, IAM, conditions - deployment/infrastructure/lambda-functions/CLAUDE.md — Lambda auth, response patterns - docs/CLAUDE.md — Documentation naming, security, structure AWS guidance for Claude Code with Amazon Bedrock. Python CLI (ccwb) + Go credential-process binary + CloudFormation templates.
In this repository3 other files it gives its agents.
- deployment/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- source/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Regression coverage: Every bug fix includes a test that fails without the fix and passes with it.
- Distinctive: line 66
Must pass Linux, macOS, AND Windows (CI matrix)
- Distinctive: line 68
Every fix needs a regression test
- Distinctive: line 72
Update docs only when behavior changes — don't rewrite for style alone
- Very specific: line 73
Keep README concise (users skim, not read).
- Distinctive: line 75
Don't create docs PRs that duplicate information already in other docs files
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Project rules for AI coding agents. Detailed rules in .claude/rules/.
Subdirectory CLAUDE.md files provide focused context per component:
source/CLAUDE.md— Python CLI, tests, config patternssource/go/CLAUDE.md— Go binaries, --explain contract, Windows guardsdeployment/CLAUDE.md— CloudFormation templates, IAM, conditionsdeployment/infrastructure/lambda-functions/CLAUDE.md— Lambda auth, response patternsdocs/CLAUDE.md— Documentation naming, security, structure
Key Principles
- Auth path coverage: Features touching identity must work across OIDC, IDC, and "none" — or fail clearly.
- Collector mode awareness: Telemetry changes must work in both central (ECS/ALB) and sidecar (local) modes.
- Surface compatibility: Claude Code (CLI) and Claude Desktop (CoWork 3P) share credential-process, OTEL, and quota.
- Backwards compatibility: New fields must have defaults. Old configs must load. Existing deployments must not break on update.
- Regression coverage: Every bug fix includes a test that fails without the fix and passes with it.
- Cross-platform: Windows, macOS, and Linux are all first-class. CI blocks on Windows failures.
Repository
AWS guidance for Claude Code with Amazon Bedrock. Python CLI (ccwb) + Go credential-process binary + CloudFormation templates.
Auth Modes
| Mode | Identity | Quota | OTEL |
| OIDC | JWT email | Bearer | Full |
| IDC | IAM ARN | SigV4 | Via STS |
| none | Hashed principal | ❌ | Anonymous |
Branch Strategy
- Target:
beta(notmain). Rebase before PRs.mainis release-only.
Architecture
ccwb init → profile.json → ccwb deploy → CloudFormation
→ ccwb package → credential-process (Go) + otel-helperRuntime Flow (credential-process)
AWS SDK calls credential-process
→ read cache → [valid?] → return cached credentials
→ [expired?] → try silent refresh (refresh_token)
→ [no token?] → OIDC browser flow or IDC passthrough
→ check quota with id_token → [blocked?] → exit non-zero
→ STS AssumeRoleWithWebIdentity → credentials
→ emit OTEL attribution headers → cache → stdout JSONKey Files
source/credential_provider/__main__.py— Python credential providersource/go/cmd/credential-process/main.go— Go credential providersource/otel_helper/__main__.py— OTEL header generationsource/claude_code_with_bedrock/cli/commands/— CLI commandssource/claude_code_with_bedrock/config.py— Profile dataclasssource/go/internal/config/config.go— Go config structdeployment/infrastructure/— CloudFormation templates
Testing
cd source && poetry run pytest tests/ -qbefore pushing- Must pass Linux, macOS, AND Windows (CI matrix)
- Windows tests are blocking
- Every fix needs a regression test
Documentation
- Update docs only when behavior changes — don't rewrite for style alone
- Keep README concise (users skim, not read). Detail belongs in
assets/docs/ - Code changes that affect user-facing behavior should update docs in the same PR
- Don't create docs PRs that duplicate information already in other docs files
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

