/l3a0:find-free-cashfrom l3a0
Calculates free cash in a brokerage account after accounting for short puts, spreads, and open orders. Works with SnapTrade data from Schwab, Fidelity, and other linked accounts.
Ships in l3a0. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The cash balance a broker reports is not what can be spent. Take a margin account where SnapTrade shows $140,000.00 of cash, and its "buying power" reads the same. That cash looks like 1,390 shares of SGOV at $100.70. The free cash is $69,000.00, enough for 684 shares at a $100.74 limit, because three things the balance does not show have claims on it.
A short call covered by a long call with the same or a lower strike and the same or a later expiry holds nothing. So does one covered by 100 shares.
The examples in this skill use invented balances and trades. The repository is public, so no figure here comes from a real account.
Use the SnapTrade tools, which are read-only. Load them in one ToolSearch call.
snaptrade_list_accounts names the accounts, so match the answer by the last digits in an account's name.snaptrade_get_orders with status open gives working orders. Read them before the positions. A sale that fills between the two reads then shows twice, which holds too much, rather than in neither, which holds too little.snaptrade_get_balance gives the cash and the broker's buying power.snaptrade_get_positions gives the stock holdings and a current price for any of them.snaptrade_get_option_positions gives every option as an OCC ticker with signed contracts, short below zero.Put the cost of open buy orders in open_order_reserve. Put every working sell order in working_orders, as the change it makes to the positions if its open_quantity, the part still working, fills. A sale to open a put adds a short, and a sale to close a long option or shares removes a cover. Write a working spread as its short leg only, because the script refuses a buy leg. It then holds that leg at its full strike rather than the spread's width, so the report names how much that overstates the hold. The script works out the free cash as if every working sell order fills, because a fill after the owner spends the figure would borrow. It prints the figure with none filled beside it, so name both in the report.
The orders tool returns only the last 30 days of orders. A pull of a years-old account's history came back with only its last 28 days. So a good-till-cancelled sale placed earlier and still working can be missing. Say so in the report, and check the broker's list of working orders when the owner places such orders.
SnapTrade's sync time does not say how fresh the data is, so judge each account by its prices. One account's last_successful_sync has stayed put while its positions, cash and quotes all changed, and the same sync time on other accounts has come with data frozen overnight.
/v2/aggs/ticker/<SYMBOL>/range/1/day/<from>/<to> works and has no bar for the current session, while the snapshot endpoint answers 403. A price equal to the last close, on a trading day, means that account's data is frozen.Pull everything again on every run, because the owner trades between runs. Free cash can move by thousands of dollars within a day as positions open and close.
snaptrade_get_orders with status executed returns the last 30 days of orders, close to a million characters for an active account, so it lands in a file. scripts/latest_fills.py reads that file, sorts the fills on time_executed and prints the latest ones, with --since to keep only fills from a date on.
python3 -I <skill base directory>/scripts/latest_fills.py <saved file> --since <YYYY-MM-DD>
Those fills date any stock sale. A sale dated today settles the next business day, so a report whose cash rests on those proceeds says so.
A thinkorswim screenshot of the Account Info panel, when the owner gives one, is live and is the better source. Take four fields from it.
Also read Money Market Balance. A nonzero balance there is cash-like but sits outside these figures, so name it separately.
Write the inputs to a JSON file in the scratchpad, in the shape the script's docstring shows. cash, stocks, options and open_order_reserve are required, with {} or 0 where nothing is held, because a field left out would read as nothing held. Then run scripts/free_cash.py from this skill's base directory with -I, which keeps Python from loading code from the current directory. The plugin's tests/test_free_cash.py pins the script's figures.
python3 -I <skill base directory>/scripts/free_cash.py <scratchpad>/find-free-cash/input.json
The script pairs every short option with the long option or 100-share lot that covers it most cheaply, the way a broker would, and prints what each pairing holds back. It then works out free cash up to three ways and keeps the lowest.
buying_power in broker_buying_power.The thinkorswim check has to come out to $0.00. Margin equity minus maintenance minus what short puts and orders hold back must equal Option Buying Power. A nonzero gap means the script's put or order holds differ from thinkorswim's, so find the difference before giving a figure. The gap can be $0.00 while the cash itself differs by a few hundred dollars between SnapTrade and thinkorswim, and the script keeps the lower figure for that reason.
A working sell order can also show here. Option Buying Power is already net of open orders, so when thinkorswim holds a working sale too, the gap equals exactly what the working orders add if they fill. The script then says so, counts the gap as $0.00, and takes nothing more off thinkorswim's figure.
The check cannot see spreads, because they sit inside the maintenance figure. A spread thinkorswim pairs more expensively than the script does shows up instead as stock maintenance larger than the stocks it is charged on. The script stops when that makes the loan value negative. Short of that, compare the stock maintenance's share of Long Marginable Value, which the script prints, with the broker's house rate for those holdings.
In a cash-secured account, buying power can count a fill or a sweep that has not reached the cash balance yet. The script prints the gap between buying power and cash minus holds. Explain each gap from the fills of the last two business days before reporting, and name it. Three examples show the pattern, with invented figures.
Schwab's buying_power in SnapTrade equals its cash and ignores what short puts hold back. It only ever comes out higher, so it checks nothing there.
For a share count, put the quoted price in buy.price and a limit price in buy.limit. The script counts at the higher of the two, so an order at the limit never costs more than the free cash. A limit near the 52-week high keeps the count from overshooting the cash if the price rises. Schwab sells no fractional shares of ETFs, so counts are whole shares.
Lead with the free cash and the share count. Then list what holds cash back, one line per short put, spread, open buy order and working sell order, and say which source the figure came from. Where sell orders are working, give the free cash both if every one fills, which is the figure to spend, and if none does. Name anything that will change it soon, such as a short put expiring this week, which frees its hold if it expires worthless and spends it if it is assigned. Measure a short option's distance from its strike with the freshest price of the underlying across all accounts, never with the frozen account's own quote.
The script stops without a figure when it finds an uncovered short call, because a naked call has no cash limit on its loss. That includes a call a working sale would leave uncovered once it fills. Say so in the report, and give no free-cash figure for that account. It also stops on input that would drop a hold, such as a missing field or half a contract, so fix the input rather than work around the error.
Never place, change or cancel an order. The owner places trades, and the ticket should show the order uses no margin before it is sent.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub l3a0/claude-plugins --plugin l3a012 skills in this plugin
/ask-boardConvene a board of directors on a strategic decision for a one-person venture. Separate advisor agents, each with its own objective, write blind memos and cross-examine. A secretary agent drafts the synthesis without knowing the CEO's view, and the main thread chairs and keeps the minutes. Use when the user asks to "ask the board", "what would my board say", "convene the board", "give me board feedback on" a plan, or asks a strategic question as the CEO or sole operator of their own venture, such as "should I do X first", "what should I focus on first", or "is my plan right or wrong"./ask-teamConvene a repository's engineering team on a plan, a design, a pull request or a blog post. Separate role agents, one per role, each review the same subject blind to the others, holding only what their role protects and may veto. Verifiers then try to refute each finding by executing code, and only what survives is acted on. Use when asked to "ask the team", "convene the team", "have the team review" an issue, a design doc, a pull request or a blog post, to audit an issue's plan before a build starts, or for the per-role lenses a repository's team charter names for its review step. A pull request review or a post review such as review-post can call it in lens mode, where it returns verified findings to the caller and posts and fixes nothing. To run a whole review round on a pull request, or on companion pull requests that land one rule in several repositories, with its brief, its lenses, its verifiers, its fixes and its review comment, read review-round.md. Not for owner decisions about money, live trading, contracts or law, which go to the board through /l3a0:ask-board./book-textTurn a book PDF the user owns into page-numbered plain text and reading parts, kept outside every repository. Covers a PDF with a text layer, read with pdftotext, and a scanned PDF of page images, read with Apple Vision OCR after whitening gray shading and splitting the margin column from the body. Also checks a quote against its cited printed page. Use when the user supplies a book as a PDF, when the Kindle Cloud Reader will not open a book, or when citations need checking against a book's printed page numbers./book-to-rulesTurn a book into rules for an engineering team and design principles for repositories, with every cited page checked against the book's text. Gets the full text, splits it into reading parts, briefs one reader agent per part, merges the notes into rules, writes them into a project repository, this plugin's role checks and board seats, and l3a0/repo-template as one pull request each, runs a review round whose verifiers refute by executing, and prices the loop. Use when asked to "adopt a book", "turn this book into rules", "read this book into the repos", or to add a book's principles to a design doc, a team charter or the plugin's agents./clear-wall-of-textTurn a dense passage in a design doc, architecture doc, charter or README into text a reader follows on one read, with every fact kept. Gives each question a subheading, breaks steps into a numbered list, puts conditions into a titled table, draws a mechanism as a Mermaid diagram or a sketch, and states each cited rule in plain words. Use when asked to make a wall of text easier to understand, to break up a dense paragraph, or to add diagrams or sketch notes to a passage of one of those documents. Not for a blog post, whose review and sketch notes belong to `review-post` and `sketch-notes` in the repository that holds the post./fast-mutationRun a mutation review fast, by scripting every mutant into one call scoped to the tests that reach it, instead of one tool round trip per edit. Drives pytest, or a suite of plain test scripts that exit non-zero on a failure. Use for a mutation lens on a pull request, for confirming that a new test catches the bug it claims to, or whenever a mutation run is taking far longer than its tests do.Other plugins' skills for the same job