Skip to main content
MindGuard
Free tool

A trading lock you build yourself.
The prompt is free.

Paste the prompt into Claude Code or any good AI. It builds a lock on your computer with you, and that lock stops your trading the moment you break a rule.

Get the prompt

If you know this, this is for you

  • A loss.
  • “I’ll just win it back.”
  • Bigger size.
  • One more trade. And another.

It does not mean you are a bad trader. It means you need a system that enforces your rules in the moments they are hard to keep.

What the full system does

1

Blocks your trading websites and apps until a time you choose. A lock can only be extended, never shortened.

2

Early unlock only with a friend’s password. They get an email with the reason you wrote.

3

Enforces your daily loss and max trades per account, and locks until the next trading day. No early release.

4

If your platform gives an API key, Claude writes the code for it: raised limits and phone trades during a lock are caught and closed. No API key: it reads your screen and tells your friend if you traded elsewhere.

5

Your friend gets one email per trade, a daily green, yellow or red status, and a weekly summary. In plain words.

6

After a lock ends: 5 honest questions, then reminder cards in your own words while you trade.

The prompt

5,453 words

TRADING LOCK: FULL BUILD SPEC
(based on TVLock, a real system a trader built for himself with Claude Code, without writing a line of code)

WHO I AM AND WHAT I WANT
I am a trader. My problem is not my strategy. After a loss I want the money back right away: I size up, take one more trade, then another, and break rules I set when I was calm. Willpower does not show up in that moment. I want a system on my own computer that takes the rules I set while calm and enforces them when I am not. And if I try to undo it, someone I trust finds out.

I cannot code. You write all the code, the tests and the install steps, and you explain every step in plain words. Whenever an admin password is needed, I type it myself in the system dialog.

HOW WE WORK (follow this the whole time)
1. Interview me first. One question at a time. Wait for my answer. No code before the interview is done.
2. Then show me the plan: the parts below, the order you will build them in, and what I can do after each phase. Wait for my OK.
3. Build in phases. Each phase = code + automated tests + a live test on a demo account with short locks + my OK. Only then the next phase. Do not build everything at once.
4. Everything starts in test mode: locks of 2 to 3 minutes, emails only to me. Real rules only when I say so.
5. Warn me before anything that needs admin rights, and tell me exactly what it changes.
6. Never put passwords or API keys in code, in plain files, in logs or on a command line. Use the system keychain (macOS Keychain or Windows Credential Manager) or a file only the system account can read.
7. Never build anything that lets me shorten or remove a lock without my partner's password.
8. If something here does not fit my setup, say so and suggest the closest equivalent. Never skip it silently.
9. At the end of each phase, list the weak spots you see and how to close them.
10. If I am on Windows, translate every macOS piece to its Windows equivalent (Windows Service with automatic restart, the Windows hosts file, Task Scheduler, Credential Manager, UI Automation instead of Accessibility, a separate administrator account).
11. Answer in the language I write to you in. Write every message, popup and email in my language and with my name.

THE INTERVIEW (one question at a time)
1. Mac or Windows, and which version? Am I an administrator on this computer today?
2. Which trading apps and websites do I use (charting, the broker or terminal app, web trading, prop firm dashboards)? For each: desktop app, website, or both?
3. For each platform: can you get an API key for it? Help me check. If yes, write the code against the official API (Part 3). If not, write code that reads the trading app from my screen (Part 4).
4. My accounts: their names exactly as the platform shows them, and the type of each (evaluation, funded/live, personal). Do I copy trades between accounts?
5. My rules. Offer these as a starting point and let me change each one:
   - max daily loss per account, in dollars, by account type (example: $400 evaluation, $200 funded)
   - max trades (entries) per day per account (example: 3)
   - does a winning trade end the day? (example: no; the last allowed trade ends it, win or lose)
   - is adding contracts to an open trade allowed? (example: yes)
   - when does my trading day start? (example: 18:00 New York, which is 01:00 in Israel)
   - an account with no loss limit set inside the platform may not trade (example: yes)
   - anything else I want (trading hours, news windows, a profit target that locks the day, max contracts). Tell me which ones the system can really enforce, and how.
