Lewis Jackson Self-Improving Trading Agent Framework

Deploy a 24/7 autonomous trading agent that learns from its own trade outcomes and iteratively self-improves its strategy using the Hermes agent's built-in self-learning loop — without manual retraining.

// TL;DR

The Lewis Jackson Self-Improving Trading Agent Framework is a method for deploying a 24/7 autonomous trading agent that learns from its own trade outcomes and iteratively refines its strategy using the Hermes agent's built-in self-learning loop. Built via a single copy-paste 'oneshot' prompt fed into Claude Code, it scaffolds your strategy, converts trade history into a Hermes-readable ledger, and deploys to Railway for continuous cloud hosting. Use it when you want a trading agent that adapts over time instead of executing static rules — applying the scientific method to change one variable per weekly cycle and compound improvements toward a well-defined goal.

// When should you use the self-improving trading agent framework?

Use this skill when you want to build or upgrade an automated trading agent that goes beyond static rules and can adapt its strategy over time. Trigger it when you have a trading strategy (or want one built) and want to architect it into a self-improving system running continuously in the cloud.

// What do you need before building a self-improving trading agent?

  • Existing trading strategy (optional)
    A pre-built strategy file or documentation on your current approach (e.g. entry/exit rules, asset class, position sizing). If absent, the onboarding agent will scaffold a basic baseline strategy for you.
  • Target assetrequired
    The asset or market you want the agent to trade (e.g. Bitcoin, Ethereum, Solana, a specific subnet token, forex pair, etc.).
  • Success definitionrequired
    A specific, measurable goal — e.g. target monthly return percentage, minimum Sharpe score, maximum drawdown threshold. Must be within realistic bounds given your starting capital.
  • Failure definitionrequired
    The threshold or condition that constitutes failure — e.g. drawdown below X%, return below Y% over Z days. Used by the agent to orient improvement direction.
  • Starting capital amountrequired
    The capital available for trading. Used to sanity-check whether the success definition is achievable (e.g. targeting $1M/month on $10 capital is flagged as impossible).
  • Railway accountrequired
    A Railway.app account for 24/7 cloud hosting of the agent so it runs regardless of whether your local machine is on.

// What principles make a self-improving trading agent actually work?

Accuracy

The data feeding the agent must be clean, consistent, and objectively interpreted. Unreliable API connections or ambiguous news-feed parsing introduce errors that corrupt every downstream decision. Establish strict rules so conclusions drawn from incoming data are accurate and objective, not dependent on the AI's mood or interpretation drift.

Reliability

The agent must operate 24/7 regardless of local machine state. Host on a cloud server (Railway) so execution is never interrupted by a shutdown or network drop. Reliability means the system is always executing — not just when you're watching.

Well-Defined Goal

The agent needs a destination, not vibes. Define exactly what success looks like (specific return target, Sharpe score threshold) and exactly what failure looks like. The agent uses this polarity — toward-goal vs. away-from-goal — to orient every improvement cycle. Without this, 90% of trading agents are flying blind.

Self-Improving (Scientific Method Loop)

The agent must assemble outcomes, analyze whether they moved toward or away from the goal, form a hypothesis about why, then form a second hypothesis about what to change next — and apply only ONE variable change per cycle. This is the scientific method applied to strategy iteration: change one variable, observe the outcome, make the winning version the new baseline, repeat.

One Variable At A Time

When iterating the strategy, change only a single variable per cycle. If you changed multiple variables and profitability improved, you cannot know which variable was responsible. Single-variable testing produces a clean learning signal that compounds over cycles.

Oneshot Prompt Architecture

The entire agent setup — environment detection, strategy onboarding, scaffolding, cloud deployment, and Hermes installation — is triggered by a single copy-paste prompt fed into Claude Code. This reduces setup friction to near-zero and ensures reproducibility. The oneshot prompt improves over time as community feedback is incorporated.

