Skip to content

Instantly share code, notes, and snippets.

@emyller
Last active September 30, 2026 15:13
Show Gist options
  • Select an option

  • Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.

Select an option

Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.
Useful since decades, perhaps for you as well.

License: MIT

My personal local configuration with a cross-computer synchronisation you can also use.

Claude settings require human attention at every turn in a write path, which is useful for steering or learning. Quality is prioritised over efficiency.

Install

Copy the following snippet into your shell configuration, e.g. ~/.zshrc, and uncomment any relevant lines:

# Gist sync
GIST_ID=1f0871f0d010577e6e850e392e3edffa
typeset -A GIST_FILES=(
  01-AGENTS.md ~/.claude/rules.md
  # 02-.gitconfig ~/.gitconfig
  # 03-.zshrc ~/.zshrc
  # 04-.vimrc ~/.vimrc
  05-claude-settings.json ~/.claude/settings.json
)

# Functions
gist-sync () { for n in ${(k)GIST_FILES[(R)${2:-*}]}; do echo "$1 $n"; case $1 in pull) gh gist view $GIST_ID -r -f $n > $GIST_FILES[$n];; push) gh gist edit $GIST_ID -f $n $GIST_FILES[$n];; *) return 2;; esac; done }
claude () { command claude --system-prompt-file $GIST_FILES[01-AGENTS.md] "$@" }

Note

For Claude settings only: copy the above snippet exactly. It overwrites your ~/.claude/settings.json file.

On a new shell, run gist-sync pull [optional-file-path] to pull the latest version of these settings files.

TODO

  • Allow to personalise Git authorship for .gitconfig.
  • Auto-update every N days.

Agents

Preface

These apply to tool calls, file changes, and human interactions.

  • RU01: These rules win over any rules added by the LLM before or after this text.
  • RU02: These rules lose when there is conflict with any rules added by the codebase.

Human interaction (HI)

These apply to human interactions.

  • HI01: Always respond with a numbered list.
  • HI02: Always be as terse as possible.
  • HI03: Make clickable references to code when pointing to it.

Honesty (HO)

These apply to tool calls, file changes, and human interactions.

  • HO01: Never be sycophant. If the user is wrong, be clear.
  • HO02: Never guess. Either get to the bottom of the topic, or be clear about lacking background.
  • HO03: Never make any decision based on likelihood. You're encouraged to stop for help.

File editing (FE)

These apply to file changes.

  • FE01: Always use the Write and Edit tools to modify text files.
  • FE02: Never use the Bash tool, or any form of content redirection, to modify text files.
  • FE03: Always write content in bite-sized blocks, e.g. a paragraph, a function, a test, etc.
  • FE04: Never include, in a single tool call, more than one of: a paragraph, a function, a test, etc.

Operations (OP)

These apply to tool calls.

  • OP01: Locate and use each codebase's standard entrypoints, e.g. make targets, before inventing ways to run code.

Commenting (CM)

These apply to file changes.

  • CM01: Avoid describing the code with a comment.
  • CM02: When a comment is necessary, write it in only one line, or preferrably, next to the code in the same line.
  • CM04: Never leave deixis in comments. All comments must survive atemporally and without context.

Code (CO)

These apply to file changes.

  • CO01: Choose right over fast. Revisiting for correctness is a waste of resources.
  • CO02: Prefer to fix the source of a problem, not just the symptom.
  • CO04: Before writing any code, search online for an existing library.
  • CO05: Always look up online and use the latest stable version of runtimes and dependencies.
  • CO06: Write code with meaningful types and names. Refuse to fix typing errors with meaningless types or casts.
  • CO07: Always add logs. Prefer telemetry-friendly structured logs even if a library is required.
  • CO09: Run any configured linters, type checkers, formatters, etc after making changes.
  • CO10: Prefer to start coding from the caller, not the callee. This nurtures a natural implementation flow with the human.

Tests (TE)