6. Who is my accountability partner? A friend, mentor or family member I do not want to let down, who agrees to (a) become the only administrator of this computer and (b) receive emails about my trading. I need their email address. Can they sit at my computer once for the handover, or is it remote?
7. Which email account sends the emails? (A Gmail account with an app password works.)
8. Which browsers do I use?
9. Do I need my charts open while the broker is locked (for example, I stream)? If yes, we also build a broker only lock.
10. Do I have demo or practice accounts for testing?

THE PRINCIPLES (apply them to every decision)
- Decide calm, enforce tilted. The rules are set before the trading day, not during it.
- Extend only. Any lock can be made longer, never shorter. Early release only with the partner's password, and the partner is told.
- Tighter is easy, looser is hard. Making a rule stricter is free. Making it looser needs the admin password.
- Strict by default. Anything unclear (an unknown account, an unreadable screen, an unknown order status) gets the strict rule. "I can't see" never means "all fine".
- Never lock what you cannot see. A lock closes the trading app, so never lock while a position or a live order may be open, because then nobody can manage it. First close or cancel, verify, then lock. If you cannot verify, alert the partner and keep trying.
- Two identical readings before acting. One bad read (an OCR mistake, an API blip) must never lock me out.
- The platform's own loss limit is required. It is the backstop that still works when my computer is off. No platform limit means no trading.
- Three layers: the platform's limit, the computer, a human.
- Honest reporting. The system hides nothing from me or from my partner.
- The rules are the system's own numbers. Changing the platform's settings cannot move them.
- Everything is tested on demo before real money.

PART 1: THE LOCK (the core service)
A background service that runs as the system (root) account, starts at boot before anyone logs in, and restarts itself if it ever stops (macOS: a LaunchDaemon with RunAtLoad and KeepAlive). It loops every 3 seconds. Each step of the loop is wrapped so one error can never kill the service.

1.1 Commands (a small command line tool)
- lock <duration>: "90" means 90 minutes; also "45m", "2h", "2h30m", "1d".
- until <HH:MM>: until the next time the clock shows that time in my time zone. "24:00" means midnight. A time that already passed today means tomorrow.
- An optional scope: full (all trading apps and sites) or broker (the broker and prop firm blocked, charts stay open).
- status: what is locked and how long is left. Works without admin rights.
- I can start or extend a lock without a password. On macOS: a sudoers rule that allows ONLY lock, until and status without a password. Unlock, rules changes and uninstall are not in it. Validate the rule with visudo and delete it if invalid.
- Extend only: if a longer lock exists, print "already locked for longer (X left), keeping that" and change nothing. A full lock always covers a broker lock. A broker lock can never shorten anything.
- Lock end times are stored as absolute timestamps in files only the system account can write, readable by everyone so the app can show them. Every write is atomic (write a temp file, then rename it).
- Every lock is logged with the time, the end, who started it (me or the system), the scope, and a note: "short pause" for short technical locks, "test" for test mode.

1.2 What a lock does
- Websites: append a marked block to the hosts file (macOS /etc/hosts, Windows C:\Windows\System32\drivers\etc\hosts) between fixed start and end markers. Point every trading domain to 0.0.0.0 and to :: (IPv4 and IPv6). The hosts file has no wildcards, so list every subdomain the platforms use: main site, app, api, data, streaming, cdn, alerts, charts embedded in other sites, and the broker endpoints inside the charting site. Help me find them. Re-apply the block every loop, so a hand edit is undone within about 3 seconds. Flush the DNS cache only when the file actually changed.
- Apps: kill the trading apps by exact process name, including their helper processes, every loop. Then a case insensitive sweep by name fragment, to catch renamed builds and web app wrappers. A reopened app closes within about 3 seconds.
- Count reopen attempts: only a kill of a main app by its exact name counts, and kills in the first 15 seconds of a lock are "closing what was open", not attempts. Log "tried to open the trading apps N times during the lock" at 5, 15 and 50.
- Browser tabs: when a lock starts, close every tab whose address contains a trading domain, in every browser I use (Safari, Chrome, Brave, Arc, Edge, Vivaldi, Comet and so on). On macOS this runs as my user with AppleScript, because tabs live in my session. During the whole lock, sweep tabs again every 6 seconds.
- Broker lock: block only the broker, the prop firm and the charting site's broker endpoints. Charts stay usable; trading from the chart's trading panel does not.
- When the lock ends: remove the block, flush DNS, stop killing apps.