// How do you build the self-improving trading agent step by step?

  1. 1

    Define your four agent criteria before writing a single line of code

    Before touching any tooling, answer in writing: (1) How will I ensure data accuracy? (2) How will I guarantee 24/7 reliability? (3) What is my exact success definition (target return, Sharpe score, drawdown limit)? (4) What is my exact failure definition? These four answers become the scoring and improvement backbone of the entire agent. Do not skip this — without a well-defined goal, the self-improvement loop has no direction.

  2. 2

    Obtain the oneshot prompt from the creator's community resource

    Retrieve the most current version of the oneshot prompt (Lewis Jackson stores these in 01 Systems community > Classroom > YouTube Video Prompts). Always use the latest version — these prompts are themselves iterated based on community feedback and supersede any version shown in the video.

  3. 3

    Open Claude Code in your terminal and paste the oneshot prompt

    Launch a terminal session with Claude Code. Paste the oneshot prompt in full. The prompt initiates a guided multi-phase onboarding flow — do not try to shortcut or pre-answer phases; let the agent walk through each phase in sequence.

  4. 4

    Complete Phase 1 — Environment Check

    The agent detects your OS (Mac or Windows) and available runtimes (e.g. Node.js). It will fork into OS-specific instructions. Confirm your environment when prompted. No action needed beyond confirmation if your environment is detected correctly.

  5. 5

    Complete Phase 2 — Strategy Definition

    Choose one of three paths: (A) Point the agent at an existing strategy file on your machine by name — it will locate, parse, and extract goals and parameters from it. (B) Tell the agent you have no strategy and want a basic one scaffolded — it will create a solid baseline. (C) Build a new strategy interactively with the onboarding agent. Whichever path, the agent will output a strategy document including: asset, position limits, slippage tolerance, gas reserve, scorer weights, target return, Sharpe floor, max drawdown, and failure thresholds. Confirm or correct these before proceeding.

  6. 6

    Complete Phase 3 — Scaffold the Hermes Side-State

    The agent creates all folders, files, and a Hermes-readable trade ledger. Existing trade history (wins and losses) is converted into structured data Hermes can analyze. Review the generated strategy document and goals document to confirm they accurately reflect your intent — this is the source of truth the self-improvement loop will reference.

  7. 7

    Complete Phase 4 — Strategy Deployment (if not already live)

    If you already have a live strategy, this phase may be skipped automatically. If not, the agent will walk you through connecting the necessary APIs to make trades execute. Ensure API connections are validated before proceeding — inaccurate API connections undermine the Accuracy criterion.

  8. 8

    Authenticate with Railway for 24/7 cloud hosting

    When prompted, the agent will attempt a Railway CLI login. If the interactive login fails inside the session, open a split terminal, paste the provided login command, complete browser authentication, then return and type 'done, continuing'. If you don't have a Railway account, create one during this step — it is free up to a significant usage threshold. This step ensures Reliability: the agent runs 24/7 regardless of local machine state.

  9. 9

    Allow the agent to install Hermes automatically

    The oneshot prompt installs Hermes agent as part of the handoff phase. Verify installation by opening a new terminal and typing 'hermes' — if it launches, installation succeeded. Hermes is now the self-learning brain that will review trades on a weekly cadence, own portfolio mechanics and score weights, and write updated strategy iterations.

  10. 10

    Review the final configuration summary and confirm

    The agent will output a full confirmation: deployed strategy name, live asset, Railway hosting status, Hermes brain assignment, review cadence, Sharpe floor, max drawdown, and operating mode. The FIRST Hermes cycle is READ-ONLY — Hermes observes and produces a markdown review but does not write to the live strategy yet. You must manually approve the transition to live mode by editing the Hermes trading strategy YAML. Do not flip to live mode until you have reviewed the first cycle's output.

  11. 11

    Monitor improvement cycles and approve strategy promotions

    Hermes reviews trades on a weekly cadence. It will produce scored hypotheses, change ONE variable, and run the next cycle against the new baseline. Use the check-in commands provided in the final summary to inspect cycle outputs. When Hermes produces a cycle result that moves toward your success definition, it becomes the new baseline. Track directional progress: toward-goal outputs are good signals; away-from-goal outputs inform the next hypothesis.

// What does the self-improving trading agent framework look like in practice?

A trader has a manually-built momentum strategy for a Layer-1 token with 6 weeks of trade history (roughly 50 trades, mix of wins and losses) but has never been able to systematize improvement.

Feed the existing strategy file into Phase 2 path A. The agent extracts current parameters (position limits, entry signals, slippage tolerance) and trade history. Phase 3 converts the 50 trades into a Hermes-readable ledger. Success is defined as 15% monthly return with Sharpe ≥ 1.2 and max drawdown ≤ 12%; failure is defined as two consecutive months below 5% return. Hermes runs read-only for Week 1, identifies that position sizing on losing trades was 40% larger than on winning trades (one variable), proposes reducing max position size by 20% as the sole change for Cycle 2, and the trader approves. This becomes the new baseline if Cycle 2 moves toward goal.

