One-command Claude Code optimization for any machine. Installs a production-grade configuration that turns Claude into a Staff/Principal engineer persona — with strict code quality, security, observability standards, and an Obsidian-powered persistent brain that grows smarter with every session.
Any edits you make to ~/.claude files are automatically committed and pushed to your own fork — your config stays in sync across every machine.
Click Fork on GitHub so you have your own copy to sync to.
This is important. The auto-sync hook pushes your
~/.claudechanges toorigin/main. If you clone this repo directly (without forking), you won't be able to push.
git clone https://github.com/YOUR_USERNAME/claude-setup.git ~/claude-setup
cd ~/claude-setup && ./setup.shRequires: bash 3.2+, python3
- Open Obsidian → Open folder as vault → select
~/Documents/Obsidian - Settings → Community Plugins → install Local REST API → enable it
- Open Graph View (
Ctrl+G) to explore your growing knowledge base
That's it. Restart Claude Code and everything is active.
Claude uses ~/Documents/Obsidian/Claude Brain/ as a persistent knowledge vault. Every session, Claude can read from it and write to it — so the more it works, the more it knows.
Claude solves a non-obvious problem
↓
/brain-sync (or automatic on session end)
↓
Claude writes a structured note to the vault
(Skill / Pattern / Debug solution / Project map)
↓
Note appears in Obsidian with tags + links
↓
Next session: Claude reads it before starting similar work
~/Documents/Obsidian/Claude Brain/
Index.md ← master index with quick links
Skills/
Skills Index.md ← all learned techniques
<technique>.md
Patterns/
Patterns Index.md ← architecture patterns from real projects
<pattern>.md
Debugging/
Debugging Index.md ← root causes + fixes for non-obvious bugs
<bug-name>.md
Projects/
Projects Index.md ← per-project structure, decisions, conventions
<project-name>.md
Templates/
Skill Note.md
Pattern Note.md
Debug Note.md
Project Note.md
Type /brain-sync in Claude Code at any time. Claude will review the session, identify what's worth capturing, and write structured notes to the vault.
After setup, every time Claude edits a managed ~/.claude file:
Edit ~/.claude/CLAUDE.md (or any managed file)
↓
PostToolUse hook fires
↓
File copied → ~/claude-setup/claude/
↓
git commit + git push (background, non-blocking)
↓
Your fork on GitHub is updated automatically
git clone https://github.com/YOUR_USERNAME/claude-setup.git ~/claude-setup
cd ~/claude-setup && ./setup.shYour entire config — including the Obsidian vault structure — is restored instantly.
| Path | Purpose |
|---|---|
CLAUDE.md |
Core architect mindset: SOLID, Clean Architecture, error handling, security, testing strategy, API design, performance defaults, Obsidian Brain instructions |
rules/architecture.md |
Layer separation, file organization, module rules, API design |
rules/code-quality.md |
Type safety, naming, function design, error handling, immutability |
rules/security.md |
OWASP Top 10, auth, secrets management, input validation |
rules/testing.md |
70/20/10 pyramid, AAA pattern, integration test isolation |
rules/observability.md |
Structured logging, distributed tracing, USE metrics, health endpoints |
hooks/validate-bash.sh |
Blocks catastrophic bash commands before execution |
hooks/post-edit.sh |
Formatting hints (prettier/ruff/gofmt) after file edits |
hooks/sync-claude-setup.sh |
Auto-syncs ~/.claude edits back to your fork on GitHub |
hooks/brain-capture.sh |
Counts edits per session; reminds Claude to consider capturing learnings |
skills/review-pr/SKILL.md |
/review-pr — Senior code review with Critical/Warning/Suggestion tiers |
skills/commit/SKILL.md |
/commit — Conventional commits with staged-file deliberation |
skills/debug/SKILL.md |
/debug — Systematic root cause analysis workflow |
skills/brain-sync/SKILL.md |
/brain-sync — Capture session learnings to Obsidian Brain |
agents/code-reviewer.md |
Isolated read-only code review subagent |
Created on first run. Skipped safely if the vault already exists (your notes are never overwritten).
Running ./setup.sh multiple times is safe. Each run:
- Backs up your existing
~/.claudeto~/.claude_backup_TIMESTAMP - Installs fresh copies of all managed files
- Smart-merges
settings.json— your existingmodel,effortLevel,enabledPlugins, and other personal settings are preserved - Skips the Obsidian vault if it already exists — your accumulated notes are untouched
To pull in improvements from the original repo:
cd ~/claude-setup
git remote add upstream https://github.com/iamvirul/claude-setup.git
git fetch upstream
git merge upstream/main
./setup.shcd ~/claude-setup
./uninstall.shRemoves only the files managed by this repo. Your ~/.claude directory, Obsidian vault, and any other files are untouched.
Drop a .md file in ~/.claude/rules/ and reference it from CLAUDE.md:
@~/.claude/rules/my-project-rules.mdCreate ~/.claude/skills/my-skill/SKILL.md with a YAML frontmatter + instructions block. Invoke with /my-skill in Claude Code.
Edit ~/.claude/settings.json directly. The permissions block controls which tools Claude can use automatically vs. requiring confirmation.
enabledPlugins in settings.json is intentionally omitted from this repo. Your installed plugins are preserved across setup runs.
claude-setup/
├── setup.sh # Idempotent installer
├── uninstall.sh # Removes managed files
├── README.md
├── .gitignore
├── claude/ # Source of truth for ~/.claude config
│ ├── CLAUDE.md
│ ├── settings.json # Base settings (no personal plugins)
│ ├── rules/
│ │ ├── architecture.md
│ │ ├── code-quality.md
│ │ ├── security.md
│ │ ├── testing.md
│ │ └── observability.md
│ ├── hooks/
│ │ ├── validate-bash.sh
│ │ ├── post-edit.sh
│ │ ├── sync-claude-setup.sh
│ │ └── brain-capture.sh
│ ├── skills/
│ │ ├── review-pr/SKILL.md
│ │ ├── commit/SKILL.md
│ │ ├── debug/SKILL.md
│ │ └── brain-sync/SKILL.md
│ └── agents/
│ └── code-reviewer.md
└── obsidian/ # Obsidian Brain vault template
└── Claude Brain/
├── Index.md
├── Skills/
│ └── Skills Index.md
├── Patterns/
│ └── Patterns Index.md
├── Debugging/
│ └── Debugging Index.md
├── Projects/
│ └── Projects Index.md
└── Templates/
├── Skill Note.md
├── Pattern Note.md
├── Debug Note.md
└── Project Note.md
MIT