1.3 Early unlock
- First a dialog: "An early release sends an email to your accountability partner, with the reason you write here. Why are you releasing now?" At least 10 characters, up to 3 tries. If I cancel, I stay locked and no password window appears at all.
- Then the operating system's own administrator password dialog. The program never sees or checks the password; the OS does. After the handover (Part 8) only my partner knows it.
- Log "UNLOCKED early by admin | reason: ...". The mailer turns this line into an urgent email.

1.4 The day end lock (no early release for anyone)
- Created by the rules: daily loss limit reached, the last allowed trade closed, or an entry beyond the max.
- Lasts until the next trading day start (example: 18:00 New York, computed with the real time zone database so daylight saving time is always right).
- Cannot be released early, not even with the admin password. Unlock shows "Day end lock (max loss or max trades). No early release, not even with a password. Opens at HH:MM." and exits.
- Stored in three places: a state file, a backup file and the service's memory. A guard checks it every loop. If it was removed or shortened, it is put back, logged as RESTORED, and my partner gets an urgent email.
- Test mode never creates a day end lock.

1.5 Heartbeat and robustness
- Write a heartbeat file (the current time) every 30 seconds. Optional: ping an external uptime check address my partner owns every 2 minutes, so they hear about it even if my whole computer goes silent.
- All state lives on disk, so locks and pending decisions survive crashes, sleep and reboots.
- The service runs its interpreter in isolated mode (macOS: python3 -I), so environment variables cannot change its code.
- Installer: checks requirements, clears download quarantine flags, installs files owned by the system account, starts the service, verifies it is running, and never overwrites existing rules. Uninstall needs the admin password, on purpose.

PART 2: THE RULES ENGINE
Pure logic in its own file, with no side effects, fully unit tested. Off after install.

2.1 Modes
- OFF: nothing runs.
- TRIAL: decisions are only logged as "WOULD lock until ... because ...". Nothing locks.
- TEST: a tiny daily loss limit (example: $1), every lock lasts 2 minutes and can be released, it ends by itself after a few hours (max 12), and emails go only to me. The platform's own limit is still checked against my real numbers.
- REAL: full behavior. Real locks also need a flag that says "cancelling orders was verified on demo". Without it, stay in TRIAL and log why.
- Changing rules or modes always needs the admin password and is logged. Switching the rules off or to trial, or turning test mode on, sends my partner an urgent email.

2.2 Limits
- Daily loss per account, in dollars, by account type. Counted from the account's first reading of the trading day. Open trade drawdown counts. Exactly at the limit is a breach; a profit never is.
- An unknown or unconfirmed account gets the strictest limit until the admin confirms its type.
- Max entries per day per account. Adding to an open position is allowed if that is my rule. Track the biggest size held during each trade.
- Counts reset at the trading day boundary. Today's counts are saved to disk, so restarting the service cannot reset my trade count.

