Claude Code Integration
Rafter provides two skills for Claude Code that separate remote code analysis from local security operations.Why Two Skills?
Remote Code Analysis (rafter)
Auto-invocable - Claude can proactively suggest scans
- API-based SAST/SCA scanning
- Read-only operations
- Safe for Claude to auto-invoke
rafter run/rafter scan/rafter get/rafter usage
Local Security Toolkit (rafter-agent-security)
User-only - Requires explicit invocation
- Local secret scanning
- Policy enforcement
- Extension auditing
- Side effects require permission
Setup
1. Install Rafter CLI
Install globally:2. Initialize Local Security
Run initialization with Claude Code integration:~/.claude/ directory), Rafter will:
- Install Remote Code Analysis skill to
~/.claude/skills/rafter/SKILL.md - Install Local Security skill to
~/.claude/skills/rafter-agent-security/SKILL.md - Enable agent integration in config
3. Restart Claude Code
Restart your Claude Code session to load the skills:Remote Code Analysis: Automated Scanning
The remote analysis skill allows Claude to proactively suggest security scans.Commands
Trigger a comprehensive security scan on your repositoryAuto-detects: Current repo and branch from gitExample:
Retrieve results from a completed or in-progress scanExample:
View your API quota and usage statisticsExample:
When Claude Uses It
Claude will automatically invoke backend scanning when you:- Mention “security”, “vulnerabilities”, or “code analysis”
- Start working on a new feature
- Review a pull request
- Update dependencies
- Ask about security issues
Example Interactions
Proactive Scan Suggestion
Proactive Scan Suggestion
You: “I just updated all the npm packages”Claude: “Let me run a security scan to check for any new vulnerabilities in the updated dependencies.”[Invokes: rafter run]Claude: “Scan complete! Found 2 medium-severity issues in newly updated packages. Here’s what needs attention…”
Pre-PR Security Check
Pre-PR Security Check
You: “Can you review my changes before I create a PR?”Claude: “I’ll run a security scan on your feature branch first.”[Invokes: rafter run —branch feature-auth]Claude: “Security scan passed with no issues. Your changes look good from a security perspective. Ready to create the PR?”
Quota Check
Quota Check
You: “How many scans do I have left this month?”Claude: [Invokes: rafter usage]Claude: “You’ve used 45 of 100 scans this month. 55 remaining. Your quota resets on March 1st.”
Local Security Skill
The local security skill provides secret scanning, policy enforcement, and extension auditing. You must explicitly invoke these commands.Commands
Scan files for secrets before commitsExample:Detects: AWS keys, GitHub tokens, Stripe keys, database credentials, private keys (21+ patterns)
Execute commands with security validationExample:Features:
- Blocks destructive commands (rm -rf /, fork bombs)
- Requires approval for dangerous operations
- Scans staged files before git commits
- Logs all command attempts
Comprehensive security audit of a Claude Code skill before installationExample:Analyzes: 12 security dimensions including network calls, command execution, file access, credential handling, input validation, and more
View security event logsExample:Events: Command attempts, secret detections, policy overrides, config changes
Usage Examples
Pre-Commit Secret Scan
Pre-Commit Secret Scan
You:
/rafter-scan .Output:Safe Command Execution
Safe Command Execution
You:
/rafter-bash "git commit -m 'Add authentication'"Process:- Rafter evaluates command risk level
- Scans staged files for secrets (for git commands)
- If clean: executes commit
- If secrets found or command blocked: alerts user
Skill Security Audit
Skill Security Audit
You:
/rafter-audit-skill ~/.claude/skills/github-integration/SKILL.mdOutput:Configuration
Risk Levels
Choose based on your security requirements:Minimal (Development)
Minimal (Development)
Best for: Local development, prototyping
- Allows most commands
- Basic secret detection
- Minimal workflow interruption
Moderate (Recommended)
Moderate (Recommended)
Best for: General use, team environments
- Blocks critical commands
- Requires approval for high-risk operations
- Secret scanning on all git operations
- Default setting
Aggressive (Production)
Aggressive (Production)
Best for: Sensitive environments, compliance requirements
- Maximum security checks
- Requires approval for most operations
- Comprehensive audit logging
View Current Config
Workflows
Secure Development Cycle
Start Feature
You: “Add user authentication”Claude: Writes code, then suggests: “Should I run a security scan?”[Invokes: rafter run]
Installing Untrusted Skills
Before installing skills from unknown sources:Audit Security
You:
/rafter-audit-skill /path/to/skill.mdReview comprehensive 12-dimension security analysisMonitoring
View Agent Activity
Audit Reports
Generate compliance reports:Troubleshooting
Skills Not Loading
Skills Not Loading
If Claude doesn’t recognize Rafter skills:
-
Verify skill files exist:
-
Reinstall skills:
- Restart Claude Code session
Backend Skill Not Auto-Invoked
Backend Skill Not Auto-Invoked
If Claude isn’t suggesting scans automatically:
- Check skill is loaded: Look for system reminders showing “rafter” skill
-
Verify RAFTER_API_KEY is set:
- Try explicit request: “Can you run a Rafter security scan?”
API Key Issues
API Key Issues
If backend scans fail:
-
Set API key:
-
Or use .env file:
- Get key from: rafter.so/dashboard
Commands Bypassing Validation
Commands Bypassing Validation
If
/rafter-bash isn’t validating:-
Check config:
-
Enable if disabled:
Best Practices
Recommended Workflow
- Let Claude auto-scan: Don’t disable the backend skill - proactive scans catch issues early
- Scan before commits: Always run
/rafter-scanbefore committing - Audit untrusted skills: Use
/rafter-audit-skillfor skills from unknown sources - Review audit logs: Check
/rafter-auditafter suspicious activity - Start with moderate: Adjust risk level based on your needs
- Keep CLI updated:
npm update -g @rafter-security/cli
Advanced Usage
Pre-Commit Hooks
Automate secret scanning for all commits:/rafter-scan --staged before every commit.
Custom Blocked Patterns
Add organization-specific command patterns: Edit~/.rafter/config.json:
Skill Auditing Framework
The/rafter-audit-skill command analyzes 12 security dimensions:
- Trust & Attribution - Source verification
- Network Security - External API calls
- Command Execution - Shell commands
- File System Access - Read/write operations
- Credential Handling - API keys, secrets
- Input Validation - Injection risks
- Data Exfiltration - Data leaving system
- Obfuscation - Hidden behavior
- Scope Alignment - Behavior vs purpose
- Error Handling - Info leakage
- Dependencies - Supply chain risks
- Environment Manipulation - System modifications
Comparison: OpenClaw vs Claude Code
Skill Architecture
Skill Architecture
OpenClaw: Single skill with all featuresClaude Code: Two skills (remote analysis + local security)Why different? Claude Code’s auto-invocation capability allows separating safe API calls from local operations
Invocation Model
Invocation Model
OpenClaw: User or agent invokes all commandsClaude Code:
- Backend skill: Auto-invoked by Claude
- Local security: User invokes via slash commands
Command Prefix
Command Prefix
OpenClaw:
/rafter-scan, /rafter-bash, etc.Claude Code:- Backend:
rafter run,rafter get,rafter usage(auto) - Agent:
/rafter-scan,/rafter-bash, etc. (manual)
Support
Documentation
Complete guides and API reference
GitHub Issues
Report bugs and request features
Dashboard
Manage API keys and view scan history
Claude Code Docs
Learn more about Claude Code
Next Steps
Command Reference
Complete CLI command documentation
Secret Scanning
Deep dive into secret detection
CI/CD Integration
Use Rafter in continuous integration
API Reference
Backend API documentation

