Ask questions. Generate plans. Build features. Review every change. Stay in control.
SantaClaw is an approval-first AI coding assistant built for developers who want the power of autonomous agents without surrendering control of their codebase.
Unlike many AI coding tools that directly modify files, SantaClaw stages every proposed change and lets you review, approve, or reject modifications before they are applied.
Built with Bun, TypeScript, AI SDK, and a modular tool architecture.
docker pull sahilsingh94/santaclaw:latestdocker run -it \
-e OPENROUTER_API_KEY=your_key \
-e TELEGRAM_BOT_TOKEN=your_token \
-e FIRECRAWL_API_KEY=your_key \
sahilsingh94/santaclaw:latestCreate a .env file:
OPENROUTER_API_KEY=your_key
TELEGRAM_BOT_TOKEN=your_token
FIRECRAWL_API_KEY=your_keyRun:
docker run -it --env-file .env sahilsingh94/santaclaw:latestservices:
santaclaw:
image: sahilsingh94/santaclaw:latest
env_file:
- .env
restart: unless-stoppedStart:
docker compose up -dgit clone https://github.com/<your-username>/SANTACLAW.git
cd SANTACLAW
docker build -t santaclaw .Run:
docker run -it --env-file .env santaclaw| Variable | Required | Description |
|---|---|---|
| OPENROUTER_API_KEY | Yes | LLM access |
| TELEGRAM_BOT_TOKEN | Optional | Telegram mode |
| FIRECRAWL_API_KEY | Optional | Web search and crawling |
View logs:
docker logs <container-id>List running containers:
docker psVerify environment variables:
docker exec -it <container-id> envA fully autonomous coding agent capable of:
- Understanding repository structure
- Exploring project architecture
- Searching and analyzing codebases
- Creating new files
- Modifying existing files
- Refactoring code
- Removing obsolete code
- Generating implementation plans
- Executing multi-step development workflows
Every modification is staged before application.
Ask questions about:
- Your codebase
- Programming concepts
- System design
- Architecture decisions
- Performance bottlenecks
- Debugging issues
- Framework-specific problems
- Best practices
SantaClaw analyzes project context before answering.
Generate implementation plans before writing code.
Ideal for:
- New features
- Refactors
- Database migrations
- API design
- Microservice architecture
- Project roadmaps
- Learning unfamiliar codebases
Use SantaClaw remotely through Telegram.
Access:
- Ask Mode
- Planning
- Codebase discussions
- Development workflows
from anywhere.
SantaClaw never silently changes your code.
Every action follows:
Analyze
β
Understand
β
Plan
β
Generate Changes
β
Stage Diff
β
Review
β
Approve / Reject
β
Apply
You remain in control at every step.
SantaClaw builds contextual understanding before acting.
Capabilities include:
- Repository exploration
- Dependency discovery
- Architecture analysis
- File relationship mapping
- Context gathering
- Multi-file reasoning
- Feature tracing
The goal is to understand before modifying.
| Tool | Description |
|---|---|
read_file |
Read a file |
read_multiple_files |
Read multiple files simultaneously |
list_files |
Explore directories |
search_files |
Search codebases |
analyze_codebase |
Build repository understanding |
create_file |
Create new files |
modify_file |
Stage file modifications |
delete_file |
Stage file removals |
create_folder |
Create folders |
execute_shell |
Optional shell execution |
The tool system is modular and extensible.
Most AI coding assistants optimize for automation.
SantaClaw optimizes for trust.
| Capability | SantaClaw | Typical Agent |
|---|---|---|
| Repository Understanding | β | β |
| Autonomous Execution | β | β |
| Visible Planning | β | |
| Staged Changes | β | β |
| Human Approval Gate | β | β |
| Terminal Native | β | |
| Tool Transparency | β | |
| Self-Hosted Friendly | β |
SantaClaw treats developers as decision makers, not passengers.
SantaClaw follows a structured reasoning pipeline.
flowchart TD
A[User Prompt]
--> B[Intent Analysis]
B --> C[Repository Analysis]
C --> D[Context Collection]
D --> E[Planning Engine]
E --> F[Tool Execution]
F --> G[Diff Generation]
G --> H[Approval Gate]
H -->|Approve| I[Apply Changes]
H -->|Reject| J[Discard Changes]
Every step is explicit and observable.
The agent operates through several coordinated phases.
flowchart LR
Prompt
--> Planner
Planner
--> Analyzer
Analyzer
--> ContextBuilder
ContextBuilder
--> Executor
Executor
--> DiffEngine
DiffEngine
--> ApprovalSystem
ApprovalSystem
--> User
SantaClaw first determines:
- What the user wants
- Scope of requested work
- Potential risks
- Required context
Example:
"Add JWT authentication"
The agent identifies:
- Authentication feature
- Security-sensitive modification
- Multi-file implementation
The agent gathers context by:
- Traversing directories
- Reading configuration files
- Identifying frameworks
- Mapping dependencies
Example discoveries:
Express
Prisma
JWT already installed
User model exists
The planner creates an implementation strategy.
Example:
1. Create JWT utility
2. Create auth middleware
3. Add login endpoint
4. Protect routes
5. Update documentation
Tools execute the plan.
read_file()
search_files()
modify_file()
create_file()
Changes remain staged.
SantaClaw prepares a reviewable diff.
Example:
+ src/auth/jwt.ts
+ src/middleware/auth.ts
+ src/routes/auth.ts
- legacyAuth.tsNothing is applied yet.
The user reviews:
Approve?
[Y] Yes
[N] No
No approval = no modification.
flowchart TB
User
User --> TUI
TUI --> Router
Router --> AskMode
Router --> PlanMode
Router --> AgentMode
AgentMode --> Planner
Planner --> AIModel
Planner --> ToolLayer
ToolLayer --> FileSystem
ToolLayer --> SearchEngine
ToolLayer --> ShellExecution
AIModel --> DiffGenerator
DiffGenerator --> ApprovalGate
ApprovalGate --> User
Add JWT authentication to my API
β Express detected
β Prisma detected
β Existing User model found
β No auth middleware present
1. Install JWT dependency
2. Create token utility
3. Create auth middleware
4. Add login route
5. Protect endpoints
+ src/auth/jwt.ts
+ src/middleware/auth.ts
+ src/routes/auth.ts
~ src/server.ts
ββββββββββββββββββββββββββββββ
Review Generated Changes
ββββββββββββββββββββββββββββββ
4 files modified
Approve?
[Y] Yes
[N] No
β Changes applied successfully
SantaClaw is designed around safe automation.
Security principles:
Every modification requires approval.
Operations are restricted to approved directories.
Dangerous tools can be disabled.
Every modification is reviewable.
Shell execution is configurable.
π
SantaClaw Workshop
1. Build
2. Ask
3. Plan
4. Telegram
5. Exit
Generating implementation strategy...
β Context gathered
β Dependencies identified
β Plan generated
+ Added JWT utility
+ Added auth middleware
~ Updated server routes
Approve?
- Bun
- TypeScript
- AI SDK
- Clack
- Chalk
- Figlet
- Telegram Bot API
- Approval First
- Tool Driven
- Context Aware
- Terminal Native
- Extensible
- Transparent
- Ask Mode
- Plan Mode
- Agent Mode
- Telegram Mode
- Diff Approval System
- Repository Analysis
- Persistent Agent Memory
- Git Integration
- Branch Creation
- Commit Generation
- Session Recovery
- Repository Embeddings
- Advanced Search Indexing
- Multi-Agent Collaboration
- GitHub Integration
- Pull Request Generation
- Browser Automation
- Remote Execution
- Plugin Marketplace
- Agent Skills Framework
git clone https://github.com/yourname/santaclaw.gitcd santaclawbun installbun run index.ts wakeupContributions are welcome.
Ideas, bug reports, pull requests, feature proposals, and architectural discussions are encouraged.
Create a branch:
git checkout -b feature/amazing-featureBuild something cool and open a pull request.
MIT License
Use freely. Modify freely. Build awesome things.
This documentation can be generated by SantaClaw itself.
The agent is capable of:
- Exploring repositories
- Understanding architecture
- Identifying features
- Producing technical documentation
- Explaining implementation details
SantaClaw can document SantaClaw.
bun run index.ts wakeupYour code. Your decisions. Your workshop.