2.3 Events
- Entry: log "account entry N/3", plus "last one today" at the max.
- Trade closed: wait 3 readings so the balance settles, then log "trade N closed: Q contracts, P&L +$X" (P&L = balance now minus the balance when I was flat before the entry).
- The last allowed trade closed, win or lose: the day ends for that account. An earlier winning trade does not end it.
- An entry beyond the max is a violation: close it, and lock 60 seconds later.
- Daily loss reached is a breach: wait until flat, then lock until the next trading day. The system does not close this trade itself; the platform's own server side limit does. The system closes trades itself in only two cases: an entry beyond the max, and a position opened while the platform limit was missing.
- Quiet warnings at 50% and 80% of the daily loss, once each per day, logged only.
- Trading away from the computer: if an account was last seen flat more than 2 minutes earlier, and when it is seen again the balance moved more than $25 or a position is open (confirmed on 2 reads), log OFFLINE and email my partner ("probably traded from the phone or a website").

2.4 The platform must have its own limit
- If an account shows no daily loss limit, a limit looser than my rule (with a $1 rounding tolerance), or the column cannot be read: show a red window that cannot be closed: "You have no loss cap. The system locks in 3:00. Set a daily loss limit in the platform now. As soon as it shows up, the clock disappears." Play a sound when it appears, at 60 seconds and at 10 seconds. If nobody touched the keyboard or mouse for 5 minutes, the countdown waits.
- Not fixed within 3 minutes: lock 10 minutes. The second time today: 30 minutes. The third time: until the next trading day.
- A trade opened while the limit was already missing: close it at once and lock.
- The limit disappears in the middle of a trade: warn only, never close that trade. The countdown starts once I am flat.
- If the platform can lock its own risk settings, tell me to turn that on too.

2.5 Locking safely
- At most one lock decision per loop.
- Before any lock that must close a position: ask the platform guard or the screen reader to close it, retry, log "positions not flat yet" at most every 30 seconds, and after 90 seconds log STUCK once (urgent email) and keep trying. Never lock over an open trade.
- When flat, check live orders. If any order is alive, or the order list is not visible (that counts as unknown, not empty), cancel them all. After 60 seconds log ORDERS STUCK once (urgent email). An unknown order status counts as alive.
- Lock only when every account is flat and no live order exists. Then log "flat and no live orders verified, locking".
- If the trading app is closed while a lock is pending, wait and log WAIT. If it was closed while the system was closing a trade, log ESCAPE (urgent email). The lock comes when the app is open again and nothing is open.
- If the screen or the API cannot be read for a while: if a position or order might be open, log BLIND once and alert my partner, and do not lock. If the last readable state was clear, take a 3 minute failsafe pause instead.
- Automatic locks default to the broker scope so my charts and streams stay open. Make it a setting.

PART 3: IF THE PLATFORM GIVES AN API KEY, USE THE OFFICIAL API
- Store the personal API key in the keychain and in a file only the system account can read. Never print it.
- Run as a system service too, so stopping my own helpers does not stop it. Poll every 5 seconds: accounts (balance, daily P&L, status, plan, type), each account's risk settings (daily loss limit, the action when it fires, max trades per day, trades today, trades remaining, realized day P&L, whether the limit already fired, whether settings are locked), open positions, pending orders, and today's closed trades.
- Session token: renew it 2 minutes before it expires and on any 401. Every action request carries a unique idempotency key, so repeating a close is safe. Closing an account always means both "flatten positions" and "cancel all orders".
- During a lock the hosts file blocks the platform's domains, so the guard resolves the API host by itself (directly through public DNS, cached 5 minutes) with normal TLS verification. Only the API host, nothing else.
- Net P&L per trade = P&L minus fees, commission and liquidation fee. Each closed trade is logged once (remember the last 500 trade ids).
- Loss today = the worst of: realized day P&L, the account's daily P&L, and the sum of today's trades.
- Compare the platform's settings with my rules on every read: no daily loss limit, a limit above mine, a daily loss action that does not close trades, no max trades, a max above mine. Stricter is fine.
- An account that had correct limits and then shows looser limits on 2 reads in a row is LOOSENED: close everything, lock the whole computer until the next trading day, and email my partner urgently, every single time. Raising my limits on tilt must not work.
- Each account counts on its own. When one account hits its loss limit or its last trade, close what is open there and stop that account until the next trading day, while the others keep trading. When every account is done, lock the computer until the next trading day. Breaking a rule on purpose (loosening, an extra entry) locks everything at once.
- Copied trades: each account gets its own log line, and the lock happens once, when the last account is done.
- A stopped account that opens a trade again (from the phone, a website, a trade copier): close its positions and orders within seconds, report the 1st, 3rd and 10th attempt (urgent email), never touch the other accounts.
- Any trade opened anywhere during a lock: close it within seconds and report it the same way. Still open 30 seconds after closing it: one STUCK email.
- A newly seen account: do not act on its past today (no surprise locks for things that already happened), but it must get limits like any other.
- Practice accounts are watched only in test mode, marked [TEST], with 3 minute pauses, and they never soften a real account's rules. The test switch may live in my folder, but accept it only if it is a real file I own, small, not a link, and for at most 12 hours.
- API unreachable or key refused for 10 minutes of awake time (sleep does not count): one email per day ("the system cannot see the account; the platform's own limit still protects it").
- Write a status file for the app and the coach, and a heartbeat file after every poll.