A complete beginner has no existing strategy, only a small starting capital, and wants to trade a major crypto asset.

In Phase 2, select path B (no existing strategy). The agent scaffolds a basic baseline strategy appropriate for the asset. Success and failure definitions are set conservatively given the capital size — the agent will flag any success definition that is mathematically impossible given starting capital (e.g. targeting 10x returns in 30 days on minimal capital). Hermes begins the self-improvement loop from this baseline, changing one variable per weekly cycle (e.g. first testing a tighter stop-loss, then a different entry signal), compounding improvements toward the defined goal over time.

// What mistakes should you avoid when deploying a self-improving trading agent?

  • Defining a success goal that is impossible relative to your starting capital — the agent cannot self-improve toward an unreachable target and will waste cycles. Sanity-check: $10 starting capital cannot target $1M/month.
  • Skipping or vaguely defining the failure threshold — without a clear failure definition, the agent has no polarity to orient its improvement direction. 'Losing money' is not a failure definition; 'drawdown exceeding 15% in any 30-day window' is.
  • Changing multiple strategy variables between cycles — if you or a secondary agent modifies several parameters simultaneously, the learning signal is corrupted. You cannot attribute the result to any single change. Enforce the scientific method: one variable per cycle.
  • Flipping to live trading mode before reviewing the first Hermes read-only cycle — the first cycle exists to validate that Hermes has correctly understood your strategy and goals. Skipping this review risks live capital being managed by a misconfigured loop.
  • Using inaccurate or inconsistently sourced data — different AI interpretations of the same news article can produce different conclusions. Establish objective, rules-based interpretation criteria for all non-numerical inputs before deploying.
  • Hosting the agent locally instead of on Railway — a local-only agent goes offline when your machine does, violating the Reliability criterion. The 24/7 cloud hosting is non-negotiable for the system to function as designed.
  • Treating the oneshot prompt as static — the prompt improves over time based on community feedback. Always pull the latest version from the community resource rather than reusing a version from a video recording.

// What are the key terms in the self-improving trading agent framework?

Self-Improving Trading Agent
An autonomous trading agent that completes a continuous loop: execute strategy → observe outcome → analyze toward-goal or away-from-goal → form hypothesis → change one variable → update strategy → repeat. Distinct from a static bot that executes fixed rules without learning.
Hermes Agent
The self-learning AI brain installed into the trading agent stack. Hermes natively learns from every interaction and engagement without requiring manual retraining instructions. It owns portfolio mechanics, score weights, and weekly strategy review cycles.
Oneshot Prompt
A single copy-paste prompt that, when fed into Claude Code, orchestrates the entire agent setup end-to-end: environment detection, strategy onboarding, scaffolding, cloud deployment, and Hermes installation. No multi-step manual configuration required.
Well-Defined Goal
A specific, measurable destination that includes both a success definition (e.g. target return, minimum Sharpe score) and a failure definition (e.g. maximum drawdown, minimum return floor). The agent uses this polarity to orient every improvement cycle.
Sharpe Score
A numerical metric representing the risk-adjusted profitability of a trading strategy. Used as a quantitative success/failure threshold in the agent's goal definition rather than relying on subjective performance assessment.
Hermes-Readable Ledger
A structured file of all historical trades (wins and losses) converted into a format Hermes can parse, score, and learn from. Generated automatically during Phase 3 scaffolding from existing trade history.
Scientific Method Loop
The self-improvement cycle protocol: change only ONE variable per iteration, observe the outcome, promote the better-performing version to the new baseline, then iterate again. Ensures clean attribution of performance changes to specific strategy modifications.
Railway
Cloud hosting platform used to run the trading agent 24/7, independent of the user's local machine. Integrates with the terminal via CLI so strategy updates are pushed automatically without manual redeployment.
Read-Only Cycle
The first Hermes review cycle, in which Hermes observes, scores, and produces a markdown analysis of the strategy but does not write any changes to the live strategy. The user must manually approve the transition to live write mode.
Score Weights
Configurable parameters in the strategy document that determine how different trade outcomes are scored relative to the defined goal. Hermes owns and adjusts score weights as part of its self-improvement process.
Weekly Cadence
The default review and improvement cycle frequency for Hermes — once per week, with a 3-day offset from any secondary agent (e.g. Cornelius) to prevent simultaneous conflicting parameter updates.
01 Systems
Lewis Jackson's free community resource where all oneshot prompts from his videos are stored, versioned, and updated. Always retrieve prompts from here rather than manually transcribing from video to ensure you have the most improved version.

