claude-investment-assistant
A Claude Code workspace template that automates your investing every morning.
Quick start • Documentation • Examples • FAQ • Safety You define your rules in markdown files. Each morning you run one command (/investment:daily). It reads your portfolio, checks your rules, and tells you exactly what to buy or sell today. You execute every trade yourself — this tool proposes; it doesn't trade on your behalf. 1. You write strategy rules in ./strategies/.md files — using plain English plus a YAML header. Three working examples are included. 2. Each market day, you run /investment:daily in Claude Code.
Summary extracted from the README.
investment-assistant
A workspace template for designing, tracking, and running personal investment strategies with Claude Code and Alpaca.
Quick start • Documentation • Examples • FAQ • Safety
You define your rules in markdown files. Each morning you run one command (/investment:daily). It reads your portfolio, checks your rules, and tells you exactly what to buy or sell today. You execute every trade yourself — this tool proposes; it doesn't trade on your behalf.
⚠️ This is not financial advice. This is a tool for organizing and tracking your own investment decisions. It does not place trades automatically. Past performance does not guarantee future results. Pick paper or live trading when you run
/investment:setup— both are fully supported. If you pick live, you're using real money; understand the risks before you do. Readdocs/safety-and-limits.md.
What it does
- You write strategy rules in
./strategies/<name>.mdfiles — using plain English plus a YAML header. Three working examples are included. - Each market day, you run
/investment:dailyin Claude Code. The command:- Pulls your live Alpaca portfolio (read-only)
- Evaluates each active strategy's rules
- Writes a dated memo to
./journal/<today>.md - Tells you "BUY $50 of VTI today" or "no action needed" — with reasoning
- You open Alpaca and place the proposed orders yourself.
- Next day, the tool reconciles what you actually placed and proposes the next action.
That's the whole loop. Patient, mechanical, and yours to customize.
What it does NOT do
- ❌ Place trades for you (intentionally — see
docs/safety-and-limits.md) - ❌ Pick stocks or strategies for you (it follows YOUR rules)
- ❌ Provide financial advice
- ❌ Auto-modify your strategy files (it can suggest changes, you decide)
Quick start
What you need
- An Alpaca account (paper trading is free, no funding required)
- Claude Code installed
- About 30 minutes for one-time setup
5 steps
- Click the green "Use this template" button at the top of this repo, create your own copy (make it private if you want).
- Clone it locally (replace
<your-github-username>and<your-repo-name>with whatever you used when you clicked "Use this template"):git clone https://github.com/<your-github-username>/<your-repo-name>.git cd <your-repo-name> - Open the folder in Claude Code (File → Open).
- Run
/investment:setupin the chat. The wizard:- Asks paper or live up front (both fully supported)
- Walks you through Alpaca API keys → OS keyring storage → connector install → connection verification
- Walks you through each example strategy and asks your monthly budget per strategy, then configures the files for you
- Run
/investment:dailyto start the loop. (If you kept everything paused during setup, open a strategy file and changestatus: paused→status: activefirst.)
Or create your own: run /investment:new-strategy for an interactive builder.
Stuck or unsure? Run /investment:help anytime. It's a conversational guide — ask about how the workspace fits together, what a command does, or talk through a strategy idea before building it. You can also just chat with Claude directly in this workspace; the same guidance is loaded via CLAUDE.md.
Full walkthrough for non-programmers: docs/getting-started.md.
The three example strategies
All ship status: paused for safety. Activate by renaming and editing the frontmatter.
| File | Style | Risk | Good for |
|---|---|---|---|
dip-buying.example.md |
Continuous-formula dip-buying on broad ETFs (VTI, QQQ). Buy-only. | Low | Long-term accumulation with opportunistic dip overlay |
ai-value-chain.example.md |
Monthly equal-weight DCA across 8 AI infrastructure picks-and-shovels names. Buy-only. Daily research. | Medium (basket concentration) | Themed long-term exposure beyond mega-cap names |
active-trading.example.md |
Daily-checkpoint mean reversion on Mag 10 + ETFs. Buy AND sell. Quarterly review. | High | Experimentation — most retail active traders underperform |
Read each file to understand what it does before activating.
Slash commands
| Command | When to run | What it does |
|---|---|---|
/investment:setup |
Once, after cloning | First-time wizard: Alpaca API keys, OS keyring storage, MCP wiring, connection verification |
/investment:daily |
Every market morning | Reads strategies → pulls portfolio → proposes today's orders → writes journal entry |
/investment:new-strategy |
Whenever you want a new strategy | Interactive Q&A; outputs a strategy file in ./strategies/ |
/investment:help |
Anytime you're unsure | Conversational guide — orientation, how a command works, talk through designing or modifying a strategy, troubleshooting |
These commands live in ./.claude/commands/investment/. They're plain markdown — read them to understand what each does, or modify them to change behavior.
You can also just chat with Claude in this workspace without invoking a command. The CLAUDE.md at the repo root primes Claude with the workspace's safety rules and pointers, so conversational questions ("what does this strategy do?", "should I lower my monthly budget?") work out of the box.
File layout
your-investment-workspace/
├── .claude/
│ ├── commands/
│ │ └── investment/ (the slash commands — namespaced as /investment:*)
│ │ ├── setup.md
│ │ ├── daily.md
│ │ ├── new-strategy.md
│ │ └── help.md
│ └── settings.json (tool permissions — denies Alpaca order endpoints by default)
├── strategies/ (your investment rules — one file per strategy)
│ ├── *.example.md (paused examples that ship with the template)
│ └── (your active strategies)
├── journal/ (daily memos — auto-generated by /investment:daily)
├── docs/ (documentation)
│ ├── getting-started.md
│ ├── alpaca-setup.md
│ ├── designing-a-strategy.md
│ ├── faq.md
│ └── safety-and-limits.md
├── CLAUDE.md (workspace context loaded into every Claude Code session here)
├── README.md (you are here)
├── CONTRIBUTING.md (how to contribute to the template itself)
├── SECURITY.md (how to report security issues privately)
├── LICENSE
├── CHANGELOG.md
└── .gitignore
Documentation
- Getting started — 15-minute walkthrough for non-programmers
- Alpaca setup — Paper vs. live, generating keys, OS keyring storage, troubleshooting
- Designing a strategy — Anatomy of a strategy file, the three archetypes, tips
- FAQ — Common questions
- Safety and limits — What the tool will and won't do, risks per strategy archetype, disclaimer
How it stays safe
Three layers:
- Settings layer.
./claude/settings.jsonexplicitly denies the Alpaca MCP's order-placement tools (mcp__alpaca__place_*,close_position,cancel_order, etc.). Claude Code's permission system enforces this — the tool literally can't call them. - Prompt layer. Every slash command's prompt explicitly says "never execute trades; read-only Alpaca calls only." If Claude tried to violate this, the prompt itself would catch it.
- Strategy layer. Each strategy file's "Hard rules" section enforces strategy-specific limits (buy-only, universe constraints, position caps).
If you want to remove these safety layers (e.g., to enable auto-execution), you can — but you'd be doing so deliberately, with your eyes open. See docs/safety-and-limits.md for why we don't recommend it.
License
MIT. See LICENSE. You can fork, modify, sell, or do anything else permitted by MIT.
Contributing
This is a template. The best way to "contribute" is to fork and adapt it for yourself. If you find bugs in the template itself (the commands, docs, or example strategies), see CONTRIBUTING.md for what's in scope and how to file issues or PRs.
Security issues: see SECURITY.md — please report privately, not via public issues.
Built with
- Claude Code — the CLI that runs the slash commands
- Alpaca — the brokerage and market data API
- alpaca-mcp-server — the MCP connector for Alpaca
This template is a starting point. The strategies are illustrative. Read each file before activating, customize freely, and remember: every trade is your decision.