PART 4: IF THERE IS NO API KEY, READ THE TRADING APP FROM THE SCREEN
- A small helper app that runs in my session. It needs Accessibility permission (preferred: exact text that works even when the window is covered) and Screen Recording as a fallback.
- Every 5 seconds: find the trading app's window and read the Accounts table (account, status, net liquidation, open P&L, total P&L, distance to drawdown, exposed position, distance to daily loss limit) and the Orders table (id, account, status, action, quantity, filled, contract, type, price, stop), plus the order status tab counters (Working, Suspended and so on) as a cross check.
- Accessibility first: switch on the app's accessibility tree (Electron apps build it only when asked), walk it, and turn elements into text boxes. OCR fallback: capture only that window, find the Accounts tab, and read the table band again at 3x scale.
- Parse carefully: find the header row by the most known column names (ignore look alike decoys in top bars), split merged header boxes, stop the table at the next module's title, group rows by height, reject junk such as chart axis numbers, treat "(x)" as negative money, and treat anything unreadable as unknown, never 0.
- An order is alive unless it is filled, canceled, rejected, expired or completed. Unknown counts as alive. No Orders module on screen means unknown, not empty.
- Write the readings to a file the system service reads. The service accepts it only if it is a real file in my folder, small, not a link and not writable by others.
- Act only on request: while a "flatten" request file exists, press the platform's exit or flatten buttons; while a "cancel" request file exists, press each live order's cancel control. Add a dry run command that shows what it would press.
- No reading means the file goes stale. The service treats readings older than 20 seconds as stale: warn at 3 misses, act at 5 (see 2.5).

PART 5: THE ACCOUNTABILITY PARTNER EMAILS
Runs in my session with no admin rights. Reads the system log line by line, remembers its position, survives log rotation, never mails events from before it was installed, and retries a failed send every 15 seconds on the same line until it goes through, without counting anything twice.
- Sending: the email app password lives in the keychain. Credentials go through a private temp config file that is deleted right after, never on the command line. Every email ends with "Sent automatically from the lock system".
- Tone: plain words, no trading jargon, no dollar signs in urgent emails. Every urgent email has "What happened" and "What to do". Most "what to do" lines end with "No preaching."
- At most 1 urgent email per trading day; the rest are folded into the daily status. These always go out anyway: early unlock, a trade the system cannot close, an order it cannot cancel, loosened limits, a trade opened in a stopped account or during a lock, the day end lock removed and put back, the system cannot see the account (once a day), the rules switched off or test mode switched on.
- Examples:
  - Early unlock: "Urgent: released the lock early (time N this week). Call today." Body: when, how early, and the reason I wrote. What to do: "Call or text today and ask what happened. No preaching. That's all that's needed."
  - Rule violation: "The system closed the trade and locked trading for today." What to do: "Send: 'I saw. You're locked. Step away from the screen and call me tonight.' Tonight ask what I felt before the entry, and what the plan is for tomorrow."
  - Loosened limits: "Changed the loss limits. The system closed everything and locked until tomorrow."
  - Trading during a lock: "A trade was opened during a lock, probably from the phone. The system closed it within seconds."
  - Many attempts to open the apps: "Call: 'Get up from the desk for half an hour and call me after.'"
  - The system is off (heartbeat older than 10 minutes, counting awake time only): "The lock system has not been running for N minutes. There is no problem on your side. Ask me to turn it on today."
