$ show Alishahryar1/free-claude-code
free-claude-code is a local proxy and developer tool that connects coding agents (Claude Code and similar harnesses) to OpenAI-compatible AI providers. It is a Python package (`free_claude_code`) with a CLI, a local API server, an admin web UI, and a substantial configuration subsystem. The system abstracts over a dozen AI providers (including NVIDIA NIM, Cloudflare, HuggingFace, and others) with provider-specific workarounds for tool parameter aliasing, thinking templates, and reasoning replay. It persists sessions, messages, and model metadata in SQLite, manages a tree-based conversation model with Telegram platform support, and renders transcripts with segment-based truncation and subagent state management. The repo is a shipped developer tool with installer/update scripts, GitHub issue templates, dependabot config, and a diagnostic `fcc-doctor` command; it is not a research or data project.
The LLM identified 5 files worth highlighting for reuse:
Declarative old-key → new-key environment variable migration system. The `EnvMigration` dataclass supports value maps and prefix maps (e.g., boolean → client/off reasoning policy, opencode/ → opencode_zen/ model refs). It refuses to rename a key if the new key is already defined, consolidates legacy dotenv state into a managed ~/.fcc/.env file, and enforces a hardcoded schema version. This is a clean, self-contained pattern for any Python tool that needs safe, idempotent config migration across releases.
Client environment helper that merges NO_PROXY settings and scrubs environment variables by prefix before forwarding to subprocesses or provider calls. Reused across all launchers, it solves the recurring problem of leaking host environment variables into sandboxed or proxied tool invocations. The prefix-based scrubbing and NO_PROXY merging are generic enough to extract into any Python project that shells out to external tools.
`extract_openai_model_infos` parses model listings from heterogeneous provider APIs using configurable field paths. This isolates the provider-agnostic model-catalog logic from provider-specific response shapes, making it reusable for any OpenAI-compatible gateway that must normalize model metadata from multiple upstreams.
HTTP-based web_search/web_fetch client with DNS-pinned egress validation. The DNS-pinning check prevents SSRF-style rebinding attacks when fetching user-supplied URLs, a non-obvious security pattern worth copying in any tool that performs server-side fetches on behalf of users.
Structured smoke-test reporting framework that writes JSON reports and classifies outcomes into `passed`, `missing_env`, `upstream_unavailable`, `product_failure`, and `harness_bug`. This taxonomy cleanly separates environment problems from product regressions, a reusable pattern for any integration test suite that depends on live third-party services.