agentleFS
aws-solutions-library-samplesaws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/CLAUDE.md

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.

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
  1. Distinctive:

    Regression coverage: Every bug fix includes a test that fails without the fix and passes with it.

    line 17
  2. Distinctive:

    Must pass Linux, macOS, AND Windows (CI matrix)

    line 66
  3. Distinctive:

    Every fix needs a regression test

    line 68
  4. Distinctive:

    Update docs only when behavior changes — don't rewrite for style alone

    line 72
  5. Very specific:

    Keep README concise (users skim, not read).

    line 73
  6. Distinctive:

    Don't create docs PRs that duplicate information already in other docs files

    line 75

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 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

Key Principles

  1. Auth path coverage: Features touching identity must work across OIDC, IDC, and "none" — or fail clearly.
  2. Collector mode awareness: Telemetry changes must work in both central (ECS/ALB) and sidecar (local) modes.
  3. Surface compatibility: Claude Code (CLI) and Claude Desktop (CoWork 3P) share credential-process, OTEL, and quota.
  4. Backwards compatibility: New fields must have defaults. Old configs must load. Existing deployments must not break on update.
  5. Regression coverage: Every bug fix includes a test that fails without the fix and passes with it.
  6. 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

ModeIdentityQuotaOTEL
OIDCJWT emailBearerFull
IDCIAM ARNSigV4Via STS
noneHashed principal❌Anonymous

Branch Strategy

  • Target: beta (not main). Rebase before PRs. main is release-only.

Architecture

ccwb init → profile.json → ccwb deploy → CloudFormation
                         → ccwb package → credential-process (Go) + otel-helper

Runtime 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 JSON

Key Files

  • source/credential_provider/__main__.py — Python credential provider
  • source/go/cmd/credential-process/main.go — Go credential provider
  • source/otel_helper/__main__.py — OTEL header generation
  • source/claude_code_with_bedrock/cli/commands/ — CLI commands
  • source/claude_code_with_bedrock/config.py — Profile dataclass
  • source/go/internal/config/config.go — Go config struct
  • deployment/infrastructure/ — CloudFormation templates

Testing

  • cd source && poetry run pytest tests/ -q before 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.