claudeforcodex
Claude Code CLI configuration guide for Codex. Use when users ask about: claude code config, ~/.claude/settings.json, claude plugins, claude agents, claude skills, claude hooks, claude mcp servers, or integrating tools with Claude Code.
What this skill does
# Claude Code CLI Configuration Guide
Configure and extend Anthropic's Claude Code CLI for optimal development workflows.
## Quick Reference
| Task | Command/Location |
|------|------------------|
| Config file | `~/.claude/settings.json` |
| Project config | `.claude/settings.json` (in project root) |
| Plugins | `~/.claude/plugins/` or marketplace |
| Add MCP server | Edit `.mcp.json` or plugin |
| Skills location | Plugin `skills/` directories |
## Core Configuration
Edit `~/.claude/settings.json` for global settings:
```json
{
"permissions": {
"allow": ["Bash(*)", "Read(*)", "Write(*)"],
"deny": []
},
"env": {
"ANTHROPIC_API_KEY": "sk-..."
}
}
```
**Project-level:** Create `.claude/settings.json` in project root to override.
## Permission System
Claude Code uses explicit tool permissions:
```json
{
"permissions": {
"allow": [
"Bash(*)", // All bash commands
"Read(*)", // All file reads
"Write(~/projects/*)", // Write only in projects
"mcp:server_name:*" // All tools from MCP server
],
"deny": [
"Bash(rm -rf *)" // Block dangerous commands
]
}
}
```
**Permission patterns:**
- `Tool(*)` - Allow all uses of tool
- `Tool(/path/*)` - Allow with path prefix
- `mcp:server:tool` - Specific MCP tool
## Plugin System
Claude Code has two plugin patterns:
### Standalone Plugin (entire repo = one plugin)
```
my-plugin/
├── .claude-plugin/
│ └── plugin.json # Required for standalone
├── commands/
├── agents/
├── skills/
│ └── my-skill/
│ └── SKILL.md # ONE level deep only!
├── hooks/
└── .mcp.json
```
### Marketplace Plugin (repo contains multiple plugins)
```
my-marketplace/
├── .claude-plugin/
│ └── marketplace.json # Lists all plugins
└── plugins/
├── plugin-a/
│ ├── plugin.json # AT ROOT (not .claude-plugin/)
│ └── skills/
│ └── skill-name/
│ └── SKILL.md
└── plugin-b/
└── plugin.json
```
**Critical Rules:**
1. **Marketplace plugins:** `plugin.json` at plugin root, NOT in `.claude-plugin/`
2. **Skills ONE level deep:** `skills/name/SKILL.md` - NO `skills/a/skills/b/`
3. **No plugin.json per skill** - only one per plugin
4. **Explicit skills array** in marketplace.json (recommended)
**Install plugin:**
```bash
claude plugins add /path/to/plugin
claude plugins add https://github.com/user/plugin
# Install specific branch or tag (v2.0.28+)
claude plugins add https://github.com/user/plugin#develop
claude plugins add https://github.com/user/plugin#v1.0.0
```
**Team sharing:** Add to `.claude/settings.json`:
```json
{
"extraKnownMarketplaces": [
"https://github.com/company/plugins#stable"
]
}
```
## Commands (Slash Commands)
Create `commands/name.md`:
```markdown
---
description: Brief description for autocomplete
argument-hint: "[optional args]"
model: sonnet
allowed-tools:
- Bash
- Read
context: fork
hooks:
PostToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "${CLAUDE_PLUGIN_ROOT}/scripts/notify.sh"
---
# Command Name
Instructions Claude follows when user types /name
```
**Frontmatter fields:**
- `description` (required) - Help text (<60 chars)
- `argument-hint` - Document expected arguments
- `model` - Override model (opus/sonnet/haiku)
- `allowed-tools` - Restrict available tools (YAML list)
- `context: fork` - Run in forked sub-agent
- `agent` - Agent type for execution
- `hooks` - Command-scoped hooks
- `disable-model-invocation` - Prevent SlashCommand tool calls
**Invoke:** `/plugin-name:command-name` or `/command-name`
## Agents (Subagents)
Create `agents/name.md`:
```markdown
---
name: agent-name
description: "What this agent specializes in. Include trigger phrases."
model: sonnet
tools:
- Bash
- Read
- Write
- Edit
- Glob
- Grep
skills:
- skill-name
permissionMode: default
disallowedTools:
- WebSearch
hooks:
Stop:
- hooks:
- type: prompt
prompt: "Verify work is complete before stopping."
---
# Agent Name
System prompt and instructions for the agent.
```
**Frontmatter fields:**
- `name` (required) - Agent identifier (lowercase, hyphens)
- `description` (required) - When/why to use, include trigger phrases
- `model` - opus/sonnet/haiku (default: inherit)
- `tools` - Restrict available tools (YAML list, omit for all)
- `skills` - Auto-load specific skills
- `permissionMode` - default/acceptEdits/plan/bypassPermissions
- `disallowedTools` - Explicitly block tools
- `hooks` - Agent-scoped hooks (PreToolUse, PostToolUse, Stop)
**Invoke:** `claude --agent plugin-name:agent-name`
**Spawn from Claude:**
```
Task(subagent_type="plugin:agent", prompt="Do something")
```
## Skills (Auto-Knowledge)
Create `skills/name/SKILL.md`:
```markdown
---
name: skill-name
description: "When to trigger this skill. Be specific about keywords and contexts."
user-invocable: true
model: sonnet
context: fork
allowed-tools:
- Read
- Write
- Bash
hooks:
PostToolUse:
- matcher: "Write"
hooks:
- type: command
command: "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh"
---
# Skill Name
Knowledge and instructions loaded when skill triggers.
```
**Frontmatter fields:**
- `name` (required) - Skill identifier (lowercase, hyphens)
- `description` (required) - Trigger phrases and usage context
- `user-invocable` - Show in slash command menu (default: true)
- `model` - Override model (opus/sonnet/haiku)
- `context: fork` - Run in forked sub-agent
- `agent` - Agent type for execution
- `allowed-tools` - Restrict available tools (YAML list)
- `hooks` - Skill-scoped hooks
**Key features:**
- **Hot-reload** (v2.1.0+): Skills in `~/.claude/skills` or `.claude/skills` reload without restart
- **Unified with commands** (v2.1.3+): Skills visible in `/` menu by default
- **Progress display**: Tool uses shown while skill executes
**Critical:** Skills must be **ONE level deep**:
```
skills/
├── skill-a/ # ✅ Correct
│ └── SKILL.md
└── skill-b/ # ✅ Correct
└── SKILL.md
# ❌ WRONG - nested skills won't be discovered:
skills/
└── parent/
└── skills/ # Nesting breaks discovery!
└── child/
└── SKILL.md
```
**Note:** Skills auto-load based on conversation context matching the description.
## Hooks (Event Handlers)
Create `hooks/hooks.json` or define in component frontmatter:
```json
{
"hooks": {
"PostToolUse": [{
"matcher": "Write|Edit",
"hooks": [{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/lint.sh",
"timeout": 30000
}]
}],
"Stop": [{
"hooks": [{
"type": "prompt",
"prompt": "Verify all tests pass before stopping.",
"model": "haiku"
}]
}]
}
}
```
**Hook events:**
| Event | When | Special Features |
|-------|------|------------------|
| `PreToolUse` | Before tool execution | Can modify `updatedInput`, return `ask` |
| `PostToolUse` | After tool execution | Access `tool_use_id` |
| `PermissionRequest` | Permission dialog shown | Can auto-approve/deny |
| `UserPromptSubmit` | User submits prompt | `additionalContext` output |
| `Notification` | Notifications sent | Supports `matcher` values |
| `Stop` | Claude attempts to stop | Prompt-based hooks supported |
| `SubagentStop` | Subagent stops | `agent_id`, `agent_transcript_path` |
| `SubagentStart` | Subagent starts | - |
| `SessionStart` | Session begins | `agent_type` if `--agent` used |
| `SessionEnd` | Session ends | `systemMessage` supported |
| `PreCompact` | Before history compacted | - |
**Hook types:**
- `command` - Execute shell scripts
- `prompt` - LLM-driven evaluation (can specify `model`)
**Hook configuration:**
- `matcher` - Tool/event pattern (regex, `*` wildcard)
- `timeout` - Timeout in ms (default: 10 minutes)
- `once: true` - Run only once per session
- `model` - Model for prompt-based hooks
## MCP Server Integration
Create `.mcpRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.