Borrowing it
Nothing to install: this file belongs to richkuo/go-trader. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/richkuo/go-trader/main/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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.04578 | $0.04578 |
| Opus 5.5 | $0.01831 | $0.01831 |
| Sonnet 5.5 | $0.00916 | $0.00916 |
| Haiku 4.5 | $0.00458 | $0.00458 |
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 7d ago.
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 `validateHLStopWithinBankruptcyBound How it starts
The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
go-trader
Guardrails only; mechanism: SKILL.md, docs/POST_UPDATE_HISTORY.md. CI fails at 17,000 B, target 16,500; one root file+AGENTS.md symlink. Shorten, drop no guardrail.
Env
- Go 1.26.2. Python:
uv run --no-sync python; scheduler.venv/bin/python3;uv sync/worktree. systemd:ProtectSystem=strict, noPATH/UV_CACHE_DIRinjected, secrets/opt/go-trader/.env, config/var/lib/go-trader[/<instance>]/config.json;scheduler/config.json=transition symlink.
Priorities
- Always best solution: cost/compute/time/effort/code never narrow; branch+PR, issue-claim vs code, destructive-action safety win. No time/effort estimates; complexity=scope+risk.
Repo (scheduler/*.go=main)
executor.go/shutdown.go: side effects viarunPythonSideEffect*, NEVERrunPython. Live HL book needsconfirmHyperliquidExecuteFill(finiteAvgPx>0+TotalSz>0);check_hyperliquid.py executeexits 1 on no fill. Live RH book ONLY from settledrobinhood_order_attemptsfill (row pre-send, 1 unresolved/coin, unknown=hold); flat ONLY via fresh strict read; sells≤quantity_available, emergency≤book.planHLCloseOrder=SOLE size+mode for SIZED live closes (execute,type=manual, force-close, hedge, open cleanup; not whole/ForceFullClose); refetch fail=uncapped reduce_only; short fill books fill. Rearm ONLYresolveHLCloseRemainderStop; Q=0 verify-first cancels unconfirmed SL/TP; ONE CRITICAL;order_outcome=SOLE outcome.server.go/ui_*.go: lockmu>strategiesMu, loopback only (container wildcard+token)./tuningnever writes config;ui_tuning.go=spawnPythonProcessWithEnv, NEVERrunPython*;POST /api/tuning/apply=sole promotion.uiPartitionParam=sole?partition=resolver: unparseable=400, unowned=404; diagnostics filterSourceRolepre paging+total; cash flowlive_owned; selected correlation/portfolio-risk NEVER use untagged legacy.config*.go:close_strategycanonical, unknown-key guard. On-chain TP gate!=len(tiers)>0.CircuitBreaker *boolvia accessors ONLY.portfolio_risk.paper/paper_sources[].portfolio_risk: evaluators usepartitionRiskConfig; nestedpaperrejected.portfolio_warning.go: paused off Top Contributors ONLY if flat (Quantity==0regular+option).close_defaults.go: system>user>strategy; explicittp_tierswins;applyUserCloseDefaultRatchetRegimeTrailsruns inloadConfigBEFORE scalar ATR-stop default.portfolio_scope.go/risk_partition.go:PortfolioScopefromisLiveArgs=SOLE mode classifier;RiskPartition{Scope,Source}(live/paper/paper:<id>;paper_source=paper_sourcesid, never live)=SOLE risk+storage owner. New surface:activePartitions,filterStatesByPartition/strategiesInPartition, never roster.state.go/db.go: SQLite-only, idempotent migrations.AppState.PortfolioRisk/CorrelationSnapshot=per-RiskPartitionmaps, read only viapartitionRisk(IfPresent)/partitionCorrelation;initial_capitalonly viaSetInitialCapital.state_store*.go/storage_*.go: identity map immutable; 1 distinct file/partition; lock+save order primary>paper>sources by id. EVERY DB caller viaStateStore(dbForStrategy, live-onlyliveFile); ids translate INSIDEStateDB; load maps (file,scope)->partition; diagnostics route bySourceRole, NEVER scope. New table=SKILL.md Storage Ownership row. Manual acks by ROW ID in-tx, NEVER high-water; book+queued row=ONE tx; failing rows end; unknown ownership errs BEFORE mutation; combined reads fail whole.merge-paper-instance.sh: binaries on config COPIES;inspect/storage-inspect=LoadConfigReadOnly; both locks preflight>apply except--diff(config-only);--align-to-livewrites only.aligned; compose lists ALL root-key conflicts, refuses; alias always viapaper_alias.py;--once/--probe-onlynever proof; zero paper override inherits.channels/trade_alert_channels-paperkeys skip if merged bare key routes there (=resolveChannel);dm_channels-paper/-paper:<id>NEVER skip; proof refuses paper DM route send path disagrees with.risk.go:CheckRiskskipsmanual. Corrupt pos (qty/avgCost<=0)=zero-PnL*_corruptleg, cash untouched. Latch: ONE owner per cycle+partition;DrawdownReadingSubstitutedalways labelled; untrusted over-limit defers, never vetoes. PaperequityTrustedalways true.ResetPortfolioKillSwitchManual=sole DM reset;AutoResetConfirmedFlatKillSwitch/ClearLatchedKillSwitchSharedWalletScopeLiveonly.daily_loss.go: hold-only, UNLATCHED pure read, PRE-FEE realized PnL, never force-closes, per partition; newportfolio_riskgates copy it.exposure_cap.go: blocking-only, direction-aware; one exposure modelcomputeAssetDeltas(+ComputeCorrelation).notional_cap.go: hold-only viapausedBlocksSignal, never skips cycle, restart-required.replay_{log,mirror}.go: DEFAULT-OFF, HL perps, flat-only hot-reload, 1 mirror/source.hl_batch.go: shared-state failure=same-cycle per-strategy fallback, never blank close/SL/ratchet/protection/hedge;GO_TRADER_HL_BATCH=0disables. Missingclosed_bar_decision/htf_filterecho=script error, holds signal.market_feed_*.go:role: feedruns BEFORELoadConfig(no state/lock/probe). Seal bytes immutable; missed/evicted/pre-start key=unavailable, NEVER current data; sealer never takesmu. Consumer (websocket|shared): one sealed stdinmarketSnapshot, paper funding=seal; missing frame=error, NEVER private fetch; 1 deadline/cycle, non-nil degraded snapshot, primary>backup. REST feed:/infoviafeedBudgetAcquire; key ready ONLY if refreshed that deadline.market_feed_correction.go: outsidefeedMu, closed bars only, neverLastRecvAt/seals/readiness; ledger reasonscorrection(_retry).migrate-service-layout.py/shared-feed-convert.sh: opt-in, NEVER run by update. Layout: target authoritative from enable-intent, recovery NEVER restarts source from stale snapshot; feed: failed switch restores byte copy.hyperliquid_paper_funding*.go: paper HL book changes ONLY viamutatePaperPerpsBook; neverDailyPnL/CB/losses; unresolved=held, NEVER booked 0.hyperliquid_fills.go:HLFillLookup.Px=VWAP;ClosedPnLGrossnever intoTrade.RealizedPnL; unconfirmed SL fills=gaps, never books.hyperliquid_balance.go: hedge-leg rows private.pause.go: paused is NOTdueStrategiesskip;pausedBlocksSignalholds pos-increasing at all 6 regime-gated sites (+per-scope persistence hold, HTFunavailable); closes/trailing SL/ratchet/protection pass.regime*.go: stamp all 5 execute dispatches; stripsl_afterpre ATR parse;regime_unified.goowns SL; directional policy DEFAULT-OFF; profile allocation flat-only; dynamic/divergence HL-live only. Trade-alert span=bundle spec (tradeAlertRegimeConfig):regime.timeframeelseArgs[2], NEVERsc.Timeframe; options own fixed spec, nevercfg.Regime.trailing_tp_ratchet.go: NO on-chain TP; HL perps+manual.hedge.go: HL perps only; ONE reconciler (hedgeTargetDecision+runHedgeSync); ownership ONLYPosition.HedgeFor; PnL viaRecordHedgeTradeResult, neverRecordTradeResult; fail-closed unwind+CRITICAL DM. Both hot-reload-blocked while open; hedge backtester-rejected.hurst_gate.go: DEFAULT-OFF, no shipped threshold,config.example.jsonclean; holds pos-increasing only, fail-closed FLAT-ONLY;metrics["hurst"]ONLY from composite classifier; stays inrun_backtest.pystop_keys.llm_entry_analysis.go: advisory-only;spawnPythonProcessNEVERrunPython*; soletrade_diagnostics.llm_verdictwriter.scale_in.go: geometry frozen viaRiskAnchorPrice, never blendedAvgCost.manual*.go: kill-switch+CB gated; SL edits queuePendingManualAction(no bare book write; only re-arm/restore write); rejected close never assumes unconfirmed cancel spared trigger; verify-first SL+cancelled-TP restore, NEVER 2nd placement path; unverified=CRITICAL; adopted SL edits never gate;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.hyperliquid_protection.go: reduce-only; on-chain TP needsstrategyUsesTieredTPATRClose+live=close_ownermarker+echo (no echo=hold), NEVER nilCloseStrategy; evaluator fallback ONLY if nothing rests/armed+tiers unplaceable.SLAfterMoved: kept trigger ONLY, tighter-only; lost=CRITICAL.hyperliquid_shared_close_floor.go: <$10 shared-coin close escalates ONLY if each peer flat on-chain (refetched)+in book, before SL blocks, else ONE alert+hold;venue_rejectednever resends; re-arm (7 owners) same-cycle ONLY after SUBMITTED cancel; 2nd refusal holds, any wording; manual guard skips queued-row symbol; failed-close owner re-arms SL leg ONLY, 3 blocks=CRITICAL; unknown TP place=armed, no re-place. Operator floor (decideOperatorSharedCloseFloor): same test+side+no larger, else refuse (no hold); unreadable mark skips escalation.version_probe.go/probe_cmd.go: new runtime CLI flag>both probe argvs.agent_info.go:--bootstrap-md=AGENTS.generated.md, NEVERAGENTS.md.failure_alerts.go: wire notifier per 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,margin_per_trade_usd>0; allocated-pool flat-only.kill_switch_limit_orders.go: cancel eachpending_limit_ordersROW pre-flatten; never gatereconcilePendingLimitOrderson kill-switch; cancel!=adoption, never auto-delete unadopted fill.orphan_limit_cancel_alerts.go: cancel-only lane, status-FIRST finalize, books NO fill;orphanLimitCancelState=SSoT (off-book fill=UNTRACKED POSITION).limit_fill_exposure.go: books limit fill ONLY once live exposure confirms; per-coin aggregate, never per-row greedy; fail-closed same-dir+contained;unreadable/unbackedrefuse book+block delete.shared_scripts/: check scripts take--regime-payload-json, probed at start. Lot gate (floor, never full close): live partial=check_hyperliquid.py, no lot=no gate; HL perps paper (+opens/adds)=Go, sub-min/no lot=HOLD+no write+quiet cycle.platforms/<name>/adapter.py: 1*ExchangeAdapter; HL_sz_decimals()vianame_to_asset.funding_fetcher.py:merge_asofbackward, DISJOINTfunding_coverage; in-coverage gaps refill by strict download only,funding_venue_gaps=venue-absent (charge 0), failed refill writes nothing;regime.pyATRsimple.shared_strategies/: open SSoTopen/registry.py;open/{spot,futures}/strategies.py=shims, never edit. Close:close/registry.pyviafrom close_registry_loader import .., never bareimport registry.hurst_exponent=SSoT.- HL tier parity:
tp_model: resting_limitevaluators=buildHyperliquidProtectionPlan(SSoTtp_tier_parity.json);close_tier_fill_pricepaper-only; ladder load=validateTPTierLadders. ledger_compare.py: sim tier close needs winningresting_fill; same costs.
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.
- 7d ago Changed · +1 lines · +6 tokens per session 7b026ddd2cfc
- 8d ago Changed · +35 tokens per session 6a1369c1cade
- 9d ago Changed · -12 tokens per session e72af6a2c686
- 20d ago Changed · +1 lines · +57 tokens per session 62dd1304f7c6
- 21d ago Changed · +1 lines · +9 tokens per session 021a46bf7064
- 22d ago Changed · -1 lines · +44 tokens per session c60c7bb2c650
- 23d ago Changed · +22 tokens per session 01c55ac514c7
- 24d ago Changed · -2 lines · -147 tokens per session d9abf6194559
- 27d ago Changed · +1 tokens per session 5356e9224c19
- 29d ago First seen · 92 lines · 4,563 tokens per session scan C e6da25380392
go-trader CLAUDE.md is an instructions file published in the GitHub repository richkuo/go-trader (362 stars, last pushed today), licensed MIT. It adds 4,578 tokens to every session, about $0.0183 per session on Opus 5.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
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).
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
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 copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.