Track Inflation Data with Claude Code Using FRED
Inflation affects everything from pricing strategies to salary adjustments to investment logic. If you’re building software that needs to account for inflation — or you just want to understand the trend while working — Claude Code can now pull CPI data directly from the Federal Reserve and analyze it in the same session.
Why This Matters
The Consumer Price Index (CPIAUCSL) is the standard measure of inflation in the US. It’s used in financial models, real estate tools, HR compensation calculators, and pricing engines. Developers working on any of these need actual CPI data, not approximations from training data.
Pulling CPI data manually means visiting the FRED website, downloading a CSV, cleaning it, and feeding it into your project. With AgentPatch’s FRED Series Data tool, Claude Code fetches it directly. You get structured metadata plus clean date/value observation pairs — ready to drop into a chart, a test fixture, or an analysis.
Setup
The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.
Install (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Example commands your agent will use:
ap search "web search"
ap run google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
Skill (Recommended)
Install the AgentPatch skill — it teaches Claude Code when to use AgentPatch and how to use the CLI:
/plugin marketplace add fullthom/agentpatch-claude-skill
/plugin install agentpatch@agentpatch
MCP Server (Alternative)
If you prefer raw MCP tool access instead of the skill:
claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard.
Example
You’re building an inflation-adjusted pricing feature and need to understand recent CPI trends. You tell Claude Code:
“Pull CPI data (CPIAUCSL) for the last 3 years, monthly. Calculate the year-over-year inflation rate for each month and flag any months where it exceeded 4%.”
Claude Code fetches the data and runs the analysis:
Fetching FRED series CPIAUCSL from 2023-02-01 to 2026-02-01, monthly...
Series: Consumer Price Index for All Urban Consumers
Units: Index 1982-1984=100
Frequency: Monthly
Seasonal Adjustment: Seasonally Adjusted
Got 36 observations. Year-over-year inflation rates:
Months exceeding 4%:
- Mar 2023: 5.0%
- Apr 2023: 4.9%
- May 2023: 4.1%
Inflation has been below 4% since June 2023. Recent trend:
- Dec 2025: 2.7%
- Jan 2026: 2.8%
The CPI index rose from 301.8 to 323.4 over the 3-year period.
I'll use these rates to build the inflation adjustment lookup table
in src/utils/inflation.ts and add the raw data to fixtures/cpi.json.
Claude Code pulled 36 months of real CPI data, calculated derived metrics, identified the threshold crossings you asked about, and generated code artifacts — all from a single prompt.
Wrapping Up
FRED Series Data through AgentPatch gives Claude Code access to the same inflation data that economists and analysts use. Pair it with fred-search to discover related series like PCE or core CPI. The same AgentPatch connection also provides web search, email, image generation, and every other tool on the marketplace. Explore at agentpatch.ai.