guidance-for-claude-code-with-amazon-bedrock / source
CLAUDE.md405 starsChanged 5 months agoMIT-0View on GitHub
- Deletes or force-pushes
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- deployment/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 16
Add new fields to claude_code_with_bedrock/config.py dataclass with a default value (backwards compat).
- Very specific: line 18
Add to --explain output if user-visible — update tests/test_explain_contract.py.
- Very specific: line 21
All commands live in claude_code_with_bedrock/cli/commands/.
- Very specific: line 29
Test the matrix. See .claude/rules/auth-type-compat.md.
- Very specific: line 34
Use dataclasses.replace() to derive test profiles from PROFILE_MODES.
- Very specific: line 43
Don't use rm -rf in tests — use tmp_path fixtures.
- Very specific: line 44
Don't hardcode / as path separator — use pathlib.Path.
- Very specific: line 45
Don't call questionary.select() without _is_interactive() guard.
- Distinctive: line 46
Don't add optional imports without try/except and feature-gate.
≈ “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 — Python CLI (ccwb) + Tests
Quick Commands
cd source
ruff check . # Lint (must pass before push)
ruff format . # Format (must pass before push)
poetry run pytest tests/ -q # Run all tests
poetry run pytest tests/cli/ -q # Run only CLI testsKey Rules
Config Changes
- Add new fields to
claude_code_with_bedrock/config.pydataclass with a default value (backwards compat). - Mirror the field in
go/internal/config/config.go— see.claude/rules/config-sync.md. - Add to
--explainoutput if user-visible — updatetests/test_explain_contract.py.
CLI Commands
- All commands live in
claude_code_with_bedrock/cli/commands/. - Register new commands in
__init__.py. - Interactive prompts: always guard with
sys.stdin.isatty()check — CI and--non-interactivemust work. - New commands need tests in
tests/cli/commands/test_<name>.py.
Auth Coverage
- Any code touching identity/credentials must handle all three auth modes:
- OIDC (JWT Bearer), IDC (IAM/SigV4), none (anonymous/hashed principal)
- Test the matrix. See
.claude/rules/auth-type-compat.md.
Testing Patterns
- Tests mirror source structure:
tests/cli/commands/,tests/, etc. - Regression tests required for bug fixes (fail without fix, pass with it).
- Use
dataclasses.replace()to derive test profiles fromPROFILE_MODES. - Windows tests are blocking — test
pathlib.Pathandos.sephandling.
Package ↔ Distribute Contract
- Binary names in
package.pymust exist indistribute.py's allowlist. - Platform normalization: generic tokens (
linux) → qualified (linux-x64) early. - See
.claude/rules/distribution-manifest-parity.md.
Common Pitfalls
- Don't use
rm -rfin tests — usetmp_pathfixtures. - Don't hardcode
/as path separator — usepathlib.Path. - Don't call
questionary.select()without_is_interactive()guard. - Don't add optional imports without try/except and feature-gate.
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.

