cc-mirror
AGENTS.md2.3k starsChanged 6 months agoMITView on GitHub
Location: <bin-dir>/<variant> (macOS/Linux) or <bin-dir>/<variant>.cmd (Windows)
- Reads credentials
- Installs packages
Trending
Quiet since February.thin dataabout the whole repository
Who's talking about numman-ali/cc-mirror
- @sungkim.bsky.social“github.com/numman-ali/c...”Bluesky · Jan 5, 2026 · 5 likes
- A Hacker News story“Cc-Mirror”Hacker News · Jan 5, 2026 · 1 points
- six-ddc/ccbot“Support custom CLAUDE_CONFIG_DIR / projects path for Claude variants”GitHub · Feb 21, 2026
- subsy/ralph-tui“feat: add minimax and zai agent plugins”GitHub · Jan 20, 2026
The biggest 4 of 4 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 73
TypeScript + ESM: Use import/export, avoid CommonJS
- Very specific: line 76
New files: Place in relevant src/<area>/ folder
- Very specific: line 99
Default <bin-dir> is ~/.local/bin on macOS/Linux and ~/.cc-mirror/bin on Windows.
- Very specific: line 150
Only minimal mode supported (maximal deprecated)
- Very specific: line 231
Verify .claude.json has hasCompletedOnboarding + theme
- Distinctive: line 232
Run wrapper in TTY and confirm splash + no onboarding prompt
- Very specific: line 233
Use npx cc-mirror update test-zai to validate update flow
- Distinctive: line 268
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively.
- Distinctive: line 279
Only use skills listed in <available_skills> below
- Distinctive: line 280
Do not invoke a skill that is already loaded in your context
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Guidelines
Project Structure
src/
├── cli/ # CLI entrypoint and commands
│ ├── index.ts # Main CLI entry
│ ├── commands/ # create, update, remove, doctor, etc.
│ └── args.ts # Argument parsing
├── tui/ # Ink-based TUI wizard
│ ├── app.tsx # Main TUI application
│ ├── screens/ # Individual screen components
│ ├── components/ # Reusable UI components
│ ├── hooks/ # React hooks for business logic
│ ├── state/ # State types and management
│ └── router/ # Screen navigation
├── core/ # Core variant management
│ ├── index.ts # Public API (createVariant, updateVariant, etc.)
│ ├── variant-builder/ # Step-based variant creation
│ │ ├── VariantBuilder.ts
│ │ ├── VariantUpdater.ts
│ │ ├── steps/ # Build steps (PrepareDirectories, InstallNative, etc.)
│ │ └── update-steps/ # Update steps
│ ├── prompt-pack/ # System prompt overlays
│ │ ├── providers/ # Per-provider overlays (zai.ts, minimax.ts)
│ │ ├── overlays.ts # Overlay resolution
│ │ └── targets.ts # Target file mapping
│ └── *.ts # Utils (paths, fs, tweakcc, skills, etc.)
├── providers/ # Provider templates
│ └── index.ts # Provider definitions and defaults
├── brands/ # TweakCC brand presets
│ ├── index.ts # Brand resolution
│ ├── types.ts # TweakCC config types
│ ├── zai.ts # Z.ai theme + blocked tools
│ ├── minimax.ts # MiniMax theme + blocked tools
│ └── *.ts # Other brand configs
test/ # Node test runner tests
├── e2e/ # End-to-end tests
├── tui/ # TUI component tests
├── unit/ # Unit tests
└── helpers/ # Test utilities
repos/ # Upstream reference copies (vendor data, history)
├── anthropic-claude-code-*/ # Claude Code versions for comparison/reference
├── claude-code-system-prompts/ # System prompt changelog and sources
└── tweakcc/ # TweakCC repo (prompt patching tool)
notes/ # Research notes and deep dive documentation
├── CLI-VERSIONS.md # Version comparison notes
├── *-DEEP-DIVE.md # Feature research and analysis
└── RECONSTRUCTION-LEDGER.md # Project state and decisions
docs/ # User documentation
dist/ # Build output (generated)Build, Test, and Development Commands
npm install # Install dependencies
npm run dev # Run CLI from TypeScript sources
npm run tui # Launch TUI wizard
npm test # Run all tests
npm run typecheck # TypeScript check without emit
npm run bundle # Build dist/cc-mirror.mjs
npm run render:tui-svg # Regenerate docs/cc-mirror-tree.svgCoding Conventions
- TypeScript + ESM: Use
import/export, avoid CommonJS - Formatting: 2-space indent, single quotes, semicolons
- Tests: Name as
*.test.ts, place intest/mirroringsrc/structure - New files: Place in relevant
src/<area>/folder
Runtime Layout & Config Flow
Variant Directory Structure
~/.cc-mirror/<variant>/
├── config/
│ ├── settings.json # Env overrides (API keys, base URLs, model defaults)
│ ├── .claude.json # API-key approvals + onboarding/theme + MCP servers
├── tweakcc/
│ ├── config.json # Brand preset + theme list + toolsets
│ └── system-prompts/ # Prompt-pack overlays (after tweakcc apply)
├── native/
│ └── claude # Native Claude Code binary (or claude.exe on Windows)
└── variant.json # MetadataWrapper Script
Location: <bin-dir>/<variant> (macOS/Linux) or <bin-dir>/<variant>.cmd (Windows)
Default <bin-dir> is ~/.local/bin on macOS/Linux and ~/.cc-mirror/bin on Windows.
- Sets
CLAUDE_CONFIG_DIRto variant config - Loads
settings.jsoninto env at runtime - Shows provider splash ASCII art when TTY and
CC_MIRROR_SPLASH != 0 - Auto-update disable:
DISABLE_AUTOUPDATER=1in settings.json env
Provider Auth Modes
| Provider | Auth Mode | Key Variable |
| custom | API Key | ANTHROPIC_API_KEY |
| zai, minimax, kimi | Auth Token | ANTHROPIC_AUTH_TOKEN |
| openrouter, vercel, nanogpt, gatewayz | Auth Token | ANTHROPIC_AUTH_TOKEN |
| ollama | Auth Token | ANTHROPIC_AUTH_TOKEN + ANTHROPIC_API_KEY |
| ccrouter | Optional | placeholder token |
| mirror | None | user authenticates normally |
Model Mapping (env vars)
ANTHROPIC_DEFAULT_SONNET_MODELANTHROPIC_DEFAULT_OPUS_MODELANTHROPIC_DEFAULT_HAIKU_MODEL- Optional:
ANTHROPIC_SMALL_FAST_MODEL,ANTHROPIC_MODEL,CLAUDE_CODE_SUBAGENT_MODEL
Provider Blocked Tools
Providers block tools via settings.json permissions.deny entries (written during variant creation/update). Tool lists are defined in src/brands/*.ts.
zai blocked tools:
export const ZAI_BLOCKED_TOOLS = [
'mcp__4_5v_mcp__analyze_image', // Server-injected
'mcp__milk_tea_server__claim_milk_tea_coupon',
'mcp__web_reader__webReader',
'WebSearch', // Use zai-cli search
'WebFetch', // Use zai-cli read
];minimax blocked tools:
export const MINIMAX_BLOCKED_TOOLS = [
'WebSearch', // Use mcp__MiniMax__web_search
];Prompt Pack
- Only
minimalmode supported (maximal deprecated) - Per-provider overlays in
src/core/prompt-pack/providers/ - Applied to
tweakcc/system-prompts/via TweakCC - Overlays are sanitized to strip backticks (tweakcc template literal issue)
Common Development Tasks
| Task | Location |
| Add/update provider | src/providers/index.ts |
| Add/update brand theme | src/brands/*.ts |
| Add blocked tools | src/brands/zai.ts or minimax.ts → *_BLOCKED_TOOLS |
| Modify prompt pack overlays | src/core/prompt-pack/providers/*.ts |
| Add build step | src/core/variant-builder/steps/ |
| Add TUI screen | src/tui/screens/ + app.tsx + router/routes.ts |
Debugging & Verification
Config Inspection
# Variant config
cat ~/.cc-mirror/<variant>/config/settings.json
cat ~/.cc-mirror/<variant>/config/.claude.json
cat ~/.cc-mirror/<variant>/variant.json
# TweakCC config
cat ~/.cc-mirror/<variant>/tweakcc/config.json
# Wrapper script
cat <bin-dir>/<variant>Health Check
npx cc-mirror doctorReference Files
- Upstream CLI references:
repos/anthropic-claude-code-*/cli.js(multiple versions for comparison) - System prompt sources:
repos/claude-code-system-prompts/(includes CHANGELOG.md) - Research notes:
notes/(deep dives, version analysis, design decisions) - Applied prompts:
~/.cc-mirror/<variant>/tweakcc/system-prompts/ - Debug logs:
~/.cc-mirror/<variant>/config/debug/*.txt
CLI Feature Gates
# Native installs don't have cli.js on disk. Use tweakcc to unpack first:
npx tweakcc unpack /tmp/claude-code.js ~/.cc-mirror/<variant>/native/claude
rg "tengu_prompt_suggestion|promptSuggestionEnabled" /tmp/claude-code.js
# Check cached gates
cat ~/.cc-mirror/<variant>/config/.claude.json | jq '.statsig'ZAI CLI (for Z.ai variants)
# Available commands
npx zai-cli --help
npx zai-cli vision --help
npx zai-cli search --help
npx zai-cli read --help
npx zai-cli repo --help
# Examples
npx zai-cli search "React 19 new features" --count 5
npx zai-cli read https://docs.example.com/api
npx zai-cli vision analyze ./screenshot.png "What errors?"
npx zai-cli repo search facebook/react "server components"Requires Z_AI_API_KEY in environment.
Manual Debug Flow (Create Variant)
- Run:
npm run dev -- create --provider zai --name test-zai --api-key <key> - Verify
variant.jsonexists - Verify
.claude.jsonhashasCompletedOnboarding+theme - Run wrapper in TTY and confirm splash + no onboarding prompt
- Use
npx cc-mirror update test-zaito validate update flow
Testing
npm test # All tests
npm test -- --test-name-pattern="E2E" # E2E tests only
npm test -- --test-name-pattern="TUI" # TUI tests onlyKey test files:
test/e2e/creation.test.ts- Variant creation for all providerstest/e2e/blocked-tools.test.ts- Provider blocked toolstest/tui/*.test.tsx- TUI component tests
Architecture Notes
- Step-based builds: Each step is isolated, can be sync or async
- Build order: PrepareDirectories → InstallNative → WriteConfig → BrandTheme → Tweakcc → Wrapper → ShellEnv → SkillInstall → Finalize
Documentation
README.md- User-facing documentationDESIGN.md- Architecture design documentdocs/features/mirror-claude.md- Mirror provider guidedocs/architecture/overview.md- Architecture overviewdocs/RECONSTRUCTION-LEDGER.md- Current state + decisions
<skills_system priority="1">
Available Skills
<!-- SKILLS_TABLE_START --><usage>
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.How to use skills:
- Invoke:
npx openskills read <skill-name>(run in your shell)- For multiple:
npx openskills read skill-one,skill-two
- For multiple:
- The skill content will load with detailed instructions on how to complete the task
- Base directory provided in output for resolving bundled resources (references/, scripts/, assets/)
Usage notes:
- Only use skills listed in <available_skills> below
- Do not invoke a skill that is already loaded in your context
- Each skill invocation is stateless
</usage>
<available_skills>
<skill>
<name>open-source-maintainer</name>
<description>End-to-end GitHub repository maintenance for open-source projects. Use when asked to triage issues, review PRs, analyze contributor activity, generate maintenance reports, or maintain a repository. Triggers include "triage", "maintain", "review PRs", "analyze issues", "repo maintenance", "what needs attention", "open source maintenance", or any request to understand and act on GitHub issues/PRs. Supports human-in-the-loop workflows with persistent memory across sessions.</description>
<location>project</location>
</skill></available_skills>
<!-- SKILLS_TABLE_END --></skills_system>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