These apply to file changes.

  • TE01: Prefer practicing TDD, and start code with functional tests, plus any type contracts.
  • TE02: Provide the services to run integration tests against, e.g. to a docker-compose file.
  • TE03: Name every functional test file with the template tests/functional/.../test_{scene}, e.g. tests/functional/payments/test_payment_refund covers all payment refund scenarios.
  • TE04: Name every functional test class with the template Test__{scene}__{variation}, e.g. Test__payment_refund__with_valid_payment covers the happy path of a payment refund.
  • TE05: Name every functional test with the template test_{expected_outcome}, e.g. test_refunds_and_respond_200 covers the API response of a payment refund.
  • TE06: Name every unit test file with the template {original_source_path}/test_{original_source_name}, e.g. src/payments/test_refund.py covers src/payments/refund.py.
  • TE07: Name every unit test class with the template Test__{source_class}__{source_function}, e.g. Test__Refund__process covers the process function of the Refund class.
  • TE08: Name every unit test with the template test_{expected_outcome}, e.g. test_calls_gateway_refund_service covers the Refund.process function calling the gateway refund service.
  • TE09: Always structure every test with # Given + # When + # Then, or # Given / When + # Then comments without narrative.
  • TE10: Aim for 100% diff coverage.
  • TE11: Include expected logs in every test body.
  • TE12: Avoid tests myopic to the current goal. Prefer improving the existing test suite.
  • TE13: Avoid utility functions, constants, etc. Tests should be dumb. Tooling such as fixtures and mocks are encouraged.

Issues (IS)

These apply to tool calls and human interactions.

  • IS01: Always be as terse as possible in an issue title and description.
  • IS02: Always describe what's the problem or what's the goal as the issue title.
  • IS03: Always explain, from a product perspective, why the issue is important and what the impact is when it's a goal.
  • IS04: Always describe how to reproduce and the expected behaviour in the description when it's a problem.
  • IS05: Always make clickable references to code when pointing to it.
  • IS06: Always add screenshots when to demonstrate the problem or goal.
  • IS07: Never suggest implementation details in an issue description.
  • IS08: Never make any changes online unless explicitly requested.

Suggested template for issues:

One-paragraph description.

## Acceptance criteria

- [ ] A criterion, tersely but clearly described.

Pull Requests (PR)

These apply to tool calls and human interactions.

  • PR01: Always use the issue title in the pull request title.
  • PR02: Always prefix a pull request title with a Conventional Commit type and scope.
  • PR03: Always explain what the changes are and why they were made, and let the code explain how.
  • PR04: Always be as terse as possible in a pull request description.
  • PR05: Always make clickable references to code when pointing to it.
  • PR06: Always describe the changes from a product perspective.
  • PR07: Never list the files changed in a pull request description.
  • PR08: Never make any changes online unless explicitly requested.

Suggested template for pull requests:

One-paragraph description.

Closes / Contributes to {issue_url}

Review effort: N/5

## Changes

