set-risk-profile

set-risk-profile is a command for Claude Code from joncovington/MEICAgent. It costs 0 tokens per session (1,145 once invoked), scanned A, original, MIT.

A command that changes the MEICAgent’s named trading risk profile, such as conservative, moderate, aggressive, or very-aggressive.

In plain words
What is it for?
Use it to select an available profile, update the relevant values in config.json, review what changed, and apply the settings on the next loop iteration.
Why use it?
It avoids manually editing several risk settings and backs up the current configuration before changing it.

Command for Claude Code

Install

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.

agentmods
npx agentmods add commands/joncovington/meicagent/set-risk-profile
Clone the repo
git clone --depth 1 https://github.com/joncovington/MEICAgent

Made for: Claude Code.

Wrote 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.

agentmods badge for set-risk-profile

README.md
[![agentmods](https://agentmods.dev/badge/commands/joncovington/meicagent/set-risk-profile.svg)](https://agentmods.dev/commands/joncovington/meicagent/set-risk-profile)
Your own site
<a href="https://agentmods.dev/commands/joncovington/meicagent/set-risk-profile"><img src="https://agentmods.dev/badge/commands/joncovington/meicagent/set-risk-profile.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,145 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01145
Opus 5 $0.00000 $0.00573
Sonnet 5 $0.00000 $0.00229
Haiku 4.5 $0.00000 $0.00114

Measured 4d ago against content hash f7ea6ff60ae0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

set-risk-profile scanned grade A with 0 findings 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/set-risk-profile.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Switch to a named risk profile (conservative/moderate/aggressive/very-aggressive), automatically backing up and updating config.json.

Overview

Risk profiles bundle entry-gate thresholds with offsetting position-cap and stop-management constraints. Running /set-risk-profile moderate (for example) reads the named profile from config.risk.json, backs up your current config.json, overwrites the relevant keys, and reports what changed — without restarting the loop. The new settings take effect on the next iteration.

See docs/risk-profiles.md for the full rationale, trade-offs, and when to use each profile.

Step 1 — Check valid profile names

List available profiles:

python -c "import json; cfg = json.load(open('config.risk.json')); print('Available profiles:', ', '.join(cfg['profiles'].keys())); print('Current active profile:', cfg['active_profile'])"

Expected output:

Available profiles: conservative, moderate, aggressive, very-aggressive
Current active profile: conservative

If you get an error, check that config.risk.json exists in the project root and is valid JSON.

Step 2 — Back up current config

Before making any changes, your current config.json is automatically backed up to config.json.bak:

copy config.json config.json.bak

(This happens automatically in Step 3's Python script; shown here for transparency.)

Step 3 — Apply the profile

Replace <profile_name> with one of: conservative, moderate, aggressive, or very-aggressive.

import json
import shutil
from pathlib import Path

# Load profiles and current config
with open('config.risk.json') as f:
    risk_profiles = json.load(f)

profile_name = '<profile_name>'  # e.g., 'moderate'

if profile_name not in risk_profiles['profiles']:
    print(f"ERROR: Profile '{profile_name}' not found.")
    print(f"Valid profiles: {', '.join(risk_profiles['profiles'].keys())}")
    exit(1)

profile = risk_profiles['profiles'][profile_name]
profile_note = profile.pop('_note', '(no description)')

# Back up current config
shutil.copy('config.json', 'config.json.bak')
print(f"✓ Backed up current config.json → config.json.bak")

# Load current config
with open('config.json') as f:
    current_config = json.load(f)

# Track changes for reporting
changes = {}
for key, value in profile.items():
    if key in current_config and current_config[key] != value:
        old_val = current_config[key]
        changes[key] = (old_val, value)
    current_config[key] = value

# Write updated config back
with open('config.json', 'w') as f:
    json.dump(current_config, f, indent=2)

# Update active_profile in config.risk.json
risk_profiles['active_profile'] = profile_name
with open('config.risk.json', 'w') as f:
    json.dump(risk_profiles, f, indent=2)

print(f"\n✓ Applied profile: {profile_name}")
print(f"\nProfile description:\n  {profile_note}\n")

if changes:
    print("Keys changed:")
    print("\n| Key | Old Value | New Value |")
    print("|---|---|---|")
    for key, (old, new) in sorted(changes.items()):
        print(f"| `{key}` | {old} | {new} |")
else:
    print("(No keys changed — already at this profile.)")

print(f"\n✓ Next loop iteration will pick up the new settings (no restart needed).")
print(f"✓ To revert, run: /set-risk-profile conservative")

Read the full file on GitHub · 138 lines

Changes

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.

  1. 4d ago First seen · 138 lines · 0 tokens per session scan A f7ea6ff60ae0

Subscribe to this mod's changes

set-risk-profile is a command published in the GitHub repository joncovington/MEICAgent (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,145 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.