ccs-delegation
Skill2.9k starsChanged 13 months agoMITView on GitHub
Auto-activate CCS CLI delegation for deterministic tasks. Parses user input, auto-selects optimal profile (glm/kimi/custom) from ~/.ccs/config.json, enhances prompts with context, executes via `ccs {profile} -p "task"` or `ccs {profile}:continue`, and reports results. Triggers on "use ccs [task]" patterns, typo/test/refactor keywords. Excludes complex architecture, security-critical code, performance optimization, breaking changes.
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about kaitranntt/ccs
- AutoMaker-Org/automaker“Feature Request: Add CCS and CLIProxyAPI for Multi-Provider AI Support”GitHub · Jan 12, 2026 · 3 reactions
- @tom-doerr.bsky.social“https://github.com/kaitranntt/ccs”Bluesky · Jun 14, 2026 · 1 likes
- jellydn/my-ai-tools“Refactor README: collapsible sections, verified links, and expanded Claude Code”GitHub · Jan 29, 2026 · 1 reactions
- A Hacker News story“Show HN: CCS - Switch between multiple Claude accounts and AI models instantly”Hacker News · Dec 17, 2025 · 1 points
- sudosubin/agents.nix“agent-skills.github.kaitranntt.ccs: init at 8.10.0”GitHub · Sep 28, 2026
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub, Hacker News and Bluesky (11 times).
On GitHub · 9
- Jan 12, 2026Feature Request: Add CCS and CLIProxyAPI for Multi-Provider AI Support — AutoMaker-Org/automaker3 reactions · 5 comments
- Jan 29, 2026Refactor README: collapsible sections, verified links, and expanded Claude Code — jellydn/my-ai-tools1 reaction · 2 comments
- Sep 28, 2026agent-skills.github.kaitranntt.ccs: init at 8.10.0 — sudosubin/agents.nix0 reactions
- Sep 22, 2026feat(routing): ordered cross-model fallback chain on 402/429 exhaustion (codex -> grok -> claude) — kaitranntt/CLIProxyAPIPlus0 reactions
- Aug 21, 2026sync for customized folder to support switch among accounts — tawanorg/claude-sync0 reactions
4 more on GitHub
- Apr 4, 2026add CCS (Claude Code Switch) integration for multi-profile support — raine/claude-history0 reactions
- Mar 13, 2026Support for Claude Code Switcher — titeya/dms-claudecode0 reactions · 3 comments
- Feb 12, 2026Base Command Override does not work on Windows — BloopAI/vibe-kanban0 reactions
- Jan 15, 2026WebSearch 过滤能不能加个配置项? — justlovemaki/AIClient2API0 reactions · 4 comments
On Hacker News · 1
On Bluesky · 1
- Jun 14, 2026https://github.com/kaitranntt/ccs — @tom-doerr.bsky.social1 likes and repost
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
If match: profile = match[1], remove flag from task, skip to step 5
- Distinctive: line 49
If no match: continue to step 2
- Very specific: line 52
Read ~/.ccs/config.json using Read tool
- Distinctive: line 54
If file missing → Error: "CCS not configured.
- Very specific: line 55
If empty → Error: "No profiles in config.json"
- Very specific: line 65
If needsReasoning: filter profiles where reasoning=true → prefer kimi
- Very specific: line 69
If filteredProfiles.length === 0: fallback to glm if exists, else first available
- Distinctive: line 70
If no profiles: Error
- Distinctive: line 73
If task mentions files: gather context using Read tool
- Distinctive: line 74
Add: file paths, current implementation, expected behavior, success criteria
- Very specific: line 78
Run: ccs {selectedProfile} -p "$enhancedPrompt" via Bash tool
- Distinctive: line 90
If no sessions → Error: "No previous delegation.
- Very specific: line 94
If match: profile = match[1], remove flag from follow-up, log profile switch
- Distinctive: line 95
If no match: use detected profile from step 1
- Distinctive: line 99
Add: previous context, incomplete tasks, validation criteria
- Distinctive: line 113
No discussion/decisions needed
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
CCS Delegation
Delegate deterministic tasks to cost-optimized models via CCS CLI.
Core Concept
Execute tasks via alternative models using:
- Initial delegation:
ccs {profile} -p "task" - Session continuation:
ccs {profile}:continue -p "follow-up"
Profile Selection:
- Auto-select from
~/.ccs/config.jsonvia task analysis - Profiles: glm (cost-optimized), kimi (long-context/reasoning), custom profiles
- Override:
--{profile}flag forces specific profile
User Invocation Patterns
Users trigger delegation naturally:
- "use ccs [task]" - Auto-select best profile
- "use ccs --glm [task]" - Force GLM profile
- "use ccs --kimi [task]" - Force Kimi profile
- "use ccs:continue [task]" - Continue last session
Examples:
- "use ccs to fix typos in README.md"
- "use ccs to analyze the entire architecture"
- "use ccs --glm to add unit tests"
- "use ccs:continue to commit the changes"
Agent Response Protocol
For /ccs [task]:
- Parse override flag
- Scan task for pattern:
--(\w+) - If match:
profile = match[1], remove flag from task, skip to step 5 - If no match: continue to step 2
- Scan task for pattern:
- Discover profiles
- Read
~/.ccs/config.jsonusing Read tool - Extract
Object.keys(config.profiles)→availableProfiles[] - If file missing → Error: "CCS not configured. Run: ccs doctor"
- If empty → Error: "No profiles in config.json"
- Read
- Analyze task requirements
- Scan task for keywords:
/(think|analyze|reason|debug|investigate|evaluate)/i→needsReasoning = true/(architecture|entire|all files|codebase|analyze all)/i→needsLongContext = true/(typo|test|refactor|update|fix)/i→preferCostOptimized = true
- Scan task for keywords:
- Select profile
- For each profile in
availableProfiles: classify by name pattern (see Profile Characteristic Inference table) - If
needsReasoning: filter profiles wherereasoning=true→ prefer kimi - Else if
needsLongContext: filter profiles wherecontext=long→ prefer kimi - Else: filter profiles where
cost=low→ prefer glm selectedProfile = filteredProfiles[0]- If
filteredProfiles.length === 0: fallback toglmif exists, else first available - If no profiles: Error
- For each profile in
- Enhance prompt
- If task mentions files: gather context using Read tool
- Add: file paths, current implementation, expected behavior, success criteria
- Preserve slash commands at task start (e.g.,
/cook,/commit)
- Execute delegation
- Run:
ccs {selectedProfile} -p "$enhancedPrompt"via Bash tool
- Run:
- Report results
- Log: "Selected {profile} (reason: {reasoning/long-context/cost-optimized})"
- Report: Cost (USD), Duration (sec), Session ID, Exit code
For /ccs:continue [follow-up]:
- Detect profile
- Read
~/.ccs/delegation-sessions.jsonusing Read tool - Find most recent session (latest timestamp)
- Extract profile name from session data
- If no sessions → Error: "No previous delegation. Use /ccs first"
- Read
- Parse override flag
- Scan follow-up for pattern:
--(\w+) - If match:
profile = match[1], remove flag from follow-up, log profile switch - If no match: use detected profile from step 1
- Scan follow-up for pattern:
- Enhance prompt
- Review previous work (check what was accomplished)
- Add: previous context, incomplete tasks, validation criteria
- Preserve slash commands at start
- Execute continuation
- Run:
ccs {profile}:continue -p "$enhancedPrompt"via Bash tool
- Run:
- Report results
- Report: Profile, Session #, Incremental cost, Total cost, Duration, Exit code
Decision Framework
Delegate when:
- Simple refactoring, tests, typos, documentation
- Deterministic, well-defined scope
- No discussion/decisions needed
Keep in main when:
- Architecture/design decisions
- Security-critical code
- Complex debugging requiring investigation
- Performance optimization
- Breaking changes/migrations
Profile Selection Logic
Task Analysis Keywords (scan task string with regex):
| Pattern | Variable | Example |
/(think|analyze|reason|debug|investigate|evaluate)/i | needsReasoning = true | "think about caching" |
/(architecture|entire|all files|codebase|analyze all)/i | needsLongContext = true | "analyze all files" |
/(typo|test|refactor|update|fix)/i | preferCostOptimized = true | "fix typo in README" |
Profile Characteristic Inference (classify by name pattern):
| Profile Pattern | Cost | Context | Reasoning |
/^glm/i | low | standard | false |
/^kimi/i | medium | long | true |
/^claude/i | high | standard | false |
| others | low | standard | false |
Selection Algorithm (apply filters sequentially):
profiles = Object.keys(config.profiles)
classified = profiles.map(p => ({name: p, ...inferCharacteristics(p)}))
if (needsReasoning):
filtered = classified.filter(p => p.reasoning === true).sort(['kimi'])
else if (needsLongContext):
filtered = classified.filter(p => p.context === 'long').sort(['kimi'])
else:
filtered = classified.filter(p => p.cost === 'low').sort(['glm', ...])
selected = filtered[0] || profiles.find(p => p === 'glm') || profiles[0]
if (!selected): throw Error("No profiles configured")
log("Selected {selected} (reason: {reasoning|long-context|cost-optimized})")Override Logic:
- Parse task for
/--(\w+)/. If match:profile = match[1], remove from task, skip selection
Example Delegation Tasks
Good candidates:
- "/ccs add unit tests for UserService using Jest" → Auto-selects: glm (simple task)
- "/ccs analyze entire architecture in src/" → Auto-selects: kimi (long-context)
- "/ccs think about the best database schema design" → Auto-selects: kimi (reasoning)
- "/ccs --glm refactor parseConfig to use destructuring" → Forces: glm (override)
Bad candidates (keep in main):
- "implement OAuth" (too complex, needs design)
- "improve performance" (requires profiling)
- "fix the bug" (needs investigation)
Execution
Commands:
/ccs "task"- Intelligent delegation (auto-select profile)/ccs --{profile} "task"- Force specific profile/ccs:continue "follow-up"- Continue last session (auto-detect profile)/ccs:continue --{profile} "follow-up"- Continue with profile switch
Agent via Bash:
- Auto:
ccs {auto-selected} -p "task" - Continue:
ccs {detected}:continue -p "follow-up"
References
Template: CLAUDE.md.template - Copy to user's CLAUDE.md for auto-delegation config
Troubleshooting: references/troubleshooting.md
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.

