Customizing Sweep
Sweep provides three ways to customize and extend the AI's behavior: Rules files (SWEEP.md), Custom Prompts, and Skills. These features allow you to tailor Sweep to your specific workflow, codebase, and team preferences.
Rules files (SWEEP.md)
Project-level configuration files that provide persistent context and rules to Sweep for every conversation in your project.
They can contain:
- Frequently used commands (build, test, lint)
- Code style preferences and conventions
- Codebase architecture and structure
- Domain-specific context and requirements
- Custom rules and guidelines
Creating a Rules File
Create a SWEEP.md file in your project root:
# Project Rules
## Build Commands
- Build: `./gradlew build`
- Test: `./gradlew test`
- Format: `ktlint --format "src/**/*.kt"`
## Testing
- Write tests for all new features
- Use descriptive test names
- Mock external dependenciesUse Cases
Store frequently used commands — Build, test, lint commands so Sweep can run them without searching:
## Commands
- Run tests: `npm test`
- Build production: `npm run build:prod`
- Start dev server: `npm run dev`Define code style preferences — Naming conventions, preferred libraries, formatting rules:
## Code Style
- Use TypeScript strict mode
- Prefer functional components over class components
- Use named exports instead of default exports
- Maximum line length: 100 charactersDocument codebase structure — Important architectural decisions and organization:
## Architecture
- `/src/components` - Reusable UI components
- `/src/services` - Business logic and API calls
- `/src/utils` - Helper functions
- State management uses Redux ToolkitProvide domain-specific context — Business logic, requirements, constraints:
## Business Rules
- User sessions expire after 30 minutes
- All monetary values must use Decimal type
- Audit logs required for all data modificationsGenerating SWEEP.md
You can ask Sweep to generate a SWEEP.md file from existing configuration files:
- Open Sweep settings
- Go to the Rules tab
- Click Generate SWEEP.md
- Sweep will create a comprehensive SWEEP.md from existing files like CLAUDE.md, .cursorrules, etc.
Selecting Which File to Use
In Sweep settings under the Rules tab, you can:
- View which rules file is currently active
- Switch between SWEEP.md, CLAUDE.md, and AGENTS.md
- See the content of the selected file
Sweep automatically detects CLAUDE.md and AGENTS.md and uses those if SWEEP.md doesn't exist.
Custom Prompts
Custom Prompts are reusable prompt templates that you can trigger with a single click. They're useful for repetitive tasks like code reviews, documentation, or explanations.
Key Features
- Quick Access: Available via right-click context menu in the editor
- Persistent: Saved at the application level and available across all projects
- Customizable: Full control over prompt text and behavior
Default Custom Prompts
Sweep comes with three built-in custom prompts:
- AI Code Review — "Review each of the changes in detail for potential bugs"
- Explain Code — "Explain what the code does."
- Write Documentation — "Please write documentation for the highlighted code."
Creating Custom Prompts
- Open Sweep settings
- Go to the Custom Prompts tab
- Click Add to create a new prompt
- Configure:
- Action Name: The name shown in the context menu
- Prompt Text: The text sent to Sweep when triggered
- Include selected code: Whether to automatically add editor selection to chat
- Click Save Changes
Using Custom Prompts
Via Context Menu:
- Select code in the editor (if applicable)
- Right-click to open the context menu
- Choose your custom prompt from the menu
- Sweep will automatically add the selected code (if enabled) and prefill the prompt
Example Custom Prompts
| Action Name | Prompt Text | Include Code |
|---|---|---|
| Security Review | Review this code for security vulnerabilities including SQL injection, XSS, CSRF, and authentication issues. Provide specific recommendations. | ✓ |
| Performance Check | Analyze this code for performance issues. Look for inefficient algorithms, unnecessary computations, and potential bottlenecks. | ✓ |
| Generate Tests | Generate comprehensive unit tests for this code. Include edge cases and error scenarios. | ✓ |
| Suggest Refactoring | Suggest refactoring improvements for this code. Focus on readability, maintainability, and following best practices. | ✓ |
Skills
Skills are markdown files with YAML frontmatter that contain detailed instructions for specific tasks. When you invoke a skill, Sweep loads its content and follows the instructions to complete the task. We follow Claude's skills format
Skill Locations
Skills can be stored in two locations:
- Personal Skills:
~/.claude/skills/— Available across all your projects - Project Skills:
<project>/.claude/skills/— Specific to the current project
Skill File Structure
Each skill must be in its own directory with a SKILL.md file (case-insensitive):
.claude/skills/
├── my-skill-name/
│ └── SKILL.md
└── another-skill/
└── SKILL.mdCreating a Skill
Skills use YAML frontmatter followed by markdown content:
---
name: example-skill
description: Brief description of what this skill does
---
# Skill Title
Detailed instructions for the AI to follow...
## Instructions
1. First step...
2. Second step...
3. Final step...Required fields:
name: The skill identifier (used to invoke the skill)description: A brief description shown in the skills list
Example Skill
Create PR Skill:
---
name: create-pr
description: Steps to take when creating a pull request for this repository
---
# Create Pull Request
This skill helps you create a pull request for this repository.
## Instructions
1. First run the command `ktlint --format "src/**/*.kt"` to format the Kotlin code
2. Commit all code changes that may currently be uncommitted
3. Using git, get an understanding of all changes made on the current branch
4. Create a clear and concise commit message — focusing on why rather than what
5. Create a pull request with an appropriate title and descriptionUsing Skills
Skills are automatically discovered and made available to Sweep. You can invoke them by asking Sweep to use a specific skill:
"Use the code-review skill to review my changes"
"Run the create-pr skill"Sweep will load the skill's instructions and follow them to complete the task.