Skip to content

ishaanman7898/FinClaude

Repository files navigation

FinClaude - Financial Skills Toolset for Claude

A comprehensive financial analysis and calculation toolset that Claude can use as a plugin. FinClaude provides 12 powerful financial tools covering portfolio management, budgeting, tax planning, investment analysis, retirement planning, and risk management.

Features

📊 Portfolio Management

  • Portfolio Metrics Calculator: Analyze portfolio composition, asset allocation, and gains/losses
  • Asset Allocation Analysis: Compare current vs target allocation with rebalancing recommendations
  • Risk Analysis: Calculate portfolio volatility, Sharpe ratio, beta, and Value at Risk

💰 Budgeting & Expense Tracking

  • Budget Planning: Create comprehensive budgets with savings goals and expense tracking
  • Expense Analysis: Analyze spending patterns, identify trends, and find cost-cutting opportunities

🧮 Tax Planning

  • Tax Calculator: Estimate federal income taxes, capital gains, and deductions
  • Tax-Loss Harvesting: Identify opportunities to offset capital gains with losses

💳 Loans & Mortgages

  • Loan Payment Calculator: Calculate payments, amortization schedules, and refinancing analysis

📈 Investment Analysis

  • Stock Analysis: Evaluate individual investments with valuation metrics and ratings
  • Dividend Analysis: Analyze dividend portfolios for yield, growth, and sustainability

🎯 Retirement Planning

  • Retirement Calculator: Project retirement savings, income needs, and longevity planning

💼 Financial Health

  • Net Worth Calculator: Calculate and track net worth over time

Installation

Via npm

npm install finclaude

Via GitHub

git clone https://github.com/ishaanman7898/FinClaude.git
cd finclaude
npm install

Quick Start

Basic Usage in Node.js

import FinClaude from 'finclaude';

// Get all available tools
const tools = FinClaude.getTools();
console.log(tools);

// Execute a tool
const result = await FinClaude.executeTool('calculate_portfolio_metrics', {
  holdings: [
    {
      symbol: 'AAPL',
      shares: 10,
      current_price: 150,
      purchase_price: 120,
      asset_class: 'stocks'
    },
    {
      symbol: 'BND',
      shares: 20,
      current_price: 80,
      purchase_price: 80,
      asset_class: 'bonds'
    }
  ],
  include_gains: true
});

console.log(result);

Using with Claude

To use FinClaude with Claude, provide the tools definition to Claude's API:

const tools = FinClaude.getTools();

// Pass to Claude API
const response = await claude.messages.create({
  model: "claude-3-5-sonnet-20241022",
  max_tokens: 4096,
  tools: tools,
  messages: [
    {
      role: "user",
      content: "Analyze my portfolio and recommend rebalancing"
    }
  ]
});

Available Tools

1. Portfolio Metrics Calculator

Calculates total portfolio value, asset allocation, and unrealized gains/losses.

Input:

{
  "holdings": [
    {
      "symbol": "AAPL",
      "shares": 10,
      "current_price": 150,
      "purchase_price": 120,
      "asset_class": "stocks"
    }
  ],
  "include_gains": true
}

Output:

{
  "summary": {
    "total_portfolio_value": 1500,
    "number_of_holdings": 1,
    "asset_classes": 1
  },
  "allocation": {
    "stocks": {
      "value": 1500,
      "percent": 100
    }
  },
  "holdings": [...],
  "gains": {
    "total_gain": 300,
    "total_cost_basis": 1200,
    "total_gain_percent": 25
  }
}

2. Asset Allocation Analysis

Compare current allocation to target and get rebalancing recommendations.

Input:

{
  "current_allocation": {
    "stocks": 70,
    "bonds": 20,
    "cash": 10
  },
  "target_allocation": {
    "stocks": 60,
    "bonds": 30,
    "cash": 10
  },
  "portfolio_value": 100000
}

3. Budget Planning

Create comprehensive budgets with expense categories and savings goals.

Input:

{
  "monthly_income": 5000,
  "expenses": {
    "housing": 1500,
    "utilities": 200,
    "food": 400,
    "transportation": 300,
    "insurance": 200,
    "debt_payments": 200,
    "entertainment": 150,
    "personal_care": 100,
    "education": 0,
    "miscellaneous": 100
  },
  "savings_goal_percent": 20
}

4. Tax Calculator

Estimate federal income taxes with capital gains and deductions.

Input:

{
  "gross_income": 100000,
  "capital_gains": [
    {
      "asset": "AAPL",
      "gain": 5000,
      "holding_period": "long_term"
    }
  ],
  "deductions": {
    "standard": 14600,
    "retirement_contributions": 7000
  },
  "filing_status": "single",
  "tax_year": 2024
}

5. Loan Payment Calculator

Calculate loan/mortgage payments and amortization schedules.

Input:

{
  "principal": 300000,
  "annual_interest_rate": 5.5,
  "loan_term_years": 30,
  "payment_frequency": "monthly",
  "extra_payments": 100,
  "calculate_amortization": false
}

6. Investment Analysis

Analyze individual stocks with valuation metrics and ratings.

