claude-code-skill
Skill0 starsChanged 8 months agoMITView on GitHub
Development conventions and architecture guide for the Claude Code CLI repository.
- Reads credentials
25 other projects use a version of this.
Adopted by
Most recently taken up by
- LTY711/claude-code-leakword for word, first seen Apr 7, 2026
- mowgly11/claude-codeword for word, first seen Apr 3, 2026
- StanHus/claude-code-srcword for word, first seen Apr 2, 2026
- Isometrical-selection572/claude_code_cliword for word, first seen Apr 1, 2026
- TaGoat/claude_code_cliword for word, first seen Apr 1, 2026
- el1ght/claude-codeword for word, first seen Mar 31, 2026
Other versions25 projects use a version of this.
Word for word · 25
- codeaashu/claude-code★ 3.4k100% same
- 777genius/claude-code-source-code-full★ 412100% same
- TaGoat/claude_code_cli★ 105100% same
- Silin144/claude-code★ 16100% same
- el1ght/claude-code★ 2100% same
- ermultimidia/freecode★ 2100% same
- Candicezsss/claude-code★ 1100% same
- DebojyotiMishra/claude-code★ 1100% same
- devonte5stars11/claude-code★ 1100% same
- fotechv/claude-code★ 1100% same
15 more not listed
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 211
Read relevant source files before making changes — understand existing patterns first.
- Very specific: line 212
Follow the tool/command/component patterns above when adding new ones.
- Distinctive: line 213
Keep edits minimal and focused — avoid unnecessary refactoring.
- Distinctive: line 214
Use Zod for all input validation at system boundaries.
- Distinctive: line 217
Use lazy imports when adding dependencies that could create circular references.
- Distinctive: line 218
Update this file as project conventions evolve.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Claude Code — Repository Skill
Project Overview
Claude Code is Anthropic's CLI tool for interacting with Claude from the terminal. It supports file editing, shell commands, git workflows, code review, multi-agent coordination, IDE integration (VS Code, JetBrains), and Model Context Protocol (MCP).
Codebase: ~1,900 files, 512,000+ lines of TypeScript under src/.
Tech Stack
| Component | Technology |
| Language | TypeScript (strict mode, ES modules) |
| Runtime | Bun (JSX support, bun:bundle feature flags) |
| Terminal UI | React + Ink (React for CLI) |
| CLI Parser | Commander.js (@commander-js/extra-typings) |
| API Client | @anthropic-ai/sdk |
| Validation | Zod v4 |
| Linter/Formatter | Biome |
| Analytics | GrowthBook (feature flags & A/B testing) |
| Protocol | Model Context Protocol (MCP) |
Architecture
Directory Map (src/)
| Directory | Purpose |
commands/ | ~50 slash commands (/commit, /review, /config, etc.) |
tools/ | ~40 agent tools (Bash, FileRead, FileWrite, Glob, Grep, etc.) |
components/ | ~140 Ink/React UI components for terminal rendering |
services/ | External integrations (API, OAuth, MCP, LSP, analytics, plugins) |
bridge/ | Bidirectional IDE communication layer |
state/ | React context + custom store (AppState) |
hooks/ | React hooks (permissions, keybindings, commands, settings) |
types/ | TypeScript type definitions |
utils/ | Utilities (shell, file ops, permissions, config, git) |
screens/ | Full-screen UIs (Doctor, REPL, Resume, Compact) |
skills/ | Bundled skills + skill loader system |
plugins/ | Plugin system (marketplace + bundled plugins) |
coordinator/ | Multi-agent coordination & supervisor logic |
tasks/ | Task management (shell tasks, agent tasks, teammates) |
context/ | React context providers (notifications, stats, FPS) |
memdir/ | Persistent memory system (CLAUDE.md, user/project memory) |
entrypoints/ | Initialization logic, Agent SDK, MCP entry |
voice/ | Voice input/output (STT, keyterms) |
vim/ | Vim mode keybinding support |
schemas/ | Zod configuration schemas |
keybindings/ | Keybinding configuration & resolver |
migrations/ | Config migrations between versions |
outputStyles/ | Output formatting & theming |
query/ | Query pipeline & processing |
server/ | Server/daemon mode |
remote/ | Remote session handling |
Key Files
| File | Role |
src/main.tsx | CLI entry point (Commander parser, startup profiling) |
src/QueryEngine.ts | Core LLM API caller (streaming, tool-call loops) |
src/Tool.ts | Tool type definitions & buildTool factory |
src/tools.ts | Tool registry & presets |
src/commands.ts | Command registry |
src/context.ts | System/user context collection (git status, memory) |
src/cost-tracker.ts | Token cost tracking |
Entry Points & Initialization Sequence
src/main.tsx— Commander CLI parser, startup profilingsrc/entrypoints/init.ts— Config, telemetry, OAuth, MDMsrc/entrypoints/cli.tsx— CLI session orchestrationsrc/entrypoints/mcp.ts— MCP server modesrc/entrypoints/sdk/— Agent SDK (programmatic API)src/replLauncher.tsx— REPL session launcher
Startup performs parallel initialization: MDM policy reads, Keychain prefetch, feature flag checks, then core init.
Patterns & Conventions
Tool Definition
Each tool lives in src/tools/{ToolName}/ and uses buildTool:
export const MyTool = buildTool({
name: 'MyTool',
aliases: ['my_tool'],
description: 'What this tool does',
inputSchema: z.object({
param: z.string(),
}),
async call(args, context, canUseTool, parentMessage, onProgress) {
// Execute and return { data: result, newMessages?: [...] }
},
async checkPermissions(input, context) { /* Permission checks */ },
isConcurrencySafe(input) { /* Can run in parallel? */ },
isReadOnly(input) { /* Non-destructive? */ },
prompt(options) { /* System prompt injection */ },
renderToolUseMessage(input, options) { /* UI for invocation */ },
renderToolResultMessage(content, progressMessages, options) { /* UI for result */ },
})Directory structure per tool: {ToolName}.ts or .tsx (main), UI.tsx (rendering), prompt.ts (system prompt), plus utility files.
Command Definition
Commands live in src/commands/ and follow three types:
- PromptCommand — Sends a formatted prompt with injected tools (most commands)
- LocalCommand — Runs in-process, returns text
- LocalJSXCommand — Runs in-process, returns React JSX
const command = {
type: 'prompt',
name: 'my-command',
description: 'What this command does',
progressMessage: 'working...',
allowedTools: ['Bash(git *)', 'FileRead(*)'],
source: 'builtin',
async getPromptForCommand(args, context) {
return [{ type: 'text', text: '...' }]
},
} satisfies CommandCommands are registered in src/commands.ts and invoked via /command-name in the REPL.
Component Structure
- Functional React components with Ink primitives (
Box,Text,useInput()) - Styled with Chalk for terminal colors
- React Compiler for optimized re-renders
- Design system primitives in
src/components/design-system/
State Management
AppStatevia React context + custom store (src/state/AppStateStore.ts)- Mutable state object passed to tool contexts
- Selector functions for derived state
- Change observers in
src/state/onChangeAppState.ts
Permission System
- Modes:
default(prompt per operation),plan(show plan, ask once),bypassPermissions(auto-approve),auto(ML classifier) - Rules: Wildcard patterns —
Bash(git *),FileEdit(/src/*) - Tools implement
checkPermissions()returning{ granted: boolean, reason?, prompt? }
Feature Flags & Build
Bun's bun:bundle feature flags enable dead-code elimination at build time:
import { feature } from 'bun:bundle'
if (feature('PROACTIVE')) { /* proactive agent tools */ }Notable flags: PROACTIVE, KAIROS, BRIDGE_MODE, VOICE_MODE, COORDINATOR_MODE, DAEMON, WORKFLOW_SCRIPTS.
Some features are also gated via process.env.USER_TYPE === 'ant'.
Naming Conventions
| Element | Convention | Example |
| Files | PascalCase (exports) or kebab-case (commands) | BashTool.tsx, commit-push-pr.ts |
| Components | PascalCase | App.tsx, PromptInput.tsx |
| Types | PascalCase, suffix with Props/State/Context | ToolUseContext |
| Hooks | use prefix | useCanUseTool, useSettings |
| Constants | SCREAMING_SNAKE_CASE | MAX_TOKENS, DEFAULT_TIMEOUT_MS |
Import Practices
- ES modules with
.jsextensions (Bun convention) - Lazy imports for circular dependency breaking:
const getModule = () => require('./heavy.js') - Conditional imports via feature flags or
process.env biome-ignoremarkers for manual import ordering where needed
Services
| Service | Path | Purpose |
| API | services/api/ | Anthropic SDK client, file uploads |
| MCP | services/mcp/ | MCP client, tool/resource discovery |
| OAuth | services/oauth/ | OAuth 2.0 auth flow |
| LSP | services/lsp/ | Language Server Protocol manager |
| Analytics | services/analytics/ | GrowthBook, telemetry, events |
| Plugins | services/plugins/ | Plugin loader, marketplace |
| Compact | services/compact/ | Context compression |
| Policy Limits | services/policyLimits/ | Org rate limits, quota checking |
| Remote Settings | services/remoteManagedSettings/ | Managed settings sync (Enterprise) |
| Token Estimation | services/tokenEstimation.ts | Token count estimation |
Configuration
Settings locations:
- Global:
~/.claude/config.json,~/.claude/settings.json - Project:
.claude/config.json,.claude/settings.json - System: macOS Keychain + MDM, Windows Registry + MDM
- Managed: Remote sync for Enterprise users
Guidelines
- Read relevant source files before making changes — understand existing patterns first.
- Follow the tool/command/component patterns above when adding new ones.
- Keep edits minimal and focused — avoid unnecessary refactoring.
- Use Zod for all input validation at system boundaries.
- Gate experimental features behind
bun:bundlefeature flags or env checks. - Respect the permission system — tools that modify state must implement
checkPermissions(). - Use lazy imports when adding dependencies that could create circular references.
- Update this file as project conventions evolve.
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.