- One email per closed trade, never capped: size, result ("profit of X dollars"), and where it stands in the day ("trade 2 of 3 allowed today", "the last one allowed today, the system locks until tomorrow", "beyond what is allowed"). Copied trades: wait 45 seconds, then send one email with a line per account and the total, plus "the daily loss cap is counted in each account separately". The same account again means a new trade.
- A daily status every trading day, even when nothing happened, so silence itself is an alarm: 🟢 a day by the rules, 🟡 rules kept but a warning sign, 🔴 violations. Sections: what went wrong, notes, what went well (self locks first), today's trades, how many urgent events were folded in, days in a row by the rules, and what to do ("No need to do anything" / "If it repeats, a short talk is worth it" / "Ask what happened today. No preaching."). Two loss cap days in a row add "Worth asking if a day off is needed." Streaks of 10, 20, 30, 50, 75 and 100 days: "send a kind word".
- A weekly summary on Friday instead of the daily: days by the rules (G of T), early releases, violations, loss cap days, the streak, and a lead line ("A perfect week. Send a kind word." / "A week with difficulties. A short talk is worth it, no preaching.").
- Popups for me only (no email) for routine things: lock started, orders being cancelled, the 3 minute countdown, and "an email was sent to your partner" after every urgent email.
- Test mode: test emails go only to me, marked [Test], starting with "This is how it will look for your partner". My partner's records are never touched.
- A one time guide email to my partner that explains the colors and what to do, including: "If the daily email didn't arrive at all, something is off. Ask me why." and "If I argue: 'Noted. We'll talk tonight.' and hang up."

