{"slug": "how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude", "title": "How I Automated My Side Project to Earn While I Sleep Using Claude", "summary": "A developer automated a niche technical newsletter and code-auditing side project using Python and the Anthropic API, running the pipeline on a cron job to generate subscriber reports and process micro-payments without manual intervention. The setup uses claude-opus-5 with adaptive thinking and high effort for deep code analysis, and claude-sonnet-5 with a JSON-schema output_config to produce structured audit results for a backend database. The developer notes that temperature, top_p and top_k parameters have been removed, with behavior now steered through explicit prompt instructions.", "body_md": "3 min read · 606 words\n\nWe’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.\n\nUntil 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.\n\nThen 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.\n\nThe system is straightforward:\n\n`claude-opus-5` analyzes the data, extracts key insights, and drafts personalized user reports.\nBecause 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.\n\nFirst, install the latest Anthropic SDK:\n\n```\npip install anthropic\n```\n\nHere 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:\n\n``` python\nimport anthropic\n\nclient = anthropic.Anthropic()\n\ndef generate_nightly_report(raw_code_data: str) -> str:\n    response = client.messages.create(\n        model=\"claude-opus-5\",\n        max_tokens=25000,\n        thinking={\"type\": \"adaptive\"},\n        output_config={\"effort\": \"high\"},\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": (\n                    \"Analyze the following repository data and generate a concise, \"\n                    \"high-value security audit and summary for our subscribers:\\n\\n\"\n                    f\"{raw_code_data}\"\n                )\n            }\n        ]\n    )\n\n    # Extract the text content block from the response\n    return response.content[0].text\n\n# Example execution\nif __name__ == \"__main__\":\n    sample_data = \"Repo: async-cache-tools | PR #42: Memory leak in worker pool cleanup.\"\n    report = generate_nightly_report(sample_data)\n    print(\"Generated Autonomous Report:\")\n    print(report)\n```\n\nTo 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. \n\nHere is how we structure the output for our backend database:\n\n``` python\nimport json\nimport anthropic\n\nclient = anthropic.Anthropic()\n\ndef generate_structured_audit(issue_description: str) -> dict:\n    response = client.messages.create(\n        model=\"claude-sonnet-5\",\n        max_tokens=8000,\n        output_config={\n            \"format\": {\n                \"type\": \"json_schema\",\n                \"schema\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"severity\": {\"type\": \"string\", \"enum\": [\"low\", \"medium\", \"high\", \"critical\"]},\n                        \"summary\": {\"type\": \"string\"},\n                        \"actionable_fix\": {\"type\": \"string\"}\n                    },\n                    \"required\": [\"severity\", \"summary\", \"actionable_fix\"]\n                }\n            }\n        },\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": f\"Audit this bug report and return the required JSON schema: {issue_description}\"\n            }\n        ]\n    )\n\n    return json.loads(response.content[0].text)\n\n# Example execution\nif __name__ == \"__main__\":\n    bug = \"Database connection pool exhausts under heavy concurrent load.\"\n    audit_json = generate_structured_audit(bug)\n    print(json.dumps(audit_json, indent=2))\n```\n\n`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.\nBy 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. \n\nHave you automated your side projects using AI yet? Drop a comment below or share what models you are deploying in production!", "url": "https://wpnews.pro/news/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude", "canonical_source": "https://dev.to/syncore/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude-3hg4", "published_at": "2026-11-02 19:47:49+00:00", "updated_at": "2026-11-02 19:53:31.882052+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-tools", "developer-tools"], "entities": ["Anthropic", "Claude", "claude-opus-5", "claude-sonnet-5", "Anthropic API", "Python"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude", "markdown": "https://wpnews.pro/news/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude.md", "text": "https://wpnews.pro/news/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude.txt", "jsonld": "https://wpnews.pro/news/how-i-automated-my-side-project-to-earn-while-i-sleep-using-claude.jsonld"}}