A modular, version-controlled configuration for Claude Code with rules, agents, skills, hooks, and slash commands. Designed for academic researchers but adaptable to any workflow.
| Directory | Purpose | Loaded |
|---|---|---|
settings.json |
Permissions, env vars, hooks config | Session start |
CLAUDE.md |
Lightweight global instructions | Every message |
rules/ |
Path-specific rules (load conditionally) | When path matches |
agents/ |
Subagent definitions for delegation | On Agent tool call |
skills/ |
Domain knowledge, workflows | On /skill or auto-match |
commands/ |
Slash command definitions | On /command |
hooks/ |
Lifecycle scripts (pre-tool, post-error) | On events |
| File | Triggers On |
|---|---|
global.md |
Always loaded |
stata.md |
**/*.do, **/*.ado, **/*.dta |
python.md |
**/*.py, **/*.ipynb |
research.md |
**/analysis/**, **/*.tex |
gis.md |
**/*.shp, **/*.geojson, **/*.gpkg, **/*.tif |
data-work.md |
**/data/** |
directory-structure.md |
**/code/**, **/a/**, **/b/** |
writing.md |
Writing tasks |
r.md |
**/*.R, **/*.Rmd |
Includes domain-specific skill packs for: econometrics, quantitative spatial economics, scientific visualization, statistical analysis, web scraping, Google Earth Engine, Dask, SymPy, survey design, technical writing, content research, and more.
Subagent definitions for context-preserving delegation: quick-search, code-explainer, doc-summarizer, dependency-checker, data-profiler, git-helper, economics-researcher, data-scientist, python-pro, and more.
Slash commands for: email drafting (/write-mail), brainstorming (/brainstorm), statistical analysis (/stats), visualization (/viz), prompt engineering (/prompt), writing assistance (/write), and more.
~/.claude/ ~/claude-config/ (git repo)
├── settings.json ──────────────► settings.json
├── CLAUDE.md ──────────────────► CLAUDE.md
├── agents/ ────────────────────► agents/
├── commands/ ──────────────────► commands/
├── hooks/ ─────────────────────► hooks/
├── rules/ ─────────────────────► rules/
└── skills/ ────────────────────► skills/
All files in ~/.claude/ are symlinks to this repo. Edit here, commit, push. Changes take effect immediately.
- Claude Code CLI installed
- Git configured
# Clone this repo
git clone https://github.com/sankalpsharmaa/claude-config-public.git ~/claude-config
# Backup existing config if any
[ -d ~/.claude ] && mv ~/.claude ~/.claude.backup
mkdir -p ~/.claude
# Create symlinks
ln -sf ~/claude-config/settings.json ~/.claude/settings.json
ln -sf ~/claude-config/CLAUDE.md ~/.claude/CLAUDE.md
ln -sf ~/claude-config/agents ~/.claude/agents
ln -sf ~/claude-config/commands ~/.claude/commands
ln -sf ~/claude-config/hooks ~/.claude/hooks
ln -sf ~/claude-config/rules ~/.claude/rules
ln -sf ~/claude-config/skills ~/.claude/skills
# Make hooks executable
chmod +x ~/claude-config/hooks/*git clone https://github.com/sankalpsharmaa/claude-config-public.git ~/claude-config && \
mkdir -p ~/.claude && \
ln -sf ~/claude-config/settings.json ~/.claude/settings.json && \
ln -sf ~/claude-config/CLAUDE.md ~/.claude/CLAUDE.md && \
ln -sf ~/claude-config/agents ~/.claude/agents && \
ln -sf ~/claude-config/commands ~/.claude/commands && \
ln -sf ~/claude-config/hooks ~/.claude/hooks && \
ln -sf ~/claude-config/rules ~/.claude/rules && \
ln -sf ~/claude-config/skills ~/.claude/skills && \
chmod +x ~/claude-config/hooks/*This config is opinionated and built for econometric research workflows. To adapt it:
settings.json: Edit permissions, add your own allow/deny rulesrules/global.md: Adjust banned phrases, output limits, agent routing tablesrules/: Add or modify path-specific rules for your file typescommands/write-mail.md: The email drafting command uses[YOUR_NAME],[YOUR_WEBSITE], etc. placeholders. Replace these with your actual info in the reference files undercommands/write-mail-references/skills/: Add domain-specific skills for your field
The settings.json includes a hook that pulls latest changes on every Claude Code session:
{
"hooks": {
"SessionStart": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "cd ~/claude-config && git pull --quiet 2>/dev/null || true"
}]
}]
}
}| Hook | Purpose |
|---|---|
pre-bash |
Safety checks on dangerous commands |
pre-edit / pre-write |
File modification guards |
post-python-edit |
Auto-runs ruff format + ruff check --fix |
post-latex-edit.sh |
LaTeX post-processing |
post-tool-error |
Error logging |
notify |
Desktop notifications |
lib/utils.sh |
Shared utilities (ripgrep support, block() helper) |
Recommended tools for full functionality:
brew install ripgrep ruffThis configuration is shared as a reference. Use and adapt freely.