🤖 Claude Code: your copilot
Claude Code is the centerpiece—the assistant that clones, installs, configures, and runs the Factory from instructions in Portuguese. You don’t type cryptic commands: you describes the objective and review the result.
// the request that triggers the entire setup
Clone o repo https://github.com/inematds/ai-strategy-factory, me ajude a gerar e configurar as chaves de API no .env e suba a interface web.
✓ What YOU do
- ✓Describe what you want in natural language
- ✓Paste the keys when prompted
- ✓Check the result and request adjustments
✗ What CLAUDE CODE does
- →Runs git clone e python setup.py
- →Create the .env and install dependencies
- →Starts the web app and fixes the errors
does the grunt work
without cryptic commands
describes + reviews
asking well
🔑 Perplexity account + key
Perplexity is the research phase: it searches the internet for current facts about the company. The key is free and takes about 2 minutes to get. It’s what keeps the deliverables updated — not made up.
Create account
Access perplexity.ai and create a free account.
Generate the key
Go to Settings → API and click "Generate API Key." The key starts with pplx-.
Save for the .env
Copy and save it somewhere safe. When Claude Code builds the .env, you paste it there.
// .env — first line
PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxx
💡 Why live research matters
Running in 2026, Perplexity searches for 2026 data. If a tool has been replaced or a better model has emerged, the recommendations reflect that. That’s what separates a living diagnosis from a generic report that becomes outdated in weeks.
~2 minutes
key format
search, don't guess
never commit
✨ Gemini account + key
Gemini 2.5 Flash is the synthesis phase: it’s the writing engine that generates the 15 documents. It was chosen because it is cheap and with huge context — it makes an entire package possible for less than US$1. The key is free, too.
Open AI Studio
Access aistudio.google.com/apikey and sign in with your Google account.
Create the key
Click "Create API Key". The key starts with AIzaSy.
Complete the .env
Save the key. It is the second line of the .env, alongside Perplexity.
// .env — complete
PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxx GEMINI_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxx
✓ Why Gemini 2.5 Flash
- ✓Very low entry cost (US$0.075/1M tokens)
- ✓Huge context—lots of research fits at once
- ✓Fast enough for 15 documents in a row
✗ Key precautions
- ✗Never paste the key directly into the code
- ✗Never commit the .env in Git
- ✗No extra spaces or quotes around the key
writing engine
package < US$1
huge
key format
📥 Clone and Run the Repo
With the keys ready, it's time to download the Factory and get it running. You can ask Claude Code to do everything—but it's worth learning the commands under the hood so you know what's happening. When it's done, the interface opens at localhost:8888.
Clone the repository
Download the project ai-strategy-factory for your machine.
Run the setup
O setup.py creates the environment, installs dependencies, and prepares the .env. Works on Windows, macOS, and Linux.
Start the web app
The interface opens automatically in the browser at localhost:8888. Enter a company name and click Start.
// what Claude Code runs for you
git clone https://github.com/inematds/ai-strategy-factory cd ai-strategy-factory python setup.py # cria venv, instala, prepara .env # (cole suas chaves no .env) python -m strategy_factory.webapp # → http://localhost:8888
💡 If the port is busy
The web app automatically finds an available port. If you want to set a different one, ask Claude Code or run python -m strategy_factory.webapp --port 9000. On macOS, port 5000 is used by AirPlay—that’s why the default is 8888.
downloads the project
prepares everything
localhost:8888
Win/Mac/Linux
📣 Build in Public
Building in public is the mindset that turns your setup into authority. The idea is simple: show the process, including the mistakes. Whoever built this Factory faced context limits, API errors, and even a wrong model name in the documentation—and showed it all.
✓ What to share
- ✓The actual process, step by step
- ✓The mistakes and how you solved them
- ✓The first package the Factory generated
✗ The pitfall to avoid
- ✗Show only the polished result
- ✗Hide the stumbles (they build connection)
- ✗Wait until it's "perfect" to post
🔧 The real stumbling blocks during development
There were several Claude Code sessions. What went wrong along the way—and became course content:
- •Context limits (exceeded twice)
- •API errors and incorrect model name in Perplexity docs
- •Gemini chunking issue in a file
show the mess
proof of work
errors bring you closer
come from the journey
🧮 Cost management
Low cost is what keeps margins high. The Factory has two research modes, and you choose in real time based on the budget. The difference is significant: quick costs ~US$0,05; deep costs ~US$0,50.
⚡ Quick mode
~9 queries on the model sonar. A quick assessment in 2-3 minutes, ~US$0,05. This is the mode for today's Mission.
🔬 Deep mode
~18 queries with sonar-pro. Full investigation in 5-10 minutes, ~US$0.50. Use it when the client is a large company.
💡 Break up large requests
Documentation is cheap in tokens—even on a basic plan, you can do a lot if you split up your requests. Always start with quick: it delivers a complete package for pennies, and you only move up to deep when the situation calls for it.
~US$0.05
~US$0,50
cost < value
smaller requests
✅ Module summary
🎯 Mission 1.3 — Run the first package
With everything configured, ask Claude Code to run the Factory in quick mode for 1 company you know — and open the generated files:
- Make sure both keys are in the .env and the web app up and running.
- Run a quick analysis for the company you chose.
- Open the folder output/{empresa}/ and browse through the 19 files.
Success: the package generated, and you opened at least the roadmap, the deck, and the SOW. What you gained: your working Factory and the first real deliverable — living proof that the machine delivers.
Next:
Track 2 — Knowledge Synthesis (the frameworks worth their weight in gold and the cheat sheet foundation that makes the output look elite)