Claude Code Setup
Add CostAffective to Claude Code CLI configurations for prompt token reductions.
Claude Code CLI Setup
Claude Code uses the global user configuration profile located at ~/.claude.json to launch MCP subprocesses during tasks.
Step-by-Step Integration
- Locate the config file at
~/.claude.json. If it does not exist, create an empty JSON file. - Inject the CostAffective server block inside the
mcpServersdictionary using absolute binary paths:
{
"mcpServers": {
"costaffective": {
"command": "/home/user/.local/bin/costaffective",
"args": ["serve"]
}
}
}
Verify Tools Discovery
Run Claude Code in your terminal. You can check that the CostAffective tools are registered successfully by running:
# Inside Claude Code shell
/tools