Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/saladday/cc-switch-cli/agents-mdgit clone --depth 1 https://github.com/SaladDay/cc-switch-cliWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02537 | $0.02537 |
| Opus 5 | $0.01269 | $0.01269 |
| Sonnet 5 | $0.00507 | $0.00507 |
| Haiku 4.5 | $0.00254 | $0.00254 |
Grade B, and why
cc-switch-cli AGENTS.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- Claude: `~/.claude/settings.json`, `~/.claude.json`, `~/.claude/CLAUDE.md` Copies of this mod
1 near-identical copy found in the catalogue:
- cc-switch-cli CLAUDE.md — 98% identical, 4 lines differ
How it starts
The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
This file mirrors CLAUDE.md for Codex and other coding agents. Keep both files aligned when repository guidance changes.
Commands
The Rust crate lives in src-tauri/. Run Cargo commands from that directory unless a command explicitly targets repository-root assets or scripts.
cd src-tauri
cargo run # Run cc-switch in interactive mode
cargo run -- provider list # Run a specific CLI command
cargo run -- --app codex provider list # Run a command for a specific app
cargo run -- proxy show # Inspect proxy state
cargo run -- env tools # Check local CLI tools
cargo build --release # Build release binary at target/release/cc-switch
cargo fmt # Format Rust code
cargo fmt --check # Check formatting, matching CI
cargo clippy # Run lints
cargo test # Run all tests
cargo test provider_switch # Run tests whose names contain provider_switch
cargo test --test provider_commands # Run a single integration test target
cargo test --features test-hooks # Run tests with the test-hooks feature enabled
The repository pins Rust through src-tauri/rust-toolchain.toml to Rust 1.91.1 with rustfmt and clippy. CI currently runs cargo fmt --check for changes under src-tauri/**.
Project overview
CC-Switch CLI is a Rust command-line management tool for Claude Code, Codex, Gemini, OpenCode, Hermes, and OpenClaw. It manages provider configurations, MCP servers, prompts, skills, WebDAV sync, local proxy routes, failover, daemon/start flows, deep-link imports, workspace memory files, and environment checks.
The main crate is src-tauri/; the repository root contains docs, assets, install/update scripts, packaging metadata, and Nix files.
Key Rust entry points:
src/main.rsparses CLI arguments, initializes logging, creates startup state for most commands, and dispatches to command handlers.src/lib.rsdeclares crate modules and re-exports public types used by integration tests and command code.src/cli/mod.rsdefines the top-level Clap CLI, global--appflag, and command enum.src/cli/commands/contains direct command implementations for providers, MCP, prompts, skills, config/WebDAV, proxy, failover, Hermes, start, daemon, env, update, completions, and internal commands.src/commands/contains library command helpers that are not top-level Clap subcommands, including OpenClaw workspace file and daily memory operations.src/cli/interactive/andsrc/cli/tui/contain the interactive ratatui UI, runtime action handlers, forms, overlays, route state, and UI rendering.src/services/contains durable business logic used by commands and the TUI: providers, auth, MCP, prompts, skills, proxy, WebDAV sync, stream checks, speed tests, environment checks, visible apps, subscription/coding-plan quota checks, and state coordination.src/database/is the SQLite persistence layer.Databaseowns a mutex-wrapped rusqlite connection, schema creation/migration, backups, and DAO modules for providers, MCP, prompts, skills, settings, proxy state, stream checks, universal providers, and failover queues.src/app_config.rs,src/provider.rs, and app-specific config modules (claude_*,codex_config.rs,gemini_*,hermes_config.rs,opencode_config.rs,openclaw_config.rs) define the shared configuration model and live-file adapters for supported apps.src/deeplink/implements theccswitch://v1/import?...import protocol for provider resources and is exported throughlib.rsfor tests and callers.src/proxy/implements the local multi-app proxy with Axum handlers, request forwarding, provider routing/failover, provider-specific transformations, response/stream handling, usage logging, model mapping, cache/thinking rectifiers, circuit breaking, and metrics.src/daemon/implements the Unix supervisor daemon, IPC protocol, logging, pidfile, and restart support.src/store.rsdefinesAppState, which ties together the database, an in-memoryMultiAppConfigsnapshot, startup live-config imports/recovery, andProxyService.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 119 lines · 2,537 tokens per session scan B 821ef789e00f
cc-switch-cli AGENTS.md is an instructions file published in the GitHub repository SaladDay/cc-switch-cli (4,929 stars, last pushed 3d ago), licensed MIT. It adds 2,537 tokens to every session, about $0.0127 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.