Automatically improve your codebase with Claude
Project description
Let Claude Code
Set it. Forget it. Wake up to a better codebase.
You: cook --once -m fix_bugs
Claude: *improves your code*
Claude: *commits directly to your branch*
You: *reviews the changes*
The Fundamental Flaw (And How We Fix It)
Claude Code's Problem: It's interactive. It stops and asks you questions. It waits for permission. It can't run unattended.
Our Solution: Full autonomy.
- ๐ค AI Auto-Answer: Claude asks a question? AI answers it instantly. Choose from cost-effective to premium models.
- โก Permission Bypass: Configured once, runs forever without prompts.
- ๐ Loop & Schedule: Run continuously or on cron. Walk away. Come back to improvements.
- ๐ PR Automation: Creates branches, opens PRs, reviews them, merges approved ones.
The result? Claude Code becomes a true autonomous agent that improves your codebase 24/7 without human interventionโat a cost you control.
Install
pip install let-claude-code
Or from source:
pip install git+https://github.com/friday-james/let-claude-code.git
# Or with wget
wget -qO- https://raw.githubusercontent.com/friday-james/let-claude-code/main/install.sh | bash
Update:
pip install --upgrade let-claude-code
This installs the cook command.
Quick Start
# Run once and improve code (commits to current branch)
cook --once -m improve_code
# With PR workflow (creates branch, PR, review cycle)
cook --once -m fix_bugs --create-pr
# Skip confirmation prompt
cook --once -m fix_bugs -y
By default, commits are made directly to your current branch. Use --create-pr to enable the full PR workflow with review cycles.
What Happens
Default mode (direct commits):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ YOU RUN: cook --once -m fix_bugs โ
โ โ
โ CLAUDE (Improver) โ
โ โโโ Reads your code, makes it better, commits โ
โ โ
โ DONE โ
โ โโโ Changes committed to your current branch โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
With --create-pr (full PR workflow):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ YOU RUN: cook --loop --create-pr โ
โ โ
โ CLAUDE 1 (Improver) โ
โ โโโ Reads your code, makes it better, commits โ
โ โ
โ AUTO-CREATE PR โ
โ โโโ Pushes branch, opens pull request โ
โ โ
โ CLAUDE 2 (Reviewer) โ
โ โโโ Reviews the PR critically โ
โ โโโ APPROVED โ Merge โ
โ โโโ CHANGES REQUESTED โ โ
โ โ
โ CLAUDE 3 (Fixer) โ
โ โโโ Addresses feedback, pushes fixes โ
โ โ
โ LOOP FOREVER โ
โ โโโ Back to Claude 1, next improvement โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Pick Your Mode
Option 1: Define your vision (recommended)
Create a NORTHSTAR.md file describing your ideal codebase:
cook --init-northstar # Creates template
vim NORTHSTAR.md # Customize your goals
cook --once # Claude iterates towards it
Option 2: Use preset modes
cook --once -m fix_bugs # Hunt and fix bugs
cook --once -m security # Find vulnerabilities
cook --once -m add_tests # Add missing tests
cook --once -m improve_code # Refactor messy code
cook --once -m all # Do everything
Option 3: Specify a goal directly
cook --once --goal "Add user authentication with JWT"
cook --loop -g "Refactor the API to use async/await"
| Mode | What it does |
|---|---|
fix_bugs |
Hunts down actual bugs and fixes them |
improve_code |
Refactors messy code into clean code |
enhance_ux |
Better error messages, better feedback |
add_tests |
Adds tests for untested code |
add_docs |
Documents the undocumented |
security |
Finds and fixes vulnerabilities |
performance |
Makes slow things fast |
cleanup |
Removes dead code and cruft |
modernize |
Updates old patterns to new ones |
accessibility |
Makes UI accessible to everyone |
NORTHSTAR.md
Your vision. Claude's mission.
# Project North Star
## Vision
A bulletproof API that developers love.
## Goals
### Security (do these first)
- [ ] All user input is validated
- [ ] No SQL injection possible
- [ ] Auth on every protected route
### Reliability
- [ ] 100% of business logic has tests
- [ ] All errors have helpful messages
### Developer Experience
- [ ] Every public function is documented
- [ ] No dead code or unused imports
Claude reads this. Figures out what's not done. Makes progress. Every. Single. Run.
Full default template
# Project North Star
## Vision
A high-quality, well-maintained codebase that is secure, performant, and easy to work with.
## Goals
### Code Quality
- [ ] Clean, readable code with consistent style
- [ ] No code duplication (DRY principle)
- [ ] Functions and classes have single responsibilities
### Bug-Free
- [ ] No runtime errors or crashes
- [ ] All edge cases handled properly
### Security
- [ ] No SQL injection vulnerabilities
- [ ] No XSS vulnerabilities
- [ ] No hardcoded secrets or credentials
- [ ] Proper input validation
### Performance
- [ ] No obvious performance bottlenecks
- [ ] Efficient algorithms
### Testing
- [ ] Unit tests for critical business logic
- [ ] Edge cases covered in tests
### Documentation
- [ ] Public APIs documented
- [ ] Complex logic has comments
### Code Health
- [ ] No dead or unused code
- [ ] No commented-out code blocks
## Priority Order
1. Security
2. Bugs
3. Tests
4. Code Quality
5. Performance
6. Documentation
7. Cleanup
All The Ways
# Run once (default: commits to current branch)
cook --once -m improve_code
# Run once with PR workflow (merge to main)
cook --once -m improve_code --create-pr
# Run once with PR to specific branch
cook --once -m improve_code --create-pr develop
# Skip confirmation prompt
cook --once -m fix_bugs -y
# YOLO mode: loop + create PR + auto-merge + skip prompts
cook --yolo -m improve_code
# Loop forever (with PR workflow)
cook --loop --create-pr
# Run every hour
cook --interval 3600 --create-pr
# Run on cron (requires: pip install let-claude-code[cron])
cook --cron "0 */4 * * *" --create-pr
# Auto-merge when approved
cook --loop --create-pr --auto-merge
# Get Telegram notifications
export TG_BOT_TOKEN="your_token"
export TG_CHAT_ID="your_chat_id"
cook --loop --create-pr
AI Auto-Answer
When Claude asks questions during automation, let AI answer them automatically. Choose from cost-effective to premium models.
Setup:
# Option 1: OpenAI (GPT models)
export OPENAI_API_KEY=sk-...
# Option 2: Google (Gemini models)
export GEMINI_API_KEY=...
# Or add to .env file
echo "OPENAI_API_KEY=sk-..." >> .env
echo "GEMINI_API_KEY=..." >> .env
Usage:
# Run with AI auto-answer (uses cost-effective defaults)
cook --loop -m fix_bugs --auto-answer -y
# Choose specific model
cook --loop --auto-answer --ai-model gpt-4o-mini # Cheapest OpenAI
cook --loop --auto-answer --ai-model gpt-4o # Balanced
cook --loop --auto-answer --ai-model gpt-5.2 # Premium reasoning
cook --loop --auto-answer --ai-model gemini-1.5-flash # Cheapest Gemini
cook --loop --auto-answer --ai-model gemini-1.5-pro # Balanced Gemini
# Auto mode (default) - uses gpt-4o-mini or gemini-1.5-flash
cook --loop --auto-answer
# YOLO mode (includes auto-answer)
cook --yolo -m improve_code
How it works:
- Claude encounters a question (e.g., "Should I create a new file or edit existing?")
- Automator sends question + recent conversation context to AI
- AI reasons through the question and provides an answer
- Answer is sent back to Claude automatically
- Claude continues without human intervention
Available Models:
| Model | Provider | Cost | Speed | Best For |
|---|---|---|---|---|
gpt-4o-mini |
OpenAI | $ | Fast | Default - great balance of cost/quality |
gpt-4o |
OpenAI | $$ | Medium | More complex decisions |
gpt-5.2 |
OpenAI | $$$ | Slow | Maximum reasoning for critical decisions |
gemini-1.5-flash |
$ | Fast | Default - cost-effective fallback | |
gemini-1.5-pro |
$$ | Medium | More complex reasoning | |
gemini-3-pro-preview |
$$$ | Slow | Premium Google model |
Cost Comparison:
- gpt-4o-mini: ~$0.15 per 1M input tokens, $0.60 per 1M output (cheapest OpenAI)
- gpt-4o: ~$2.50 per 1M input tokens, $10 per 1M output
- gpt-5.2: ~$10 per 1M input tokens, $40 per 1M output (premium reasoning)
- gemini-1.5-flash: ~$0.075 per 1M input tokens, $0.30 per 1M output (cheapest)
- gemini-1.5-pro: ~$1.25 per 1M input tokens, $5 per 1M output
๐ก Tip: Start with auto mode (default) for cost-effective operation. Upgrade to premium models only when needed.
Get API Keys:
Usage Tracking
After each run, you see:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Tokens: 15,234 (in: 12,500, out: 2,734)
๐พ Cache: read 14,640, created 3,461
๐ฐ This run: $0.0314 | Session total: $0.1542
โฑ๏ธ Time: 6.1s
๐ก Check quota: run 'claude' then type '/usage'
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Sessions are continued automatically - subsequent runs reuse cached context and burn fewer tokens.
All Options
| Option | What it does |
|---|---|
--once |
Run once and exit |
--loop |
Run forever (start next immediately) |
--yolo |
YOLO mode: --loop --create-pr --auto-merge -y combined |
--interval N |
Run every N seconds |
--cron "expr" |
Run on cron schedule |
-m, --mode MODE |
Improvement mode (repeatable) |
-n, --northstar |
Force NORTHSTAR.md mode |
-g, --goal GOAL |
Work towards a specific goal |
--init-northstar |
Create NORTHSTAR.md template |
--list-modes |
Show all available modes |
--create-pr [BRANCH] |
Create PR targeting BRANCH (default: main) |
-b, --branch BRANCH |
Work on specified branch (checkout if needed) |
--auto-merge |
Auto-merge approved PRs (deletes branch after) |
--max-iterations N |
Max review-fix rounds (default: 3) |
-y, --yes |
Skip confirmation prompt |
--think LEVEL |
Thinking budget: normal, think, megathink, ultrathink |
--auto-answer |
Auto-answer Claude's questions with AI (requires API key) |
--ai-model MODEL |
AI model: auto, gpt-4o-mini, gpt-4o, gpt-5.2, gemini-1.5-flash, gemini-1.5-pro, gemini-3-pro-preview |
--claude "FLAGS" |
Additional flags to pass to Claude CLI |
--resume |
Resume from a previous session |
--clear-sessions |
Clear all saved sessions |
Extended Thinking
Use --think to give Claude more thinking time for complex tasks:
cook --once --think ultrathink # Maximum thinking budget
cook --once --think megathink # 10,000 token budget
cook --once --think think # 4,000 token budget
cook --once # Normal (default)
| Level | Budget | Best For |
|---|---|---|
normal |
Default | Routine improvements |
think |
4,000 tokens | Moderate complexity |
megathink |
10,000 tokens | Complex refactoring |
ultrathink |
Maximum | Architectural decisions, deep analysis |
Concurrent Workers
Run multiple Claudes in parallel, each on its own worktree.
# Run on specific directories
cook-concurrent -d src lib scripts -p "Fix bugs"
# With PR workflow
cook-concurrent -d src lib --create-pr --auto-merge
# YOLO mode
cook-concurrent -d src lib --yolo
# With extended thinking
cook-concurrent -d src -m security --think ultrathink
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ YOU RUN: cook-concurrent -d src lib --create-pr โ
โ โ
โ Worker 1 (src/) Worker 2 (lib/) โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โ
โ โ Branch โ โ Branch โ โ
โ โ Improve โ โ Improve โ โ
โ โ Create PR โ โ Create PR โ โ
โ โ Review โ โ Review โ โ
โ โ Fix feedback โ โ Fix feedback โ โ
โ โ Merge โ โ Merge โ โ
โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ 2 PRs created, reviewed, and merged โ โ
โ โ Each scoped to its own directory โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Config file for different tasks per directory:
[
{"directory": "src", "prompt": "Fix bugs in the core modules"},
{"directory": "lib", "modes": ["security", "fix_bugs"]},
{"directory": "scripts", "prompt": "Add type hints"}
]
cook-concurrent -c workers.json --create-pr --auto-merge
| Option | What it does |
|---|---|
-d, --directories |
Directories to work on |
-p, --prompt |
Prompt for all workers |
-m, --mode |
Improvement mode (repeatable) |
-c, --config |
JSON config file |
--create-pr [BRANCH] |
Create PR targeting BRANCH (default: main) |
--auto-merge |
Auto-merge approved PRs |
--yolo |
YOLO mode: --create-pr --auto-merge -y combined |
-y, --yes |
Skip confirmation prompt |
--think LEVEL |
Thinking budget |
--dry-run |
Preview without executing |
Requirements
- Python 3.10+
- Claude Code CLI installed
- GitHub CLI (
gh) installed (for--create-pr) - Git repo with remote
Recommended: Enable auto-delete branches in your GitHub repo: Settings โ General โ Pull Requests โ โ Automatically delete head branches
Required: Configure Claude Code to allow all permissions.
On first run, cook will offer to configure this automatically. You can also manually add this to .claude/settings.json (project-level) or ~/.claude/settings.json (user-level):
{
"permissions": {
"defaultMode": "bypassPermissions"
}
}
This is required because cook invokes claude programmatically and cannot pass the --dangerously-skip-permissions flag.
Philosophy
Your codebase decays. Every day. Tech debt accumulates. Tests don't get written. Docs go stale.
You're too busy shipping features to fix it.
What if your codebase could improve itself?
That's this. One command. Claude works while you don't. Code gets better.
cook --once -m improve_code
Let Claude code.
Stop maintaining. Start automating.
Let Claude Code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file let_claude_code-0.4.0.tar.gz.
File metadata
- Download URL: let_claude_code-0.4.0.tar.gz
- Upload date:
- Size: 41.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0542aae6ccce16da453a1fd847c1ef126f238a79e92aa29ca1fc7b92431d2e71
|
|
| MD5 |
719eba1f761b185b7d9fb8c28bc7ebd2
|
|
| BLAKE2b-256 |
06b44271181473a520642c009b6451955794544de8b8d9762326f30e35262cbf
|
Provenance
The following attestation bundles were made for let_claude_code-0.4.0.tar.gz:
Publisher:
publish.yml on friday-james/let-claude-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
let_claude_code-0.4.0.tar.gz -
Subject digest:
0542aae6ccce16da453a1fd847c1ef126f238a79e92aa29ca1fc7b92431d2e71 - Sigstore transparency entry: 798149686
- Sigstore integration time:
-
Permalink:
friday-james/let-claude-code@d66f7fd912e4f8f20c34d98453dd46df19b4e447 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/friday-james
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d66f7fd912e4f8f20c34d98453dd46df19b4e447 -
Trigger Event:
release
-
Statement type:
File details
Details for the file let_claude_code-0.4.0-py3-none-any.whl.
File metadata
- Download URL: let_claude_code-0.4.0-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6f8e5edbfc967541ad08ee58f93059f7e494beb3fdff9ddd3534eb9b79506c0
|
|
| MD5 |
68b95283eac15adaf75a11fc2e89b070
|
|
| BLAKE2b-256 |
cc72b30be088028536853a65c4773c67881d2b99cfcca730b391b7ec54577d78
|
Provenance
The following attestation bundles were made for let_claude_code-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on friday-james/let-claude-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
let_claude_code-0.4.0-py3-none-any.whl -
Subject digest:
c6f8e5edbfc967541ad08ee58f93059f7e494beb3fdff9ddd3534eb9b79506c0 - Sigstore transparency entry: 798149688
- Sigstore integration time:
-
Permalink:
friday-james/let-claude-code@d66f7fd912e4f8f20c34d98453dd46df19b4e447 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/friday-james
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d66f7fd912e4f8f20c34d98453dd46df19b4e447 -
Trigger Event:
release
-
Statement type: