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

guidance-for-claude-code-with-amazon-bedrock / source

CLAUDE.md405 starsChanged 5 months agoMIT-0View on GitHub

  • Deletes or force-pushes

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
  1. Very specific:

    Add new fields to claude_code_with_bedrock/config.py dataclass with a default value (backwards compat).

    line 16
  2. Very specific:

    Add to --explain output if user-visible — update tests/test_explain_contract.py.

    line 18
  3. Very specific:

    All commands live in claude_code_with_bedrock/cli/commands/.

    line 21
  4. Very specific:

    Test the matrix. See .claude/rules/auth-type-compat.md.

    line 29
  5. Very specific:

    Use dataclasses.replace() to derive test profiles from PROFILE_MODES.

    line 34
  6. Very specific:

    Don't use rm -rf in tests — use tmp_path fixtures.

    line 43
  7. Very specific:

    Don't hardcode / as path separator — use pathlib.Path.

    line 44
  8. Very specific:

    Don't call questionary.select() without _is_interactive() guard.

    line 45
  9. Distinctive:

    Don't add optional imports without try/except and feature-gate.

    line 46

≈ “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 — 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 tests

Key Rules

Config Changes

  • Add new fields to claude_code_with_bedrock/config.py dataclass with a default value (backwards compat).
  • Mirror the field in go/internal/config/config.go — see .claude/rules/config-sync.md.
  • Add to --explain output if user-visible — update tests/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-interactive must 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 from PROFILE_MODES.
  • Windows tests are blocking — test pathlib.Path and os.sep handling.

Package ↔ Distribute Contract

  • Binary names in package.py must exist in distribute.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 -rf in tests — use tmp_path fixtures.
  • Don't hardcode / as path separator — use pathlib.Path.
  • Don't call questionary.select() without _is_interactive() guard.
  • Don't add optional imports without try/except and feature-gate.

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.