Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/richkuo/go-trader/claude-mdgit clone --depth 1 https://github.com/richkuo/go-traderWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/richkuo/go-trader/claude-md)<a href="https://agentmods.dev/instructions/richkuo/go-trader/claude-md"><img src="https://agentmods.dev/badge/instructions/richkuo/go-trader/claude-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03912 | $0.03912 |
| Opus 5 | $0.01956 | $0.01956 |
| Sonnet 5 | $0.00782 | $0.00782 |
| Haiku 4.5 | $0.00391 | $0.00391 |
Grade C, and why
go-trader CLAUDE.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Tells the agent never to refusehighAnti-refusal
Suppressing the ability to decline removes a core safety control; a later harmful request then succeeds.
- `hyperliquid_liquidation_guard.go`: **CLAMP, never refuse to arm; ONE-WAY TIGHTEN** at 0.5% buffer; 0 = unknown, never persisted; unclampable REFUSES; unreadable outcome keeps state. Boot `validateHLStopWithinBankruptc How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
go-trader Project Context
Coding guardrails only. Mechanism detail: SKILL.md § Subsystem Mechanism Reference; operator flows: SKILL.md, docs/POST_UPDATE_HISTORY.md. Docs syncs keep this file under 15,000 bytes and never split it (agents auto-load only the root CLAUDE.md; AGENTS.md symlinks to it): shorten wording to fit, never delete a guardrail.
Environment
- Go 1.26.2 (
/opt/homebrew/bin/go). Python viauv run --no-sync python; the scheduler calls.venv/bin/python3.uv syncper worktree. - systemd units:
ProtectSystem=strict, noPATH/UV_CACHE_DIRinjection; secrets in/opt/go-trader/.env. Deployed config lives OUT of the tree at/var/lib/go-trader[/<instance>]/config.json;scheduler/config.jsonis a transition symlink. SKILL.md § Configure.
Decision Priorities
- Always pursue the absolute best technical solution. Cost, compute, time, effort, tests, and code volume never narrow the option space, and never override the branch+PR workflow, verifying issue claims against code, or destructive-action safety.
- Never give time, duration, or effort estimates. Describe complexity by scope and risk only.
Repo Structure (scheduler/ is one Go package main)
executor.go/shutdown.go: new side-effecting wrapper →runPythonSideEffect, NEVERrunPython.confirmHyperliquidExecuteFillgates every live HL book path:Execution.Fillwith finiteAvgPx>0andTotalSz>0, else no book.check_hyperliquid.py executeexits 1 on unconfirmed fill.server.go/ui_*.go: lock ordermu → strategiesMu(reusingmudeadlocks SIGHUP). Loopback only./tuningnever writes config;ui_tuning.gousesspawnPythonProcessWithEnv(NEVERrunPython*);POST /api/tuning/applyis the sole promotion.config.go/config_migration.go:CurrentConfigVersion=19,MinSupportedConfigVersion=13. Seven mutually-exclusive HL stop fields (all omitted →DefaultStopLossATRMult=1.0);close_strategycanonical; unknown-key guard.strategyUsesTieredTPATRClose(sc)gates on-chain TPs, NOTlen(tiers)>0.CircuitBreaker *boolONLY via accessors.portfolio_risk.paper: every evaluator takesscopeRiskConfig, nevercfg.PortfolioRisk; nestedpaper.paperrejected.close_defaults.go: system→user→strategy; explicittp_tierswins;applyUserCloseDefaultRatchetRegimeTrailsruns inloadConfigbefore the scalar ATR-stop default.portfolio_scope.go:PortfolioScopefromisLiveArgsis the single mode classifier (strategyModeretired).activeScopesevaluates ONLY configured scopes. New portfolio-wide surface → subset withfilterStatesByScope/strategiesInScope, never the whole roster.state.go/db.go: SQLite-only, idempotent migrations.AppState.PortfolioRisk/CorrelationSnapshotare per-scope maps read viascopeRisk/scopeRiskIfPresent/scopeCorrelation, never bare.initial_capitalonly viaStateDB.SetInitialCapital.risk.go:CheckRiskskipsmanual. Corrupt position (qty≤0 or avgCost≤0) → zero-PnL*_corruptleg, cash untouched. Portfolio latch: ONE owner per cycle per scope;DrawdownReadingSubstitutedlabelled everywhere; untrusted over-limit defers, never vetoes. PaperequityTrustedis always true.ResetPortfolioKillSwitchManualis the sole DM reset. Live-only auto-clear:AutoResetConfirmedFlatKillSwitch,ClearLatchedKillSwitchSharedWallettouchScopeLiveonly. SKILL.md § Portfolio Kill Switch And Latch Ownership.daily_loss.go: hold-only, UNLATCHED pure read, PRE-FEE realized PnL, never force-closes, per scope. Newportfolio_riskgate → copy this shape (SKILL.md § Risk, latch, and the portfolio gates).exposure_cap.go: blocking-only, direction-aware; single exposure modelcomputeAssetDeltasshared withComputeCorrelation.notional_cap.go: hold-only viapausedBlocksSignal, never skips the strategy cycle; restart-required.replay_log.go/replay_mirror.go: DEFAULT-OFF; HL perps, flat-only hot-reload; one mirror per source (replayMirrorSourceID).hl_batch.go: shared-state failure ⇒ per-strategy fallback same cycle; never blank a close/SL/ratchet/protection/hedge.GO_TRADER_HL_BATCH=0disables.hyperliquid_fills.go: fill resolver built outsidemu.Lock;HLFillLookup.Px=VWAP;ClosedPnLGrossnever intoTrade.RealizedPnL; unconfirmed SL fills are gaps, not books.hyperliquid_balance.go: reconciliation-close alerts outsidemu; hedge-leg rows never reach the public route.pause.go: paused is NOT adueStrategiesskip.pausedBlocksSignalholds position-increasing signals at all 6 regime-gated dispatch sites; closes/trailing SL/ratchet/protection pass.- Regime (
regime*.go): stamp all 5 execute dispatches; stripsl_afterbefore ATR parse;regime_unified.goowns SL; directional policy DEFAULT-OFF, exact-match certs; profile allocation flat-only; dynamic/divergence HL-live-only. trailing_tp_ratchet.go: NO on-chain TP; HL perps+manual; hot-reload blocked while open.hedge.go: HL perps only; ONE reconciler (hedgeTargetDecision+runHedgeSync); ownershipPosition.HedgeForONLY; hedge PnL →RecordHedgeTradeResult, neverRecordTradeResult; fail-closed unwind + CRITICAL DM; hot-reload blocked while open; backtester rejects.hurst_gate.go: DEFAULT-OFF, no shipped threshold,config.example.jsonclean; holds position-increasing signals only; fail-closed FLAT-ONLY;metrics["hurst"]ONLY from the composite classifier; keep inrun_backtest.pystop_keys.llm_entry_analysis.go: advisory-only;spawnPythonProcessNEVERrunPython*; sole writer oftrade_diagnostics.llm_verdict.trade_diagnostics*.gonever write it.scale_in.go: geometry frozen viaRiskAnchorPrice, never blendedAvgCost.manual*.go: kill-switch+CB gated; SL edits queuePendingManualAction, NEVER direct UPDATE;force-closelive HL perps only.hyperliquid_liquidation_guard.go: CLAMP, never refuse to arm; ONE-WAY TIGHTEN at 0.5% buffer; 0 = unknown, never persisted; unclampable REFUSES; unreadable outcome keeps state. BootvalidateHLStopWithinBankruptcyBoundmirrorsLoadConfigstop-owner resolution. SKILL.md § Hyperliquid Liquidation Guard.hyperliquid_protection.go: reduce-only; on-chain TP only whenstrategyUsesTieredTPATRCloseAND live (paper never).hyperliquid_open_trailing.goarms the initial SL at open.version_probe.go/probe_cmd.go: new runtime CLI flag → both probe argvs;ExitProbeFailure=78.agent_info.go:--bootstrap-md→AGENTS.generated.md, NEVERAGENTS.md.failure_alerts.go: wire the notifier on each newrun*Check.discord_*commands.go: new mutating command →opsCommandNames+slashCommands()+dispatch.shared_wallet*.go: PRE-FEErealized_pnl, net viatradeNetPnL*. Pool budgeting: 2+ live HL/OKX perps omit capital fields, positivemargin_per_trade_usdeach; allocated↔pool flat-only.cashflow_journal.goOUTSIDEmu.kill_switch_limit_orders.go: cancel everypending_limit_ordersrow BEFORE flatten (keyed on ROW); never gatereconcilePendingLimitOrderson kill-switch; cancel≠adoption; never auto-delete an unadopted fill.orphan_limit_cancel_alerts.go: cancel-only lane, status-FIRST finalize, books NO fill;orphanLimitCancelStateis the SSoT (off-book fill = UNTRACKED POSITION).limit_fill_exposure.go: book a limit fill ONLY after live exposure confirms; per-coin aggregate, never per-row greedy; fail-closed same-direction+contained;unreadable/unbackedrefuse book AND block row delete.shared_scripts/: every check script accepts--regime-payload-json, probed at startup.platforms/<name>/adapter.py: one*ExchangeAdapterper file; HL_sz_decimals()resolves vianame_to_asset(symbol)first.shared_tools/funding_fetcher.py:merge_asofbackward, DISJOINTfunding_coverage;regime.pyATR pinnedsimple.shared_strategies/: open SSoTopen/registry.py;open/{spot,futures}/strategies.pyare shims, do not edit. Close viaclose/registry.py, imported withfrom close_registry_loader import …, never bareimport registry.hurst_exponent(DFA) is the live SSoT.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · -56 lines · -4,628 tokens per session bdb15d5af1a8
- yesterday Changed · +6 lines · -873 tokens per session edfcc1fb9d9e
- 6d ago First seen · 145 lines · 9,413 tokens per session scan C 06f416ad24a8
go-trader CLAUDE.md is an instructions file published in the GitHub repository richkuo/go-trader (345 stars, last pushed today), licensed MIT. It adds 3,912 tokens to every session, about $0.0196 per session on Opus 5. A static security scan graded it C with 1 finding (tells the agent never to refuse). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).