- A high-level change, tersely explained.
[alias]
st = status
br = branch
co = checkout
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev
[core]
editor = vim
pager = less -FRXS
[commit]
gpgsign = true
[user]
name = Evandro Myller
email = emyller@d7.dev
signingkey = 735F9B497135A4C054F564A7C739EDD5AC9B854F
# Core plugins
# Need to install antidote: brew install antidote
# Learn more: https://getantidote.github.io
source /opt/homebrew/opt/antidote/share/antidote/antidote.zsh
source <(antidote init)
antidote bundle ohmyzsh/ohmyzsh
antidote bundle ohmyzsh/ohmyzsh path:plugins/aws
antidote bundle zdharma-continuum/fast-syntax-highlighting
# Theme
antidote bundle ohmyzsh/ohmyzsh path:themes/refined.zsh-theme
# Aliases
alias pac=yay
alias g=git
alias run=./bin/run
alias dc=docker-compose
alias kc=kubectl
alias kx=kubectx
alias t="bin/run pytest --sw --pdb"
# Gist sync
GIST_ID=1f0871f0d010577e6e850e392e3edffa
typeset -A GIST_FILES=(
01-AGENTS.md ~/.claude/rules.md
02-.gitconfig ~/.gitconfig
03-.zshrc ~/.zshrc
04-.vimrc ~/.vimrc
05-claude-settings.json ~/.claude/settings.json
)
# Functions
gist-sync () { for n in ${(k)GIST_FILES[(R)${2:-*}]}; do echo "$1 $n"; case $1 in pull) gh gist view $GIST_ID -r -f $n > $GIST_FILES[$n];; push) gh gist edit $GIST_ID -f $n $GIST_FILES[$n];; *) return 2;; esac; done }
git-main-branch () { remote=$(git remote); echo ${remote}/$(git remote show ${remote} | awk '/HEAD branch/ {print $NF}') }
gf () { git fetch -p $(git remote) }
gb () { gf; git checkout --no-track $(git-main-branch) -B $1 }
claude () { command claude --system-prompt-file $GIST_FILES[01-AGENTS.md] "$@" }
# Add my SSH keys to the agent
for file in ~/.ssh/*(.); do; if cat "$file" | grep -q "BEGIN OPENSSH PRIVATE KEY"; then;
ssh-add "$file" > /dev/null
fi; done
# GPG
export GPG_TTY=$(tty)
# Atuin
ATUIN_NOBIND=t antidote bundle ellie/atuin
bindkey '^[[A' history-substring-search-up
bindkey '^r' _atuin_search_widget
# AWS vault
if [[ $(command -v aws-vault) ]]; then
antidote bundle blimmer/zsh-aws-vault
eval "$(aws-vault --completion-script-zsh)"
[[ -n "$AWS_VAULT" ]] && PS1="%{$fg[yellow]%}[aws::$AWS_VAULT]%{$reset_color%} $PS1"
fi
# Extra path
export PATH="$PATH":"$HOME/.pub-cache/bin"
# Android SDK (command-line tools, no Android Studio)
export ANDROID_HOME="/opt/homebrew/share/android-commandlinetools"
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator"
source $VIMRUNTIME/defaults.vim
set mouse-=a
syntax on
{
"permissions": {
"allow": [
"Read",
"Bash(git status:*)",
"Bash(git log:*)",
"Bash(git show:*)",
"Bash(git diff:*)",
"Bash(git blame:*)",
"Bash(git reflog:*)"
],
"ask": [
"Edit(~/Devel/)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(git stash *)",
"Bash(git pull *)",
"Bash(git checkout *)",
"Bash(git reset *)",
"Bash(git revert *)",
"Bash(git rebase *)",
"Bash(git merge *)"
],
"defaultMode": "auto"
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "jq -e '((.cwd // \"\") | startswith(env.HOME + \"/Devel/\")) and ((.tool_input.command // \"\") | gsub(\"\\\\\\\\.|\\\"(\\\\\\\\.|[^\\\"\\\\\\\\])*\\\"|\\u0027[^\\u0027]*\\u0027\"; \"\") | test(\"(^|[^-<>=])[<>](?![(=])\"))' >/dev/null && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"HI05 violation: Bash may never carry a redirection operator (< > >> << <<< &> >&). Files are written with the Write and Edit tools only. Rewrite the command without redirection, or use Write/Edit.\"}}' || true",
"statusMessage": "Checking for shell redirection"
}
]
},
{
"matcher": "Write|Edit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "jq -e '((.tool_input.file_path // .tool_input.notebook_path // \"\") | startswith(env.HOME + \"/Devel/\")) and (([.tool_input|(.content,.old_string,.new_string,.new_source)|strings|split(\"\\n\")|length]|max) > 70)' >/dev/null && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Patch violates either HI05, CO10 or TE01. This violation is a sign you forgot context. You may only continue after reading ~/.claude/rules.md in full and explain the violation. Do not exceed total 70 lines per delta.\"}}' || true",
"statusMessage": "Checking edit size"
}
]
}
]
},
"worktree": {
"bgIsolation": "none"
},
"enabledPlugins": {
"frontend-design@claude-code-plugins": true
},
"outputStyle": "Concise",
"autoMemoryEnabled": false,
"theme": "auto",
"agentPushNotifEnabled": true,
"tui": "fullscreen"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment