

# Rules files
<a name="rules-files"></a>

Most AI coding agents support project-level configuration files — often called rules files — that provide persistent instructions the agent follows in every session. For example, you might have a rules file that tells your agent to always write TypeScript in strict mode, or to use a specific testing framework.

The Agent Toolkit for AWS includes a recommended rules file that tells your agent how to work with AWS — for example, to use the AWS MCP Server for API calls, to search for available skills before starting a task, and to prefer infrastructure-as-code over direct CLI commands.

**Topics**
+ [Recommended AWS rules file](#recommended-rules-file)
+ [Where to put the rules file](#rules-file-location)
+ [Customization](#rules-customization)

## Recommended AWS rules file
<a name="recommended-rules-file"></a>

The Agent Toolkit for AWS includes a recommended rules file that covers using the AWS MCP Server, discovering skills, verifying against documentation, and following infrastructure-as-code best practices. You can find the latest version of this file in the [Agent Toolkit for AWS repository on GitHub](https://github.com/aws/agent-toolkit-for-aws/blob/main/rules/aws-agent-rules.md). Copy the content into the appropriate file for your agent.

## Where to put the rules file
<a name="rules-file-location"></a>

The file name and location depend on your agent:


**Rules file locations by agent**  

| Agent | Project rules | Location | 
| --- | --- | --- | 
| Claude Code | CLAUDE.md | Project root | 
| Codex | AGENTS.md | Project root | 
| Cursor | .cursor/rules/\*.mdc | .cursor/rules/ directory | 
| Kiro | .kiro/steering/\*.md | .kiro/steering/ directory | 

For Claude Code and Codex, add the content above to your existing `CLAUDE.md` or `AGENTS.md` file, or create a new one in your project root. For Cursor, create a new `.mdc` file in the `.cursor/rules/` directory (for example, `.cursor/rules/aws.mdc`). The legacy `.cursorrules` file is still supported but deprecated.

## Customization
<a name="rules-customization"></a>

The recommended rules file is a starting point. Customize it for your project — for example, specifying which AWS Region to use, which VPC to deploy into, or which naming conventions to follow for resources.