// FREQUENTLY ASKED QUESTIONS

What is a self-improving AI trading agent?

A self-improving AI trading agent is an autonomous bot that completes a continuous loop: execute strategy, observe the outcome, analyze whether it moved toward or away from a defined goal, form a hypothesis, change one variable, then update its strategy and repeat. Unlike a static bot that runs fixed rules forever, it iteratively refines its own strategy over time without manual retraining.

What is the Hermes agent in this framework?

Hermes is the self-learning AI brain installed into the trading agent stack that natively learns from every interaction without manual retraining instructions. It owns portfolio mechanics, score weights, and runs weekly strategy review cycles. Each cycle it scores trade outcomes, forms hypotheses, changes exactly one variable, and promotes the better-performing version to become the new baseline strategy.

How do I build a self-improving trading agent with Claude Code?

Start by defining four criteria in writing — data accuracy, 24/7 reliability, exact success definition, and exact failure definition. Then retrieve the latest oneshot prompt from Lewis Jackson's 01 Systems community, paste it into Claude Code, and let the guided phases run: environment check, strategy definition, Hermes scaffolding, deployment, Railway authentication, and Hermes installation. Review the first read-only cycle before flipping to live mode.

How does the agent decide what to change each cycle?

The agent applies the scientific method: it assembles recent trade outcomes, analyzes whether they moved toward or away from your goal, forms a hypothesis about why, then forms a second hypothesis about what to change — and applies only ONE variable change per cycle. If profitability improves, that version becomes the new baseline. Single-variable testing produces a clean learning signal that compounds over cycles.

How does this compare to a traditional trading bot?

A traditional trading bot executes fixed rules and never learns — its performance is capped by its original logic. This framework adds a Hermes self-improvement loop that observes outcomes, scores them against a defined goal, and rewrites its own strategy one variable at a time on a weekly cadence. The result is a system that adapts to changing conditions instead of decaying as markets shift away from its static assumptions.

When should I use the self-improving trading agent framework?

Use it when you want a trading agent that goes beyond static rules and can adapt its strategy over time. It fits best when you already have a strategy (or want one scaffolded) and want it architected into a continuously running cloud system. Trigger it when you have a specific, measurable success and failure definition and realistic starting capital — it is not for one-off manual trades.

Do I need an existing trading strategy to use this?

No — an existing strategy is optional. During Phase 2, you can point the agent at an existing strategy file, tell it you have none and want a basic baseline scaffolded, or build a new strategy interactively. The agent will output a full strategy document covering asset, position limits, slippage, gas reserve, score weights, target return, Sharpe floor, and drawdown thresholds regardless of which path you pick.

Why do I have to host the agent on Railway?

Railway hosting satisfies the Reliability criterion — the agent must run 24/7 regardless of whether your local machine is on. A local-only agent goes offline when your computer shuts down or loses network, meaning it misses trades and interrupts the self-improvement loop. Railway is free up to a significant usage threshold and integrates with the terminal via CLI so strategy updates deploy automatically.

What results can I expect from running this agent?

Expect gradual, compounding strategy improvement rather than instant profits. Each weekly Hermes cycle tests one variable and promotes the winning version, so directional progress toward your success definition builds over multiple cycles. Results depend on your starting capital, goal realism, and data quality — the agent flags mathematically impossible goals and cannot outperform an unreachable target. The first cycle is read-only, so real changes begin only after your review.

Why does the first Hermes cycle run in read-only mode?

The first cycle is read-only so Hermes can observe, score, and produce a markdown analysis of your strategy without writing any live changes. This lets you verify Hermes correctly understood your strategy and goals before it manages real capital. You must manually approve the transition to live write mode by editing the Hermes trading strategy YAML — skipping this review risks a misconfigured loop touching live funds.

What is the oneshot prompt and where do I get it?

The oneshot prompt is a single copy-paste prompt that, fed into Claude Code, orchestrates the entire agent setup end-to-end: environment detection, strategy onboarding, scaffolding, cloud deployment, and Hermes installation. Retrieve the latest version from Lewis Jackson's free 01 Systems community (Classroom > YouTube Video Prompts) rather than transcribing from a video — the prompt is iterated on community feedback and newer versions supersede older ones.

// GET THIS SKILL — FREE

Use this skill in your AI

Every skill on SkillForge is free. Drop your email and copy this skill straight into Claude, ChatGPT, or any LLM.

We'll email you when new skills drop. Unsubscribe anytime.