Input:

{
  "ticker": "AAPL",
  "current_price": 150,
  "metrics": {
    "pe_ratio": 25,
    "dividend_yield": 0.5,
    "earnings_per_share": 6.05,
    "debt_to_equity": 0.3,
    "annual_revenue_growth": 8,
    "profit_margin": 25
  },
  "analysis_type": "balanced"
}

7. Retirement Calculator

Project retirement savings and income needs.

Input:

{
  "current_age": 35,
  "retirement_age": 65,
  "current_savings": 150000,
  "annual_contribution": 20000,
  "annual_expenses_retirement": 60000,
  "social_security_annual": 25000,
  "annual_return_rate": 7,
  "annual_inflation_rate": 3
}

8. Risk Analysis

Calculate portfolio risk metrics including volatility and VaR.

Input:

{
  "holdings": [
    {
      "symbol": "AAPL",
      "allocation_percent": 30,
      "historical_volatility": 28,
      "beta": 1.2
    },
    {
      "symbol": "BND",
      "allocation_percent": 70,
      "historical_volatility": 5,
      "beta": 0.3
    }
  ],
  "expected_return": 7,
  "risk_free_rate": 4,
  "confidence_level": 0.95
}

9. Tax-Loss Harvesting

Identify opportunities to offset capital gains with losses.

Input:

{
  "realized_gains": 10000,
  "holdings_with_losses": [
    {
      "symbol": "STOCK1",
      "purchase_price": 100,
      "current_price": 80,
      "shares": 50,
      "purchase_date": "2024-01-01"
    }
  ],
  "wash_sale_check": true
}

10. Net Worth Calculator

Calculate and analyze net worth.

Input:

{
  "assets": {
    "cash": 10000,
    "savings_accounts": 50000,
    "investment_accounts": 150000,
    "retirement_accounts": 200000,
    "real_estate": 400000,
    "vehicles": 30000
  },
  "liabilities": {
    "mortgages": 300000,
    "auto_loans": 20000,
    "credit_cards": 5000
  }
}

11. Dividend Analysis

Analyze dividend portfolios for yield and sustainability.

Input:

{
  "holdings": [
    {
      "symbol": "JNJ",
      "shares": 10,
      "current_price": 150,
      "annual_dividend_per_share": 6,
      "earnings_per_share": 9,
      "free_cash_flow_per_share": 12
    }
  ],
  "total_portfolio_value": 100000
}

12. Expense Analysis

Analyze spending patterns and trends.

Input:

{
  "transactions": [
    {
      "date": "2024-01-01",
      "amount": 50,
      "category": "groceries",
      "description": "Whole Foods"
    },
    {
      "date": "2024-01-02",
      "amount": 100,
      "category": "utilities",
      "description": "Electric Bill"
    }
  ],
  "time_period": "monthly",
  "identify_subscriptions": true
}

API Reference

getTools()

Returns all available tool definitions in Claude format.

const tools = FinClaude.getTools();

getTool(toolName)

Get a specific tool definition.

const tool = FinClaude.getTool('calculate_portfolio_metrics');

executeTool(toolName, input)

Execute a tool with given parameters.

const result = await FinClaude.executeTool('calculate_portfolio_metrics', {
  holdings: [...],
  include_gains: true
});

getToolNames()

Get list of all available tool names.

const names = FinClaude.getToolNames();

validateToolInput(toolName, input)

Validate input against tool schema.

const validation = FinClaude.validateToolInput('budget_planning', {
  monthly_income: 5000,
  expenses: {...}
});

Use Cases

Personal Finance Management

  • Track and analyze your investment portfolio
  • Plan budgets and monitor spending
  • Estimate retirement savings needs
  • Calculate net worth and financial health

Investment Analysis

  • Evaluate stock opportunities
  • Analyze dividend stocks
  • Assess portfolio risk
  • Identify rebalancing needs

Tax Planning

  • Estimate annual tax liability
  • Identify tax-loss harvesting opportunities
  • Plan charitable giving strategies

Debt Management

  • Calculate loan payments
  • Analyze refinancing opportunities
  • Create mortgage payoff plans
  • Assess debt-to-income ratios

Disclaimers

  • These tools provide estimates for educational and planning purposes
  • Tax calculations are simplified and may not reflect actual tax liability
  • Consult with tax professionals, financial advisors, and investment professionals for actual planning decisions
  • Past performance does not guarantee future results
  • All calculations assume consistent inputs and don't account for individual circumstances

Contributing

Contributions are welcome! Please submit issues and pull requests to the GitHub repository.

License

MIT License - see LICENSE file for details

Support

For issues, feature requests, or questions:

  • Open an issue on GitHub
  • Check existing documentation in this README

Roadmap

  • Support for cryptocurrency portfolio analysis
  • Advanced tax optimization strategies
  • Real-time market data integration
  • Multi-currency support
  • Estate planning tools
  • Insurance planning tools
  • College savings calculators
  • Option strategy analysis

FinClaude - Empowering financial decision-making with Claude

About

A financial toolset and skillset for Claude Code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors