# Send Clawback to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "clawback",
    "name": "Clawback",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/mainfraame/clawback",
    "canonicalUrl": "https://clawhub.ai/mainfraame/clawback",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/clawback",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawback",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "CHANGELOG.md",
      "CLAUDE.md",
      "CODE_IMPROVEMENTS_SUMMARY.md",
      "CONFIGURATION_IMPROVEMENTS.md",
      "DAILY_MAINTENANCE_2026-02-03.md",
      "DAILY_MAINTENANCE_2026-02-04.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "clawback",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T12:15:15.587Z",
      "expiresAt": "2026-05-07T12:15:15.587Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawback",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawback",
        "contentDisposition": "attachment; filename=\"clawback-1.1.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "clawback"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/clawback"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/clawback",
    "downloadUrl": "https://openagent3.xyz/downloads/clawback",
    "agentUrl": "https://openagent3.xyz/skills/clawback/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawback/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawback/agent.md"
  }
}
```
## Documentation

### ClawBack

Mirror congressional stock trades with automated broker execution

### Agent Instructions

When the user invokes /clawback, execute the appropriate command based on the argument:

### Commands

When the user invokes /clawback with any arguments, execute the corresponding command:

CommandAction/clawback setupRun the setup wizard: Execute {baseDir}/bin/clawback.py setup/clawback statusCheck system status: Execute {baseDir}/bin/clawback.py status/clawback runStart trading bot: Execute {baseDir}/bin/clawback.py run/clawback daemonRun as background service: Execute {baseDir}/bin/clawback.py daemon/clawback testTest notifications: Execute {baseDir}/bin/clawback.py test/clawback (no args)Show help: Execute {baseDir}/bin/clawback.py --help

### How to Execute Commands

Option 1: Using the wrapper script (recommended)
When executing ClawBack commands, always:

Use the wrapper script at {baseDir}/bin/clawback.py
Pass the command as an argument (e.g., {baseDir}/bin/clawback.py status)
Capture and display the output to the user

Option 2: Direct Python execution (if wrapper doesn't work)
If the wrapper script fails, you can run ClawBack directly:

Change to the skill directory: cd {baseDir}
Activate the virtual environment: source venv/bin/activate
Run the CLI: python -m clawback.cli [command]
Capture and display the output

Important: Always check if the virtual environment exists at {baseDir}/venv. If not, you may need to run the setup first.

### /clawback setup - Interactive Setup Flow

When user runs /clawback setup, follow these steps:

Step 1: Install dependencies (if needed)
Check if {baseDir}/venv exists. If not, run:

cd {baseDir} && python3 -m venv venv && source venv/bin/activate && pip install -e .

Step 2: Prompt for E*TRADE credentials
Ask the user for each value:

Environment: Ask "Do you want to use sandbox (testing) or production (real money)?"

Default: sandbox



Consumer Key: Ask "Enter your E*TRADE Consumer Key (from developer.etrade.com):"

Required field



Consumer Secret: Ask "Enter your E*TRADE Consumer Secret:"

Required field



Account ID: Ask "Enter your E*TRADE Account ID (or leave blank to get it after OAuth):"

Optional - can be obtained later

Step 3: Save configuration
Create/update ~/.clawback/config.json with the provided values:

{
  "broker": {
    "adapter": "etrade",
    "environment": "<sandbox or production>",
    "credentials": {
      "apiKey": "<consumer_key>",
      "apiSecret": "<consumer_secret>"
    }
  },
  "trading": {
    "accountId": "<account_id>",
    "initialCapital": 50000,
    "tradeScalePercentage": 0.01,
    "maxPositionPercentage": 0.05,
    "dailyLossLimit": 0.02
  },
  "notifications": {
    "telegram": {
      "enabled": true,
      "useOpenClaw": true
    }
  },
  "congress": {
    "dataSource": "official",
    "pollIntervalHours": 24,
    "minimumTradeSize": 10000
  }
}

Step 4: Confirm setup
Tell the user: "Configuration saved to ~/.clawback/config.json. Run /clawback status to verify."

### Getting E*TRADE API Credentials

Direct user to: https://developer.etrade.com

Create a developer account
Create a new app (sandbox first for testing)
Copy the Consumer Key and Consumer Secret

### Configuration Location

Config file: ~/.clawback/config.json
Skill directory: {baseDir}

### Reading Saved Configuration

To check if the user has configured credentials, read ~/.clawback/config.json:

If file doesn't exist or credentials are empty → prompt for setup
If credentials exist → can proceed with status/run commands

The CLI automatically reads from ~/.clawback/config.json for all operations.

### Checking Setup Status

Before running /clawback status or /clawback run, verify:

{baseDir}/venv exists (dependencies installed)
~/.clawback/config.json exists with non-empty broker.credentials.apiKey

If either is missing, suggest running /clawback setup first.

ClawBack tracks stock trades disclosed by members of Congress (House and Senate) and executes scaled positions in your E*TRADE brokerage account. Built on the premise that congressional leaders consistently outperform the market due to informational advantages.

### Default Target Politicians

ClawBack monitors these politicians by default (configurable):

PoliticianChamberPriorityNancy PelosiHouse1 (highest)Dan CrenshawHouse2Tommy TubervilleSenate2Marjorie Taylor GreeneHouse3

### Trading Strategy Defaults

ParameterDefaultDescriptionTrade Delay3 daysWait after disclosure before tradingHolding Period30 daysTarget hold time for positionsPosition Size5%Max allocation per tradeStop-Loss8%Per-position stop-lossPortfolio Drawdown15%Max portfolio loss before haltDisclosure Checks10:00, 14:00, 18:00 ETDaily check times

### Features

Real-time disclosure tracking from official House Clerk and Senate eFD sources
Automated trade execution via E*TRADE API (only supported broker)
Smart position sizing - scales trades to your account size
Trailing stop-losses - lock in profits, limit losses
Risk management - drawdown limits, consecutive loss protection
Telegram notifications - get alerts for new trades and stop-losses
Backtesting engine - test strategies on historical data

### Performance (Backtest Results)

StrategyWin RateReturnSharpe3-day delay, 30-day hold42.9%+6.2%0.399-day delay, 90-day hold57.1%+4.7%0.22

Congressional leaders have outperformed the S&P 500 by 47% annually according to NBER research.

### Installation via ClawHub

# Install from ClawHub registry
clawhub install clawback

# Or install from local directory
clawhub install ./clawback

### Common Issues

Skill not executing: If /clawback doesn't work in OpenClaw:

Check if the skill is in the correct location: {baseDir}/
Verify the wrapper script is executable: chmod +x {baseDir}/bin/clawback.py
Check if virtual environment exists: {baseDir}/venv/



Authentication issues: If E*TRADE authentication fails:

Run the authentication utility: python {baseDir}/scripts/auth_utility.py --auth
Run {baseDir}/bin/clawback.py setup to reconfigure
Check credentials in ~/.clawback/config.json
Verify E*TRADE API keys are valid



Token expiration: If tokens expire (30-day lifespan):

Run: python {baseDir}/scripts/auth_utility.py --refresh
Or start new authentication: python {baseDir}/scripts/auth_utility.py --auth



Python import errors: If you see "ModuleNotFoundError":

Ensure virtual environment is activated
Run pip install -e . in {baseDir}/
Check Python path includes {baseDir}/src

### Debug Mode

To debug skill execution, add DEBUG=1 environment variable:

DEBUG=1 {baseDir}/bin/clawback.py status

This will show additional information about the execution context.

### Post-Installation Setup

After installation via ClawHub, the install.sh script runs automatically:

Python Environment Setup - Creates virtual environment
Package Installation - Installs ClawBack via pip
Directory Structure - Creates logs/, data/, config/ directories
Setup Prompt - Asks if you want to run the setup wizard

If you skip setup during installation, run it manually:

cd ~/.openclaw/skills/clawback
./setup.sh          # Interactive setup wizard
# or
clawback setup      # CLI-based setup

### Improved Setup Features

Better input handling - Works in both interactive and non-interactive modes
Input validation - Validates E*TRADE API key formats
Timeout handling - Automatically uses defaults if no input
Error recovery - Fallback to manual setup if CLI fails
Configuration check - Detects existing config and offers options

### Interactive Setup Wizard

The setup wizard guides you through configuration:

### Step 1: Environment Selection

Sandbox (recommended for testing): No real trades, uses E*TRADE developer sandbox
Production: Real trading with real money

### Step 2: E*TRADE API Credentials

Consumer Key: From E*TRADE developer portal
Consumer Secret: From E*TRADE developer portal

### Step 3: Authentication

Automatic OAuth flow with E*TRADE
Opens browser for authorization
Returns verification code

### Step 4: Account Selection

Lists all available E*TRADE accounts
Choose which account to trade with

### Step 5: Telegram Setup (Optional)

Configure notifications via Telegram bot
Uses OpenClaw's built-in Telegram channel if available

### Environment Variables

After setup, credentials are stored in .env:

# E*TRADE API (required)
BROKER_API_KEY=your_consumer_key_here
BROKER_API_SECRET=your_consumer_secret_here
BROKER_ACCOUNT_ID=your_account_id_here

# Telegram (optional)
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here

# FMP API (optional)
FMP_API_KEY=your_fmp_api_key_here

### Usage

# Use the installed CLI command
clawback run      # Start interactive trading mode
clawback daemon   # Run as background service
clawback status   # Check system status
clawback setup    # Re-run setup wizard
clawback test     # Test Telegram notifications

### Automated Trading

The clawback daemon command runs continuously with:

Disclosure checks at 10:00, 14:00, 18:00 ET (when filings are typically released)
Trade execution at 9:35 AM ET (5 min after market open)
Token refresh every 90 minutes (keeps E*TRADE session alive)
Market hours enforcement (9:30 AM - 4:00 PM ET)

### Data Sources

House Clerk: https://disclosures-clerk.house.gov (PDF parsing)
Senate eFD: https://efdsearch.senate.gov (web scraping)
Financial Modeling Prep: Enhanced financial data (optional)

### Supported Brokers

ClawBack currently only supports ETRADE. The adapter pattern allows for future broker support, but only ETRADE is implemented and tested.

BrokerAdapterStatusE*TRADEetrade_adapter.pySupported

### Risk Management

Position limits: 5% max per symbol, 20 positions max
Stop-losses: 8% per position, 15% portfolio drawdown
Daily limits: 3% max daily loss
PDT compliance: Conservative 2 trades/day limit

### Authentication Helpers

For manual E*TRADE authentication outside the main CLI:

# Standalone OAuth authentication script
cd {baseDir}
source venv/bin/activate
python scripts/auth_script.py

This generates an authorization URL, prompts for the verification code, and completes authentication.

### File Locations

FilePurpose~/.clawback/config.jsonMain configuration~/.clawback/.access_tokens.jsonE*TRADE OAuth tokens~/.clawback/data/trading.dbSQLite database

### Security

No hardcoded credentials in source code
Environment variable based configuration
Encrypted token storage for E*TRADE
Git-ignored .env file
Optional production encryption

### Support

Documentation: See README.md for detailed setup
Issues: https://github.com/mainfraame/clawback/issues
Community: https://discord.com/invite/clawd

### Disclaimer

Trading involves substantial risk of loss. This software is for educational purposes only. Past congressional trading performance does not guarantee future results. Always test with E*TRADE sandbox accounts before live trading.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: mainfraame
- Version: 1.1.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T12:15:15.587Z
- Expires at: 2026-05-07T12:15:15.587Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/clawback)
- [Send to Agent page](https://openagent3.xyz/skills/clawback/agent)
- [JSON manifest](https://openagent3.xyz/skills/clawback/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/clawback/agent.md)
- [Download page](https://openagent3.xyz/downloads/clawback)