# How I Automated My Side Project to Earn While I Sleep Using Claude

> Source: <https://dev.to/syncore/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude-3hg4>
> Published: 2026-11-02 19:47:49+00:00

3 min read · 606 words

We’ve all heard the holy grail of indie hacking: making money while you sleep. But let's be real—most "passive income" projects require active maintenance, bug fixing, and endless content creation.

Until recently, my side project—a niche technical newsletter and automated code-auditing service—was eating up my weekends. I spent hours curating updates, writing summaries, and generating custom feedback reports for users.

Then I decided to completely automate the pipeline using Python and the [Anthropic API](https://console.anthropic.com/). Now, the system runs autonomously on a cron job, delivering value to subscribers and processing micro-payments without my intervention. Here is how I built it.

The system is straightforward:

`claude-opus-5` analyzes the data, extracts key insights, and drafts personalized user reports.
Because we are working with heavy processing tasks that exceed standard token limits, we need to stream the response and leverage adaptive thinking for deep code analysis.

First, install the latest Anthropic SDK:

```
pip install anthropic
```

Here is the core script that powers the automated analysis. Notice how we use `claude-opus-5`, enable adaptive thinking, and omit parameters like `temperature` which have been removed in the current API version:

``` python
import anthropic

client = anthropic.Anthropic()

def generate_nightly_report(raw_code_data: str) -> str:
    response = client.messages.create(
        model="claude-opus-5",
        max_tokens=25000,
        thinking={"type": "adaptive"},
        output_config={"effort": "high"},
        messages=[
            {
                "role": "user",
                "content": (
                    "Analyze the following repository data and generate a concise, "
                    "high-value security audit and summary for our subscribers:\n\n"
                    f"{raw_code_data}"
                )
            }
        ]
    )

    # Extract the text content block from the response
    return response.content[0].text

# Example execution
if __name__ == "__main__":
    sample_data = "Repo: async-cache-tools | PR #42: Memory leak in worker pool cleanup."
    report = generate_nightly_report(sample_data)
    print("Generated Autonomous Report:")
    print(report)
```

To make the automation fully hands-off, the reports need to be automatically categorized and saved to a database. Instead of relying on prompt engineering alone, we use `output_config={"format": {...}}` to guarantee a clean JSON payload. 

Here is how we structure the output for our backend database:

``` python
import json
import anthropic

client = anthropic.Anthropic()

def generate_structured_audit(issue_description: str) -> dict:
    response = client.messages.create(
        model="claude-sonnet-5",
        max_tokens=8000,
        output_config={
            "format": {
                "type": "json_schema",
                "schema": {
                    "type": "object",
                    "properties": {
                        "severity": {"type": "string", "enum": ["low", "medium", "high", "critical"]},
                        "summary": {"type": "string"},
                        "actionable_fix": {"type": "string"}
                    },
                    "required": ["severity", "summary", "actionable_fix"]
                }
            }
        },
        messages=[
            {
                "role": "user",
                "content": f"Audit this bug report and return the required JSON schema: {issue_description}"
            }
        ]
    )

    return json.loads(response.content[0].text)

# Example execution
if __name__ == "__main__":
    bug = "Database connection pool exhausts under heavy concurrent load."
    audit_json = generate_structured_audit(bug)
    print(json.dumps(audit_json, indent=2))
```

`temperature`, `top_p`, and `top_k` are gone. Steer your model's creativity and focus entirely through clear, explicit prompt instructions and the `output_config={"effort": ...}` setting.`output_config` to enforce structured data types every single time.
By combining robust backend cron jobs with the raw analytical power of `claude-opus-5` and `claude-sonnet-5`, my side project now runs like a well-oiled machine while I sleep. 

Have you automated your side projects using AI yet? Drop a comment below or share what models you are deploying in production!
