This repo contains files for setting up Claude Code ("CC") for local development (which is mostly Xcode work). It contains rules which can be @
-imported from a CLAUDE.md
file, custom slash commands for CC, as well as scripts for setting up wrapper scripts (which are described below).
As a bonus, a few things I learned along the way.
See framework-docs/. I load them manually when they are helpful.
I added their local directory path to ~/.claude/settings.json
's additionalDirectories
array so there's no extra permissions request.
These can be found in bin/
. They are meant to by symlinked from /usr/local/bin/
.
The linking is done by running ./setup-bin-symlinks.fish
.
A simple wrapper which primes CC with a list of all files in the current directory. This information prevents a ton of "Let me find that file" steps, thus speeding things up and saving tokens.
Call it instead of claude
.
It generates the list, writes it to ./.claude/tmp/project-files.md
, calls claude
, and removes the temp file once CC quits.
To make this work, add this import to your project's CLAUDE.md
file:
## Files In This Project
@./.claude/tmp/project-files.md
A wrapper around gemini
which utilizes czottmann/render-claude-context to make Gemini "inherit" CC's context. Adds the list of project files to the output as well.
If you want to use it from the command line, run gemini-wrapper
instead of gemini
.
It collects CLAUDE.md
files from the directory hierarchy (project folder up to ~/.claude/
), embeds their @
-imports and commands, and generates processed context files with resolved imports that are used as context for Gemini. Those are stored right next to the found CLAUDE.md
files, while the global file is saved to ~/.gemini/
.
See render-claude-context's README.md:
render-claude-context setup
In your global (or project) CLAUDE.md
, @
-import the gemini.md
rule, e.g.
@/Users/morty/agent-toolbox/project-rules/gemini.md
A wrapper around opencode
which utilizes czottmann/render-claude-context to create AGENTS.md
from CC's context. Adds the list of project files to the output as well.
🚨 It operates in 0FG mode and will overwrite any existing AGENTS.md
file it finds in the directory hierarchy.
If you want to use it from the command line, run opencode-wrapper
instead of opencode
.
It collects CLAUDE.md
files from the directory hierarchy (project folder up to ~/.claude/
), embeds their @
-imports and commands, and generates processed context files with resolved imports that are used as context for opencode. Those are stored right next to the found CLAUDE.md
files, while the global file is saved to ~/.config/opencode/
.
No setup necessary.
A wafer-thin wrapper around xcodebuild
which saves tokens by outputting only what's necessary.
It transparently hands over any arguments to xcodebuild
. The difference to calling xcodebuild
directly is that …
- on success it only returns the last 30 lines out output
- on failure it greps the output for "error:" and only returns the found lines (uses
rg
with a context of 5 lines)
In your global (or project) CLAUDE.md
, @
-import the xcode-builds.md
rule, e.g.
@/Users/morty/agent-toolbox/project-rules/xcode-builds.md
See project-rules. These are @
-imported one-by-one in my global CLAUDE.md
.
Custom slash commands for CC are stored in ./commands/
. They are installed globally by symlinking ./commands/
to ~/.claude/commands
.
Set them up by running ./setup-global-commands.fish
.
There are very few MCP servers that I use, namely Linear MCP and Sentry.
Set them up by running ./setup-mcp-servers.fish
.
This is an opinionated setup as I'm scratching my own itches here. I'm not aiming for maximum compatibility with everyone and their setups.
Optional, if you want to use Google Gemini or opencode as a tool and have them use CC's context (see above):
Carlo Zottmann, carlo@zottmann.dev, https://c.zottmann.dev, https://github.com/czottmann
I make Shortcuts-related macOS & iOS productivity apps like Actions For Obsidian, Browser Actions (which adds Shortcuts support for several major browsers), and BarCuts (a surprisingly useful contextual Shortcuts launcher). Check them out!
Most rules and ideas have been looted partially or wholesale from steipete/agent-rules: Rules and Knowledge to work better with agents such as Claude Code or Cursor. Thanks for the inspiration and knowledge sharing, Peter! 🙏🏼
What I took, I've cleaned up for readability and adjusted to my liking.