PART 6: THE COACH (after a lock ends)
- When a lock ends by itself (not after an early unlock, not after a short technical pause), a window opens that cannot be closed, floats above everything and shows on every screen. Until I finish it, the trading apps and tabs keep closing every 3 seconds.
- Five questions, each with a hint. Every answer needs at least 2 lines as shown on screen and 40 characters. Paste and drag and drop are blocked ("No pasting. Write it fresh, that's the whole point."). A live status under each answer ("One more line", "A bit more", "Got it"). The submit button works only when all 5 are complete.
  1. Why am I going to the chart now? What is the real reason? (boredom, winning back a loss, habit, excitement, or a setup and a plan)
  2. What do I gain from working right today?
  3. What do I give up when I work right? (the thrill, the action, trades I won't take, sitting with FOMO)
  4. What do I "gain" from working wrong? (relief, adrenaline, a sense of control, escaping something)
  5. What do I lose from working wrong? (money, days, confidence, sleep, people close to me, the path I'm building)
- Save every questionnaire to a journal file.
- Show a card with my own answer to question 1 right away. Then send my answers to an AI (for example the locally installed Claude Code command line with no tools and no saved session, or any AI API) with these rules: use only what I wrote, in my voice, first person, no clichés, no emoji. It returns JSON: a summary of 3 to 5 sentences and exactly 8 cards: mirror (an exact quote of mine), punch (one knockout sentence), ledger (gains and losses), letter (from me before the chart to me now), question (one sharp question before the next click), future (how I will feel tonight), contract (a commitment to myself), image (a metaphor). Timeout 5 minutes. If it fails, use my own answers as the cards.
- Reminder cards pop up in a corner every 20 minutes while a chart or trading app is open, rotating through the 8. Each kind has its own color, a time bar, and closes on click. They stop when the next lock starts or 18 hours later.

PART 7: THE DASHBOARD APP
A small native app in my language (right to left if my language needs it):
- Status: a ring with the time left, "Locked" / "Broker locked" / "Open", and the end time.
- Lock panel: scope (full or broker), and a mode: until midnight, until a time (a stepper), by duration (30m, 1h, 2h, 4h, 8h), or a date up to 7 days ahead in New York time or my local time. It shows the end and "in X". Warnings: "That time has already passed" and "There's a longer lock. You can only extend."
- A checklist before locking: no open position, no open orders, I saved what I need from my tabs. The lock button works only when all three are ticked. Confirmation: "No cancel without the admin password."
- History: days in a row with a lock, locks in the last 7 days, early releases, and the last 7 events.
- What is blocked, and early release ("only with the admin's password, every release is recorded").
- Rules tab: the mode (off, trial, active), the age of the last reading, a daily loss meter per account ("$loss of $limit, entries n/max"), the account list with types. Saving needs the admin password.

PART 8: THE HANDOVER (the most important step)
- My partner creates a new administrator account on my computer, with a password only they know. We check that it works (log out, log in to it). Only then, from their account, remove admin rights from my account and restart. Never remove my admin rights before the new admin is confirmed working, or the computer is left with no admin.
- If my partner is remote: I type a temporary admin password, and they set the real one without me seeing it (a one time, encrypted, expiring link is a good option). Change the password from old to new, not a reset, so disk encryption stays in sync. Then check: the new password works, the temporary one no longer works, and disk encryption is still enabled for that account.
- After the handover I can lock, extend and see the status. Unlock, rules changes, uninstall and editing system files all need my partner.

PART 9: TESTING
- Unit tests for every rule above, including edge cases: exactly at the limit, one cent under, a misread followed by a good read, a new trading day, a restart in the middle of a day, copied accounts, the limit disappearing mid trade, an unknown order status, a stale screen while a trade is open.
- An end to end check script that prints PASS or FAIL for each line: lock 1 minute without a password, extend it, a shorter lock is refused, status, unlock without the admin password is denied, the websites are unreachable, the apps are killed within seconds, a hand edit of the hosts file is undone, and expiry cleans everything up.
- A "check" command that lists what is ready and what to fix before the test day.
- A test day on demo, in this order, each step only after the previous one passed: readings OK, trial mode (see the WOULD lines), test mode with a $1 limit and 2 minute locks (an open order is cancelled before the lock, every trade sends me an email), copied accounts, one small real trade, then real mode.

Out of scope on purpose: my phone. It stays my emergency way to manage an open position, and the platform's own limit protects it.

Start now with question 1 of the interview.

The full build spec of my own lock, every detail, minus my private data. Paste it into Claude Code. It interviews you one question at a time and builds in phases, test mode first.

How to use it, step by step

  1. 1

    Write your rules while you are calm. For example: max daily loss, max trades a day, locked until what time.

  2. 2

    Pick a friend to hold the password. Someone who will call you, not lecture you.

  3. 3

    Set a loss limit inside your trading platform too. That is your first layer of protection.

  4. 4

    Open Claude Code (Claude that works right on your computer: it writes, tests and installs) or any good AI. Paste the prompt and answer its questions one at a time.

  5. 5

    Start with a test: a lock of 3 minutes on a demo account. Try to break a rule and see what happens.

  6. 6

    Your friend types the unlock password. You never see it.

  7. 7

    Turn it on for real.

A basic version is friction plus a witness, not a fortress. That is enough: between the urge and the click, there is now another person.

This is what my lock looks like

I built it for myself with Claude Code. I did not write a single line of code. Mine also closes trades when an account hits its loss limit, locks everything until 1:00 AM Israel time, and sends my friend a daily status.

Idan’s trading lock app in locked state

Idan, founder of MindGuard

The lock stops your trading after a rule is broken. MindGuard helps you see what leads there.

MindGuard connects to your trading account and spots patterns like revenge trading, FOMO and tilt, on your own data. No judgment. What was a secret becomes a work plan.

Not financial advice. This page is about discipline, not profits.