Claude Code Repository Architecture Guide
A repo-specific conventions skill that teaches Claude the Claude Code CLI codebase layout, tool/command patterns, and naming rules.
What it does
Gives Claude a working mental model of the Claude Code CLI internals (TypeScript, Bun, React + Ink).
- Tables mapping ~30
src/directories to their roles (tools/,commands/,components/,coordinator/,memdir/, ...) - Startup sequence:
main.tsx→entrypoints/init.ts→cli.tsx→ MCP / Agent SDK modes - Copy-ready templates:
buildTool()tool definitions and the three command types (PromptCommand, LocalCommand, LocalJSXCommand) - Conventions for the permission system (default/plan/bypassPermissions/auto, wildcard rules like
Bash(git *)),bun:bundlefeature flags, Zod validation at boundaries, lazy imports for circular deps - Naming tables for files, components, types, hooks, and constants
Who it's for
- Developers hacking on the Claude Code CLI source or a fork of it
- Anyone studying a real-world Ink + Bun terminal app architecture
- Engineers learning how agent tool and slash-command registries are organized
Note: the
src/files it references are not bundled with the skill. Without that codebase it reads as reference documentation.
Usage examples
- "Add a
/changelogslash command" → scaffolds a PromptCommand insrc/commands/with properallowedToolsand registers it insrc/commands.ts. - "Create a file-deletion tool" → generates a
buildTool()skeleton implementingcheckPermissions()andisReadOnly(), withUI.tsxandprompt.tssplit out. - "Gate this experimental feature" → wraps it in
feature('...')frombun:bundleso it's dead-code-eliminated at build time.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/codeaashu/claude-code/HEAD/Skill.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the Skill.m folder from the GitHub repo codeaashu/claude-code into my ~/.claude/skills/claude-code-skill/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/codeaashu/claude-code.git /tmp/cc-skill && mkdir -p ~/.claude/skills/claude-code-skill && cp /tmp/cc-skill/Skill.md ~/.claude/skills/claude-code-skill/SKILL.md⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo to a temp folder:
git clone https://github.com/codeaashu/claude-code.git /tmp/cc-skill - Create the skill folder:
mkdir -p ~/.claude/skills/claude-code-skill - Copy the file in:
cp /tmp/cc-skill/Skill.md ~/.claude/skills/claude-code-skill/SKILL.md(the filename must beSKILL.md) - Restart Claude Code and run
/skillsto confirm it is listed. - Launch Claude Code inside the target codebase and ask something like "add a new tool following this repo's tool definition conventions".