Compare commits

..

31 Commits

Author SHA1 Message Date
daniel e884e4a88f Manage Claude Code config + add Justfile via bombadil
Bring ~/.claude config under bombadil management across both machines:
- claude/shared/: converged settings.json (union of both hosts) and a single
  Catppuccin-powerline statusline merged from the two machines' versions
- claude/xps, claude/desktop: per-host agents/skills behind [profiles.xps]/
  [profiles.desktop]; each host links only its own via `bombadil link -p <theme> <host>`

Linked at file granularity because bombadil 4.2.0 can't create directory
symlinks for new targets, and to keep ~/.claude/{agents,skills} real dirs.

Add a Justfile (symlinked to ~/.justfile, usable via `just -g`) with link/
dark/light/watch/unlink/update/status/edit recipes; host auto-detected from
hostname. Recipes use exported shell vars to avoid bombadil's Tera engine
mis-parsing just's double-brace interpolation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 17:17:17 -05:00
daniel 59c40ad5ad Add CLAUDE.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 16:43:07 -05:00
daniel 403f951078 Add line break in prompt 2026-05-19 12:15:27 -05:00
daniel 73c91f7714 Add jobs to prompt 2026-05-19 12:14:53 -05:00
daniel b4102a94da Add starship config 2026-05-19 11:37:36 -05:00
daniel 085c040265 Add shift-enter binding for claude code support 2026-05-19 11:37:36 -05:00
daniel 5a6ed9607c Disable goenv by default 2026-05-19 11:37:35 -05:00
daniel b58130e79c Ignore claude local settings 2026-04-14 11:05:51 -05:00
daniel 6deba070cb Add golangci-lint-langserver for go 2025-09-30 19:23:42 -05:00
daniel 4c71f795aa Remove yazi file explorer (explorer built in with newer versions of helix) 2025-09-05 11:18:08 -05:00
daniel 5557d68a9a Add support for working with painless scripts 2025-05-12 11:40:52 -05:00
daniel ac6926123a Update rbenv and nvm 2025-05-05 19:39:17 -05:00
daniel dfc3511aa3 Add rbenv; remove old go and ruby zsh shims 2025-05-01 23:13:13 -05:00
daniel 4334c8c03b Update comment 2025-04-30 08:55:18 -05:00
daniel 5dbd41d75b Add goenv init zsh script 2025-04-30 08:54:11 -05:00
daniel 3eaddcfb7c Disable pane frames 2025-04-24 14:10:40 -05:00
daniel e3907a655c Use primary clipboard instead of system for Zellij 2025-04-24 13:32:56 -05:00
daniel b0fecf1342 Set tab name on CD 2025-04-23 09:44:36 -05:00
daniel 221a6563d4 Update EDITOR and VISUAL to correct commands 2025-04-16 19:15:11 -05:00
daniel 527d79e8b1 Add some useful zellij functions 2025-04-16 15:28:08 -05:00
daniel f906dd126c Remove custom zellij layouts; auto-rename new tabs to cwd 2025-04-16 15:18:38 -05:00
daniel 852ebd4cb2 Remove unused configs for zellij 2025-04-16 15:00:16 -05:00
daniel bb86ce0a8a Do not autostart/attach zellij 2025-04-16 14:56:26 -05:00
daniel a5fb58fc53 Use standard helix command for envars 2025-04-16 14:56:15 -05:00
daniel f9d9cfa453 Comment out boilerplate, use compact layout for zellij by default 2025-04-16 14:55:55 -05:00
daniel b5efca9e65 Catch helix or hx aliasing 2025-04-16 14:55:20 -05:00
daniel 9431072374 Rebind lazygit for helix 2025-04-16 14:54:40 -05:00
daniel b5378724da Clean up duplicate sections/bindings 2025-04-16 14:29:58 -05:00
daniel f1e9c49940 Add quick resume in zsh via C-z 2025-04-16 14:26:21 -05:00
daniel 8d9a798078 Add some integrations directly with helix 2025-04-16 14:26:03 -05:00
daniel 7ffcd8b922 Disable rootless docker envars for now 2025-04-16 14:17:54 -05:00
30 changed files with 1348 additions and 444 deletions
-3
View File
@@ -4,6 +4,3 @@
[submodule "alacritty-theme"]
path = alacritty-theme
url = git@github.com:alacritty/alacritty-theme
[submodule "yazi/flavors"]
path = yazi/flavors
url = https://github.com/yazi-rs/flavors.git
+56
View File
@@ -0,0 +1,56 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## What this is
Personal dotfiles managed by [Bombadil](https://github.com/oknozor/toml-bombadil). Source config files live at the top level of this repo. Bombadil renders them (substituting template variables) into `.dots/`, then symlinks the rendered files into `$HOME` / `~/.config` according to `bombadil.toml`.
## Applying changes
This repo is checked out on two machines sharing one `bombadil.toml`: `daniel-xps` (laptop) and `daniel-desktop` (GPU box). Each links with **both** a theme profile and its **host** profile. Easiest is the Justfile (symlinked to `~/.justfile`, auto-detects the host):
```sh
just -g link # render -> .dots/ and relink for this host + the dark theme
just -g light # relink with the light theme
just -g update # git pull --ff-only, then relink
just -g # list all recipes
```
Equivalent raw commands:
```sh
bombadil link -f -p dark xps # on daniel-xps
bombadil link -f -p dark desktop # on daniel-desktop
```
Edits do not take effect until linked. **Always include the host profile** (`xps`/`desktop`) — a plain `bombadil link` won't link that host's Claude agents/skills. `-f` is needed when a target already exists as a real file; bombadil backs it up to `*.bak` (clean those up afterward). The repo is registered globally via `~/.config/bombadil.toml` (a symlink to `bombadil.toml` here, created once by `bombadil install`).
## Key conventions
- **Never edit `.dots/`.** It is Bombadil's generated output (not tracked by git) and is overwritten on every `bombadil link`. Edit the source files at the repo root instead.
- **`bombadil.toml`** is the source of truth for what gets linked where. Adding a new config means: add the file at the repo root, then add a `[settings.dots]` entry mapping `source` (relative to repo) to `target` (relative to `$HOME`).
- **Templating:** files may contain `{{var}}` placeholders substituted from the vars files. The active set is `vars = ["dark.toml", "vars.toml"]` plus whatever profile is selected. `vars.toml` holds identity (`email`, `name`, `signing_key`). `dark.toml` / `light.toml` are profile-specific theme variables (`alacritty_theme`, `helix_theme`, `zellij_theme`, `bat_theme`, `theme`). Templated files currently include `alacritty/alacritty.toml`, `helix/config.toml`, `zellij/config.kdl`, `gitconfig`, and `bat/config` — switching `theme` retints all apps at once via the profile.
## Claude Code config (`claude/`)
`~/.claude` is partly shared, partly host-specific:
- `claude/shared/``settings.json` and `statusline-command.sh`, linked on every host (default dots). `settings.json` is the union of both machines' settings; the statusline is one Catppuccin-powerline script merged from both.
- `claude/xps/`, `claude/desktop/` — each host's own `agents/` and `skills/`, linked only by that host's profile. `daniel-xps` is the orchestrator that delegates coding subtasks over SSH (`desktop-coder` agent, `desktop-delegate` skill); `daniel-desktop` runs the local Qwen3-Coder model the laptop delegates to (`local-coder` agent, `local-delegate` + `unload-local-model` skills).
Two bombadil constraints shaped this layout — keep them in mind when adding `.claude` files:
1. **File-level dots only.** bombadil 4.2.0 cannot create a *directory* symlink for a not-yet-linked target (fails with `IoError: the source path is neither a regular file nor a symlink to a regular file`). So every agent/skill file is its own dot entry mapping a single `.md` file. This also keeps `~/.claude/{agents,skills}` as real directories, so Claude's own runtime files coexist with the managed ones.
2. **Tera escaping.** Sources render through Tera, which treats `{{`, `{%`, and `{#` as template syntax. The shell array-length form `${#arr[@]}` contains `{#` and breaks rendering — avoid it in any linked script (`claude/shared/statusline-command.sh` uses `set -- "${arr[@]}"; n=$#` instead). Watch out for the same sequences in comments.
## zsh layout
- `zshenv.zsh``~/.zshenv` (env vars, editor detection), `zshrc.zsh``~/.zshrc` (interactive setup).
- `zshrc.zsh` sources every file in `~/.config/zsh.d/*` (linked from `zsh.d/`) then every file in `~/.config/aliases.d/*` (linked from `aliases.d/`). Each file is a self-contained conf.d-style snippet for one tool (e.g. `zsh.d/git.zsh`, `aliases.d/cargo.zsh`). Add a tool by dropping a new `.zsh` file in the matching directory — no central registration needed.
- Machine-specific overrides are sourced if present and are intentionally not in this repo: `~/.zshenv.local`, `~/.zshrc.local`, `~/.aliases.local`.
- Tool integrations guard on availability with `if (( $+commands[tool] )); then ...` — follow this pattern so configs degrade gracefully on machines lacking a tool. The prompt (`zsh.d/prompt.zsh`) falls back starship → p10k → manjaro.
## Submodules
`alacritty/themes` (and a legacy `alacritty-theme`) are git submodules pointing at the upstream alacritty color-theme collection. Run `git submodule update --init` after cloning.
+55
View File
@@ -0,0 +1,55 @@
# Dotfiles task runner (bombadil + git).
#
# Symlinked to ~/.justfile by bombadil, so it works as just's global justfile:
# just -g <recipe> # from anywhere
# just <recipe> # from $HOME
#
# Recipes reference exported variables as shell $vars rather than just's
# double-brace interpolation: bombadil renders every dotfile through Tera, which
# would try to evaluate a double-brace expression as a template variable.
# Theme profile to link with: dark or light.
export theme := "dark"
# Host profile, auto-detected from hostname. Each machine links only its own
# Claude agents/skills; everything else is shared.
export host := if `hostname` == "daniel-desktop" { "desktop" } else { "xps" }
# List available recipes.
default:
@just -g --list
# Re-link all dotfiles for this host and theme.
link:
bombadil link -f -p "$theme" "$host"
alias relink := link
# Re-link with the dark theme.
dark:
bombadil link -f -p dark "$host"
# Re-link with the light theme.
light:
bombadil link -f -p light "$host"
# Watch dotfiles and re-link automatically on change.
watch:
bombadil watch -f -p "$theme" "$host"
# Remove all bombadil-managed symlinks.
unlink:
bombadil unlink
# Pull the latest dotfiles from the remote and re-link.
update:
git -C ~/src/dotfiles pull --ff-only
bombadil link -f -p "$theme" "$host"
# Show the dotfiles repo's git status.
status:
git -C ~/src/dotfiles status
# Open the bombadil config in $EDITOR.
edit:
$EDITOR ~/src/dotfiles/bombadil.toml
+9
View File
@@ -15,3 +15,12 @@ opacity = 0.95
[window.padding]
x = 16
y = 16
# Shift+Enter sends a distinct ESC+CR sequence so apps (like Claude Code)
# can distinguish it from plain Enter and insert a newline instead of
# submitting. Installed by Claude Code/terminal-setup; preserved here
# so bombadil renders it persistently across dotfile syncs.
[[keyboard.bindings]]
key = "Return"
mods = "Shift"
chars = "\u001B\r"
+2
View File
@@ -1,3 +1,5 @@
if (( $+commands[helix] )); then
alias hx="helix"
elif (( $+commands[hx] )); then
alias helix="hx"
fi
+27 -3
View File
@@ -47,9 +47,8 @@ mimeapps = { source = "mimeapps.list", target = ".config/mimeapps.list" }
# navi
navi = { source = "navi", target = ".config/navi" }
# yazi
yazi_flavors = { source = "yazi/flavors", target = ".config/yazi/flavors", ignore = [ "*.md", "scripts", "LICENSE", "*.json", "*.yaml", ".git", ".github", ".gitignore" ] }
yazi_theme = { source = "yazi/theme.toml", target = ".config/yazi/theme.toml" }
# starship
starship = { source = "starship.toml", target = ".config/starship.toml"}
# zellij
zellij = { source = "zellij", target = ".config/zellij" }
@@ -59,3 +58,28 @@ zshconfigs = { source = "zsh.d", target = ".config/zsh.d" }
zshaliases = { source = "aliases.d", target = ".config/aliases.d" }
zshenv = { source = "zshenv.zsh", target = ".zshenv" }
zshrc = { source = "zshrc.zsh", target = ".zshrc" }
# justfile — task runner, usable from anywhere via `just -g`
justfile = { source = "Justfile", target = ".justfile" }
# claude code (shared across hosts; agents/skills are host-specific, see profiles below)
claude_settings = { source = "claude/shared/settings.json", target = ".claude/settings.json" }
claude_statusline = { source = "claude/shared/statusline-command.sh", target = ".claude/statusline-command.sh" }
# Host profiles — select one per machine alongside the theme profile (space-separated), e.g.
# daniel-xps: bombadil link -f -p dark xps
# daniel-desktop: bombadil link -f -p dark desktop
# (or just `just -g link`, which auto-detects the host)
# Each links the host's own Claude agents/skills (the GPU box drives the local
# model; the laptop is the orchestrator that delegates to it over SSH).
# Linked at the file level (not as directory dots): bombadil 4.2.0 only symlinks
# regular files, and this keeps the live ~/.claude/{agents,skills} as real dirs so
# Claude's own agents/skills coexist with these dotfile-managed ones.
[profiles.xps.dots]
claude_agent_desktop_coder = { source = "claude/xps/agents/desktop-coder.md", target = ".claude/agents/desktop-coder.md" }
claude_skill_desktop_delegate = { source = "claude/xps/skills/desktop-delegate/SKILL.md", target = ".claude/skills/desktop-delegate/SKILL.md" }
[profiles.desktop.dots]
claude_agent_local_coder = { source = "claude/desktop/agents/local-coder.md", target = ".claude/agents/local-coder.md" }
claude_skill_local_delegate = { source = "claude/desktop/skills/local-delegate/SKILL.md", target = ".claude/skills/local-delegate/SKILL.md" }
claude_skill_unload_local_model = { source = "claude/desktop/skills/unload-local-model/SKILL.md", target = ".claude/skills/unload-local-model/SKILL.md" }
+85
View File
@@ -0,0 +1,85 @@
---
name: local-coder
description: Run a focused coding subtask on the local Qwen3-Coder-30B model (via llama-server + claude-code-router) instead of a remote Anthropic model. Use when the task is well-scoped, mechanical, fits within ~16K tokens of total context, and doesn't need top-tier reasoning. Good fits — refactor a function, generate tests scaffolded from existing ones, format/normalize docstrings, mechanical lint fixes, scaffold boilerplate, translate a small function between languages. Bad fits — cross-file architectural changes, ambiguous requirements needing judgment, performance work needing measurement, anything requiring web research or `cargo run`. Saves Anthropic API tokens for the orchestrator's harder work.
tools: Bash, Read
model: sonnet
---
# local-coder
Thin transport layer for the local Qwen3-Coder model. **You do not solve the task — even if you could answer it from your own knowledge.** Every invocation goes to the wrapper. The orchestrator chose `local-coder` over a direct response *because they want the local model to do this work* — to save Anthropic tokens, to test the local model, or to keep certain work off the remote API. Answering directly defeats the entire purpose.
## Tool budget — strict
- **Bash: exactly 1 call, always the wrapper.** Non-negotiable. Even if the task is one line and you "know" the answer, route it through the wrapper. The wrapper is the *product* the orchestrator asked for — not a fallback path.
- **No other Bash.** No `ls`, no `cat`, no `rustc`, no `cargo`, no `wc`. The orchestrator runs validation commands after you return.
- **Read: 0-3 calls.** One Read per file the model says it created or edited, max 3 files. Skip Read entirely for pure-text-output tasks (no file edits).
If you find yourself wanting a 2nd Bash call or a 4th Read, stop and return what you have. More tool calls do not improve the report — they only add latency.
**Sanity check before responding**: count your tool uses. If Bash count != 1, you did the wrong thing — re-run with the wrapper.
## Process
1. **Invoke the wrapper** in a single Bash call using a heredoc (no temp file). Heredoc preserves newlines and shell-special chars cleanly:
```bash
~/llm/scripts/local-coder-task.sh [--profile <name>] [--minimal-prompt] <<'TASK'
<orchestrator's prompt verbatim, including any code fences>
TASK
```
**Wrapper flags** (optional, passed before the heredoc):
- `--profile <name>` — tool profile, controls `--allowed-tools` footprint:
- `full` (default) — Read/Write/Edit/Grep/Glob + ~25 Bash patterns.
- `code` — Read/Write/Edit/Grep/Glob + cargo verification Bash only.
- `edit-only` — Read/Write/Edit/Grep/Glob, **no Bash** (~35K tokens saved).
- `read-only` — Read/Grep/Glob, no edits.
- `--minimal-prompt` — replace Claude's built-in system prompt with a ~1 KB minimal one (~812K tokens saved). Use for trusted orchestrator-spec'd mechanical tasks. Drops Claude's default safety/style guidance.
**How to pick flags**: if the orchestrator's brief includes a `WRAPPER FLAGS:` line at the top (e.g. `WRAPPER FLAGS: --profile=edit-only --minimal-prompt`), pass those flags verbatim and **strip the line from the task body** before piping. If no such line is present, invoke with no flags (default behavior — full profile, default Claude prompt + tool-call-format append).
2. **If exit != 0**: return the structured report with `exit: <N>` and the wrapper's stderr verbatim. Stop. No retry.
3. **If exit == 0**:
- Scan the model's stdout for filenames it claims to have created/edited (lines like "created `/path/...`", "wrote to `/path/...`", or a Write/Edit tool reference in the output).
- For each (≤3), do exactly one `Read` to confirm the file exists and is non-empty. That's the entire verification — do not spot-check contents, do not count lines, do not parse.
- If the model output references no files (pure text task), skip Read entirely.
4. **Return the structured report.**
## Final report
```
exit: <N>
files: <comma-separated list of files the model claimed to touch, or "none">
verified: <comma-separated "yes"/"no" matching files list, or "n/a" if none>
output:
<verbatim wrapper stdout — no paraphrasing, no editing>
```
That's the whole report. No "verification notes" prose, no elapsed time (the runtime tracks it), no "model:" header (the orchestrator knows what model you wrap).
If you flagged any file as "verified: no" (i.e., Read failed or returned empty), add one final line:
```
warning: <one short sentence about which file and what was wrong>
```
## Hard rules
- **Verbatim output.** Never paraphrase or summarize the wrapper's stdout. The orchestrator wants raw model output.
- **No retry.** First-attempt failure → report and stop. The orchestrator decides whether to fall back to real Claude.
- **No scope expansion.** Ambiguous prompt → return `exit: 0`, `output: need clarification: <specific question>`. Do not guess.
- **Tool ceiling is binding.** 1 Bash + 0-3 Read. Going over is a bug, not thoroughness.
## Failure modes (surface to orchestrator, don't act on them)
| Exit | Cause | What you do |
|---|---|---|
| 2 | local stack down (llama-server / CCR failed to start) | Report verbatim stderr. |
| 1 | child claude errored (CCR translation, context overflow, timeout) | Report verbatim stderr. |
| 0 + truncated output | model hit max_tokens or got confused mid-stream | Report as-is. The orchestrator notices. |
| 0 + refusal text | model said "I can't help" | Report as-is. |
| 0 + file claimed but Read fails | model hallucinated the edit | Mark "verified: no" + add the warning line. |
@@ -0,0 +1,210 @@
---
name: local-delegate
description: Decide when and how to delegate a focused coding subtask to the local Qwen3-Coder-30B model via the `local-coder` subagent. Use when the task is well-scoped, mechanical, fits in ~16K context, and doesn't need top-tier reasoning — saves Anthropic API tokens for the orchestrator's harder work. Anti-patterns — cross-file architectural changes, ambiguous requirements, performance tuning, anything requiring `cargo run`.
---
# /local-delegate
A decision-support skill for the orchestrator. Triage whether a subtask fits the local Qwen3-Coder model, and if so, hand it off via the `local-coder` subagent with a properly-shaped prompt.
## The local stack
| Layer | What | Where |
|---|---|---|
| Model | Qwen3-Coder-30B-A3B-Instruct, UD-Q5_K_XL quant | `~/llm/models/` |
| Inference | llama.cpp 9200 with Vulkan/RADV on AMD Radeon RX 7900 XTX | `systemctl --user … llama-server` (port 8080) |
| API translator | claude-code-router (Anthropic ↔ OpenAI) | `ccr` (port 3456) |
| Wrapper | One-shot `claude --print` with `ANTHROPIC_BASE_URL=ccr` | `~/llm/scripts/local-coder-task.sh` |
| Subagent | Haiku transport layer that drives the wrapper + verifies | `~/.claude/agents/local-coder.md` |
**Performance**: ~135-140 tok/s decode, ~100-200 ms TTFT, 32K context (practical task budget ~16-20K leaves room for output).
## ✅ Good fits for the local model
- **Mechanical refactors** — rename, extract helper, inline a constant, hoist a binding.
- **Boilerplate scaffolding** — new test file modeled on an existing one, getter/setter pairs, a CLI subcommand stub.
- **Format normalization** — rewrite docstrings to a target style, normalize import order, convert log macros.
- **Single-file changes** where the surrounding context fits in ~10K tokens.
- **Cross-language translation** — port a function from Python to Rust, convert XML config to TOML, etc.
- **Lint-driven fixes** where the lint message names the change ("inline this `format!`", "remove unused import").
- **Read-only inspection** — "summarize what module X does", "list all callers of function Y" (model can use Read/Grep/Glob).
## ❌ Bad fits — keep on real Claude
- **Cross-file architectural changes** — local model can't hold enough context to reason about ripple effects.
- **Ambiguous requirements** — anything needing "well, depends on…" judgment.
- **Performance work** — needs bench data, knowledge of the existing perf budget, system-level reasoning.
- **Web research / external lookups** — local model has no web access through this pipe.
- **`cargo run` / interactive smoke testing** — same TTY constraint as remote subagents; the local model can't verify visual output either.
- **PR creation, git commits, branch ops** — wrapper's Bash allowlist is read-only for safety. Have the orchestrator handle git after the subagent returns.
- **Anything novel** — local 30B is fluent but doesn't have the depth on niche libraries / rare patterns.
## How to invoke
### Shape A — task that writes/edits files
Use this when the local model should produce a file as its primary output. The subagent will verify each touched file with one `Read` call (≤3 files).
```
Agent({
subagent_type: "local-coder",
description: "<3-5 word summary>",
prompt: "
Task: <one-paragraph description, imperative mood>
Files in scope:
- <path>:<optional line range>
- <path>
Context (paste relevant snippets — keep under 8K tokens):
```<lang>
<relevant code>
```
Acceptance criteria:
- <bullet>
- <bullet>
Out of scope:
- <bullet — what NOT to touch>
- Don't run compile/test/lint checks — orchestrator will do that after you return.
"
})
```
### Shape B — task that returns text only (no file writes)
Use this when you want analysis, an explanation, a code snippet for the orchestrator to apply itself, or a summary. The subagent skips the `Read` verification entirely (0 Read calls), so it's the fastest shape — typically ~5-10 s end-to-end on warm stack.
```
Agent({
subagent_type: "local-coder",
description: "<3-5 word summary>",
prompt: "
Task: <one-paragraph description, imperative mood>
Context (paste relevant snippets — keep under 8K tokens):
```<lang>
<relevant code>
```
Output format:
- <e.g., 'one Rust function, no markdown fences, no explanation'>
- <e.g., 'bullet list of files that match the pattern, one per line'>
Out of scope:
- Don't write any files. Return your answer as plain text only.
- Don't run any commands.
"
})
```
**Concrete no-edit examples**:
- *Explain*: "Explain in 4 sentences what `crates/zemyna_terrain/src/chunked.rs` does. Output: 4 sentences, plain text, no headings."
- *Snippet for orchestrator to paste*: "Write a Rust closure equivalent to this Python lambda: `lambda x, y: x * 2 + y`. Output: only the closure, one line, no `let` binding."
- *Listing*: "Read `Cargo.toml`. List every workspace member crate, one per line, no other text."
- *Translation*: "Translate this SQL `WHERE` clause to a `serde_json::Value` filter expression. Output: only the Rust expression."
Both shapes invoke the same wrapper via a single Bash heredoc — no temp file involved. The subagent returns a structured report with `exit:`, `files:`, `verified:`, and verbatim wrapper output.
### Shape C — direct Bash, no subagent (guaranteed routing)
Use this when you need a **hard guarantee** the local model actually ran — typically because the task is trivial enough that the subagent might decide to answer it directly from its own knowledge instead of invoking the wrapper. (Sonnet-as-subagent follows multi-paragraph rules ~95% of the time, but trivial one-liner tasks tempt any model to shortcut.)
You give up the subagent's verification + structured report; you pay one Bash call's worth of orchestrator context for the wrapper's raw output.
```
Bash({
command: "~/llm/scripts/local-coder-task.sh <<'TASK'\n<your task here>\nTASK\n",
description: "force-route through local model"
})
```
The wrapper's stdout becomes the Bash result. You parse it yourself.
**When Shape C is the right call**:
- The task is one-liner-trivial (e.g., "convert this Python lambda to Rust").
- You're benchmarking the local model and need every call to actually hit it.
- You're testing the local stack (smoke test, latency measurement, output-format check).
- You suspect the subagent will shortcut because the task is too easy.
**When Shape A or B is still better**:
- Real coding subtasks (refactor, scaffold, format-cleanup) — the subagent's verification step catches hallucinated file edits.
- Tasks where you want a structured report (`exit:`, `files:`, `verified:`) for the orchestrator's downstream handling.
- Multi-file tasks where the verification of each file is non-trivial.
### Quick decision tree
```
Task fits the local model? ── no ──> keep on real Claude
yes
Will the model write files? ── yes ──> Shape A (subagent, file verification)
no
Is the task trivial enough that the
subagent might answer directly? ── yes ──> Shape C (direct Bash, guaranteed)
no (e.g., needs the local model's
actual code-gen style, length,
or vocabulary)
└──> Shape B (subagent, no file verification)
```
## Pre-flight checklist (orchestrator side)
Before invoking, mentally check:
1. **Sizing** — can the task be described in <500 tokens + ≤8K tokens of context? If no, scope-split or keep on real Claude.
2. **Cohesion** — is the task contained to 1-3 files? If it sprawls, keep on real Claude.
3. **Verifiability** — can you state an objective acceptance criterion (a passing test, a successful build, a grep returning N hits)? If you can't state how you'd know it worked, don't delegate.
4. **Recoverability** — if the local model produces wrong output, can you `git checkout -- <files>` and try again on real Claude? If not (e.g., it's a brand-new file), reduce blast radius first.
## Stack health (drop into a Bash if unsure)
```bash
curl -sf http://127.0.0.1:8080/health # llama-server (loads model on first start, ~65 s cold)
ccr status # CCR
systemctl --user status llama-server # if either above fails
```
The wrapper auto-starts both if missing. But on cold start, the first call takes ~65 s for model load. Subsequent calls (within the 30-min keep-alive) are warm.
## Failure handling
| Symptom | Likely cause | Action |
|---|---|---|
| Wrapper exit 2, stderr says "llama-server failed health check" | Model load failed (GPU contention, OOM) | Check `journalctl --user -u llama-server --since '5 min ago'`. Often: another GPU consumer started. Run `~/llm/scripts/use-llama-server.sh` to force-restart clean. |
| Wrapper exit 1, claude session error | CCR translation issue or context overflow | Check `~/.claude-code-router/` logs. Shrink the prompt context, retry. |
| Clean exit, output references edits that aren't there | Local model hallucinated the edit | Subagent's verification step catches this. Fall back to real Claude. |
| Clean exit, output is mid-sentence cut | Hit max_tokens or context overflow | Reduce prompt size and retry, OR raise max_tokens in the wrapper. |
| Repeated/looping output | Sampling broke (rare with our config) | Retry on real Claude — don't iterate on local. |
## Anti-patterns
- **Don't retry the same task on local.** If first attempt fails, fall back. Iterating burns wall clock without fixing the underlying capability gap.
- **Don't chain local subagents.** Sequential local calls compound error rate. Use real Claude as the connecting tissue.
- **Don't pass the orchestrator's full CLAUDE.md / rules context.** Wrapper uses `--bare` precisely to avoid this — the local model gets a clean context. Pass only the task-relevant context inline.
- **Don't delegate work you wouldn't trust a junior dev to do with the same brief.** If the brief itself requires deep project knowledge to write correctly, the implementer needs it too.
## CLI usage (outside Claude Code)
Useful for testing the stack without spawning a subagent:
```bash
echo "Write a Rust function that reverses a string in-place." \
| ~/llm/scripts/local-coder-task.sh
```
Output goes to stdout. Same env, same flags as what the subagent uses.
## See also
- `~/.claude/agents/local-coder.md` — the subagent profile
- `~/llm/scripts/local-coder-task.sh` — the wrapper this skill invokes
- `~/.claude-code-router/config.json` — CCR routing
- `~/llm/scripts/claude-local.sh` — interactive `claude code` against the local stack (different use case: full claude session vs one-shot subtask)
@@ -0,0 +1,84 @@
---
name: unload-local-model
description: Unload the local llama.cpp model (Qwen3-Coder-30B) from the 7900 XTX to free VRAM. Stops the llama-server systemd user service and reaps any stray foreground server. Idempotent — safe to run when already unloaded. Use when done with local-model work or when you want the GPU's VRAM back.
---
# /unload-local-model
Free the GPU by unloading the local Qwen3-Coder-30B model that backs the
`local-coder` subagent (see [local-delegate](../local-delegate/SKILL.md)). The
model is served by `llama-server` (llama.cpp) and pins ~9.5 GB of VRAM on the
Radeon RX 7900 XTX while resident. This skill stops it cleanly and verifies the
VRAM is back.
## What holds the GPU
| Layer | Holds VRAM? | This skill touches it? |
|---|---|---|
| `llama-server.service` (systemd --user, port 8080) | **Yes** — the model weights + KV cache | **Stops it** |
| stray foreground `llama-server` (from `llama-server-foreground.sh`) | **Yes**, if running outside systemd | **Reaps it** |
| `claude-code-router` / `ccr` (port 3456) | No — pure API translator, no VRAM | Left running |
| `ollama` daemon (port 11434) | Only while a model is loaded | Out of scope — see note below |
Leaving CCR up is deliberate: it holds no VRAM and re-attaches to llama-server
the next time the stack warms. There is nothing to restart.
## Run it
```bash
# 1. Canonical path — stop the systemd user service (idempotent; no-op if dead).
systemctl --user stop llama-server.service
# 2. Reap any stray foreground server started outside systemd. Match the binary
# PATH (leading slash) — NOT the bare word "llama-server", or pkill matches
# its own command line and SIGTERMs the shell running this skill.
pkill -f '/llama-server ' 2>/dev/null || true
```
## Verify
```bash
echo "service: $(systemctl --user is-active llama-server.service)" # want: inactive
pgrep -af '/llama-server' | grep -v pgrep || echo "no server process" # want: none
curl -sf --max-time 2 http://127.0.0.1:8080/health >/dev/null 2>&1 \
&& echo "port 8080: UP (STILL LOADED)" || echo "port 8080: down (unloaded)"
# VRAM should drop to desktop baseline (~2.4 GiB); a loaded model adds ~9.5 GB.
rocm-smi --showmeminfo vram 2>/dev/null | awk '/Used/{printf "VRAM used: ~%d MiB\n", $NF/1024/1024}'
```
A clean unload reads: `service: inactive`, `no server process`, `port 8080:
down`, VRAM near the desktop baseline.
## Gotchas
- **Self-pkill footgun.** `pkill -f 'llama-server'` (no slash) matches *this
skill's own command string* and kills the shell mid-run (exit 144 = SIGTERM).
Always anchor on the binary path: `pkill -f '/llama-server '`.
- **Already unloaded is the common case.** The systemd unit is `disabled` and
only runs on demand (the wrapper auto-starts it), so most of the time the
model is already down. The skill is idempotent — running it then is a no-op
that just confirms state. Report "already unloaded" rather than implying you
stopped something.
- **Don't disable or mask the service.** Stopping unloads the model; the next
`/local-delegate` call auto-starts it again (~65 s cold load). Disabling would
break that auto-start. Stop only.
## Note on ollama
The stack can alternatively serve the same model via the `ollama` daemon (port
11434). If a request asks to free the GPU broadly and ollama has a model
resident, also run:
```bash
ollama stop qwen3-coder-30b-a3b-q5kxl 2>/dev/null || true
```
This skill's default scope is the llama.cpp path (`llama-server`), which is what
`local-coder` uses. Reach for the ollama stop only when ollama is the active
backend (`~/llm/scripts/use-ollama.sh` was run).
## See also
- [local-delegate](../local-delegate/SKILL.md) — when/how to *use* the local model.
- `~/llm/scripts/use-ollama.sh` — stops llama-server so ollama can take the GPU.
- `~/llm/scripts/use-llama-server.sh` — the inverse: load llama-server, free ollama.
+16
View File
@@ -0,0 +1,16 @@
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"enabledPlugins": {
"gopls-lsp@claude-plugins-official": true,
"rust-analyzer-lsp@claude-plugins-official": true
},
"autoUpdatesChannel": "stable",
"agentPushNotifEnabled": true,
"skipAutoPermissionPrompt": true,
"statusLine": {
"type": "command",
"command": "bash /home/daniel/.claude/statusline-command.sh"
}
}
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
# Claude Code statusLine — Catppuccin Mocha style matching starship.toml
# Structure: [CAP_L][seg1][WEDGE][seg2][WEDGE]...[segN][CAP_R]
input=$(cat)
# Catppuccin Mocha palette
red="#f38ba8"
peach="#fab387"
yellow="#f9e2af"
sapphire="#74c7ec"
lavender="#b4befe"
crust="#11111b"
RST=$'\033[0m'
BGDEF=$'\033[49m'
r_fg() { printf '\033[38;2;%d;%d;%dm' $((16#${1:1:2})) $((16#${1:3:2})) $((16#${1:5:2})); }
r_bg() { printf '\033[48;2;%d;%d;%dm' $((16#${1:1:2})) $((16#${1:3:2})) $((16#${1:5:2})); }
CAP_L=$'' # U+E0B6 — left rounded open cap
WEDGE=$'' # U+E0B0 — right-pointing filled arrow (between segments)
CAP_R=$'' # U+E0B4 — right rounded close cap
# Parse JSON input
cwd=$(printf '%s' "$input" | jq -r '.workspace.current_dir // .cwd // ""')
model=$(printf '%s' "$input" | jq -r '.model.display_name // .model.id // ""')
used_pct=$(printf '%s' "$input" | jq -r '.context_window.used_percentage // empty')
# Substitute $HOME → ~, then truncate to last 3 path segments (starship truncation_length=3)
display_cwd="${cwd/#$HOME/\~}"
truncated_cwd=$(printf '%s' "$display_cwd" | awk -F'/' '{
n=NF
if (n <= 3) { print $0 }
else { printf "…/%s/%s/%s", $(n-2), $(n-1), $n }
}')
# Git ref: prefer the worktree name, then the live branch, then a short SHA
git_branch=$(printf '%s' "$input" | jq -r '.worktree.name // .workspace.git_worktree // empty')
if [ -z "$git_branch" ]; then
git_branch=$(GIT_OPTIONAL_LOCKS=0 git -C "$cwd" symbolic-ref --short HEAD 2>/dev/null \
|| GIT_OPTIONAL_LOCKS=0 git -C "$cwd" rev-parse --short HEAD 2>/dev/null \
|| echo "")
fi
# Build segment list: parallel arrays of (color, icon, text)
declare -a colors=()
declare -a icons=()
declare -a texts=()
colors+=("$red"); icons+=($''); texts+=("$(whoami)") # Manjaro
colors+=("$peach"); icons+=($''); texts+=("$truncated_cwd") # folder
if [ -n "$git_branch" ]; then
colors+=("$yellow"); icons+=($''); texts+=("$git_branch") # git branch
fi
colors+=("$sapphire"); icons+=($''); texts+=("$model") # sparkle ✦
if [ -n "$used_pct" ]; then
ctx_display=$(printf "%.0f" "$used_pct")
if [ "$ctx_display" -ge 80 ]; then ctx_color="$red"; else ctx_color="$lavender"; fi
colors+=("$ctx_color"); icons+=($''); texts+=("${ctx_display}%") # clock
fi
# segment count via positional params — the brace-hash array-length form trips
# bombadil's Tera renderer, which treats brace-hash as a comment opener
set -- "${colors[@]}"; n=$#
for i in $(seq 0 $((n-1))); do
color="${colors[$i]}"
icon="${icons[$i]}"
text="${texts[$i]}"
if [ "$i" -eq 0 ]; then
# Very first segment: print left rounded opening cap
printf '%b' "$RST"
r_fg "$color"
printf '%s' "$CAP_L"
else
# Transition from previous segment: wedge (fg=prev color, bg=this color)
prev="${colors[$((i-1))]}"
r_bg "$color"
r_fg "$prev"
printf '%s' "$WEDGE"
fi
# Segment body
r_bg "$color"
r_fg "$crust"
printf ' %s %s ' "$icon" "$text"
done
# Right rounded closing cap after last segment
printf '%b' "$BGDEF"
r_fg "${colors[$((n-1))]}"
printf '%s' "$CAP_R"
printf '%b' "$RST"
+80
View File
@@ -0,0 +1,80 @@
---
name: desktop-coder
description: Run a focused coding subtask on the Qwen3-Coder-30B model hosted on the `desktop-local` machine (accessed via SSH), instead of a remote Anthropic model. Use when the task is well-scoped, mechanical, fits within ~16K tokens of total context, and doesn't need top-tier reasoning. Good fits — refactor a function, generate tests scaffolded from existing ones, format/normalize docstrings, mechanical lint fixes, scaffold boilerplate, translate a small function between languages. Bad fits — cross-file architectural changes, ambiguous requirements needing judgment, performance work needing measurement, anything requiring web research or `cargo run`. Saves Anthropic API tokens for the orchestrator's harder work.
tools: Bash
model: sonnet
---
# desktop-coder
Thin transport layer for the Qwen3-Coder model hosted on `desktop-local` (accessed via SSH). **You do not solve the task — even if you could answer it from your own knowledge.** Every invocation goes to the remote wrapper. The orchestrator chose `desktop-coder` over a direct response *because they want the remote model to do this work* — to save Anthropic tokens, to test the remote model, or to keep certain work off the remote API. Answering directly defeats the entire purpose.
## Tool budget — strict
- **Bash: exactly 1 call, always the SSH-wrapper invocation.** Non-negotiable. Even if the task is one line and you "know" the answer, route it through SSH to the remote wrapper. The wrapper is the *product* the orchestrator asked for — not a fallback path.
- **No other Bash.** No `ls`, no `cat`, no `rustc`, no `cargo`, no `wc`. The orchestrator runs validation commands after you return. File verification for remote-edited files is the orchestrator's job (via its own SSH).
- **No Read.** Files edited by the wrapper live on `desktop-local`, not on this machine. The orchestrator handles verification.
If you find yourself wanting a 2nd Bash call, stop and return what you have. More tool calls do not improve the report — they only add latency.
**Sanity check before responding**: count your tool uses. If Bash count != 1, you did the wrong thing — re-run with the SSH wrapper.
## Process
1. **Invoke the wrapper over SSH** in a single Bash call using a heredoc. Heredoc preserves newlines and shell-special chars cleanly; piping over SSH forwards stdin to the remote wrapper:
```bash
ssh desktop-local "bash -lc 'cd <CWD> && ~/llm/scripts/local-coder-task.sh [--profile <name>] [--minimal-prompt]'" <<'TASK'
<orchestrator's prompt verbatim, including any code fences>
TASK
```
**`bash -lc` is required.** Non-interactive SSH does not source `~/.bash_profile` / `~/.zshrc`, and the remote `claude` binary lives at `~/.local/bin/claude` which is only on PATH after a login-shell init. Plain `ssh desktop-local '<cmd>'` will fail with `claude: command not found`. Always wrap in `bash -lc '…'`.
**CWD on remote**: if the orchestrator's brief includes a `CWD:` line at the top (e.g. `CWD: /home/daniel/src/gamedev/zemyna`), use that path in the `cd` portion. Default if no `CWD:` line: `$HOME` (omit the `cd … &&` prefix entirely; the bash login shell starts there anyway).
**Wrapper flags** (optional, passed before the heredoc):
- `--profile <name>` — tool profile, controls `--allowed-tools` footprint on the remote claude session:
- `full` (default) — Read/Write/Edit/Grep/Glob + ~25 Bash patterns.
- `code` — Read/Write/Edit/Grep/Glob + cargo verification Bash only.
- `edit-only` — Read/Write/Edit/Grep/Glob, **no Bash** (~35K tokens saved).
- `read-only` — Read/Grep/Glob, no edits.
- `--minimal-prompt` — replace Claude's built-in system prompt with a ~1 KB minimal one (~812K tokens saved). Use for trusted orchestrator-spec'd mechanical tasks. Drops Claude's default safety/style guidance.
**How to pick flags**: if the orchestrator's brief includes a `WRAPPER FLAGS:` line at the top (e.g. `WRAPPER FLAGS: --profile=edit-only --minimal-prompt`), pass those flags verbatim and **strip the line from the task body** before piping. Same for `CWD:` — strip before piping. If no such line is present, invoke with defaults (full profile, default Claude prompt + tool-call-format append).
2. **If exit != 0**: return the structured report with `exit: <N>` and the wrapper's stderr verbatim. Stop. No retry.
3. **If exit == 0**: return the structured report (see below). Do **not** verify files — they live on `desktop-local`, and verification is the orchestrator's responsibility (via its own SSH calls).
## Final report
```
exit: <N>
host: desktop-local
files: <comma-separated list of files the model claimed to touch (paths on desktop-local), or "none">
output:
<verbatim wrapper stdout — no paraphrasing, no editing>
```
That's the whole report. No "verification notes" prose, no elapsed time (the runtime tracks it), no "model:" header (the orchestrator knows what model you wrap). The `host:` line is mandatory so the orchestrator never forgets the edits live on `desktop-local`, not locally.
## Hard rules
- **Verbatim output.** Never paraphrase or summarize the wrapper's stdout. The orchestrator wants raw model output.
- **No retry.** First-attempt failure → report and stop. The orchestrator decides whether to fall back to real Claude.
- **No scope expansion.** Ambiguous prompt → return `exit: 0`, `output: need clarification: <specific question>`. Do not guess.
- **Tool ceiling is binding.** 1 Bash call total. Going over is a bug, not thoroughness.
- **No file verification.** Files are on the remote host. The orchestrator verifies (via its own `ssh desktop-local cat …` or sync).
## Failure modes (surface to orchestrator, don't act on them)
| Exit | Cause | What you do |
|---|---|---|
| 255 | SSH itself failed (host unreachable, auth, etc.) | Report verbatim stderr, exit 255. |
| 2 | Remote stack down (llama-server / CCR failed to start) | Report verbatim stderr. |
| 1 | Remote child claude errored (CCR translation, context overflow, timeout) | Report verbatim stderr. |
| 0 + truncated output | Model hit max_tokens or got confused mid-stream | Report as-is. The orchestrator notices. |
| 0 + refusal text | Model said "I can't help" | Report as-is. |
| 0 + file claimed but no remote sync | Orchestrator's problem; just report the claimed paths in `files:`. | |
+246
View File
@@ -0,0 +1,246 @@
---
name: desktop-delegate
description: Decide when and how to delegate a focused coding subtask to the Qwen3-Coder-30B model hosted on the `desktop-local` machine (via SSH), routed through the `desktop-coder` subagent. Use when the task is well-scoped, mechanical, fits in ~16K context, and doesn't need top-tier reasoning — saves Anthropic API tokens for the orchestrator's harder work. Anti-patterns — cross-file architectural changes, ambiguous requirements, performance tuning, anything requiring `cargo run`, or work whose output must immediately be on this machine without an explicit sync step.
---
# /desktop-delegate
A decision-support skill for the orchestrator. Triage whether a subtask fits the Qwen3-Coder model running on `desktop-local`, and if so, hand it off via the `desktop-coder` subagent with a properly-shaped prompt.
## The remote stack
| Layer | What | Where |
|---|---|---|
| Host | `desktop-local` (daniel-desktop, Radeon RX 7900 XTX) | reached via `ssh desktop-local` |
| Model | Qwen3-Coder-30B-A3B-Instruct, UD-Q5_K_XL quant | `~/llm/models/` on desktop-local |
| Inference | llama.cpp with Vulkan/RADV | `systemctl --user … llama-server` (port 8080, desktop-local) |
| API translator | claude-code-router (Anthropic ↔ OpenAI) | `ccr` (port 3456, desktop-local) |
| Wrapper | One-shot `claude --print` with `ANTHROPIC_BASE_URL=ccr` | `~/llm/scripts/local-coder-task.sh` on desktop-local |
| Subagent | Haiku/Sonnet transport layer that SSHs + invokes the wrapper | `~/.claude/agents/desktop-coder.md` (here) |
**Performance**: ~135-140 tok/s decode on the remote, ~100-200 ms TTFT (plus ~50-200 ms SSH round-trip on first byte). 32K context (practical task budget ~16-20K leaves room for output).
## Important: cross-machine reality
The model runs on `desktop-local`. File edits, if any, land on `desktop-local`'s filesystem at the wrapper's CWD. This machine (`daniel-xps`) does not see those edits unless explicitly synced back.
- **Both machines have `~/src/gamedev/zemyna`**, but they are **independent checkouts**. An edit on one is not visible on the other.
- **Prefer text-output mode (Shape B/C)** — the model returns code in its stdout, the orchestrator applies the change here. No sync step needed.
- **If using file-edit mode (Shape A)**: the orchestrator is responsible for syncing back (`scp`, `rsync`, or `git pull` from a remote branch the desktop pushed). Mention this explicitly in the brief.
## ✅ Good fits
- **Mechanical refactors** — rename, extract helper, inline a constant, hoist a binding.
- **Boilerplate scaffolding** — new test file modeled on an existing one, getter/setter pairs, a CLI subcommand stub.
- **Format normalization** — rewrite docstrings to a target style, normalize import order, convert log macros.
- **Single-file changes** where the surrounding context fits in ~10K tokens.
- **Cross-language translation** — port a function from Python to Rust, convert XML config to TOML, etc.
- **Lint-driven fixes** where the lint message names the change ("inline this `format!`", "remove unused import").
- **Read-only inspection on the remote tree** — "summarize what module X does on desktop-local" (rarely useful — usually you want the analysis on this machine's tree).
## ❌ Bad fits — keep on real Claude
- **Cross-file architectural changes** — model can't hold enough context to reason about ripple effects.
- **Ambiguous requirements** — anything needing "well, depends on…" judgment.
- **Performance work** — needs bench data, knowledge of the existing perf budget, system-level reasoning.
- **Web research / external lookups** — no web access through this pipe.
- **`cargo run` / interactive smoke testing** — wrapper's `claude --print` is non-interactive; no UI.
- **PR creation, git commits, branch ops** — wrapper's Bash allowlist is read-only-ish for safety, and the relevant repo is on the wrong machine. Have the orchestrator handle git after the subagent returns.
- **Anything novel** — 30B model is fluent but doesn't have the depth on niche libraries / rare patterns.
- **Anything where the output must be on *this* machine immediately** without a sync step — prefer Shape B (text-only).
## How to invoke
### Shape A — task that writes/edits files on `desktop-local`
Use this when the remote model should produce file edits and the orchestrator is willing to sync them back afterward. Files land on **desktop-local**; not on this machine.
```
Agent({
subagent_type: "desktop-coder",
description: "<3-5 word summary>",
prompt: "
CWD: /home/daniel/src/gamedev/zemyna # path on desktop-local
Task: <one-paragraph description, imperative mood>
Files in scope (paths on desktop-local):
- <path>:<optional line range>
- <path>
Context (paste relevant snippets — keep under 8K tokens):
```<lang>
<relevant code>
```
Acceptance criteria:
- <bullet>
- <bullet>
Out of scope:
- <bullet — what NOT to touch>
- Don't run compile/test/lint checks — orchestrator will do that after you return.
"
})
```
**After the agent returns**, the orchestrator syncs edits back. Typical patterns:
```bash
# Single file
scp desktop-local:/home/daniel/src/gamedev/zemyna/crates/foo/src/bar.rs \
/home/daniel/src/gamedev/zemyna/crates/foo/src/bar.rs
# Multiple files / a subtree
rsync -av desktop-local:/home/daniel/src/gamedev/zemyna/crates/foo/ \
/home/daniel/src/gamedev/zemyna/crates/foo/
# Or: the desktop-local checkout commits + pushes a branch, then orchestrator pulls
```
If the orchestrator is not prepared to do this, use **Shape B** instead.
### Shape B — task that returns text only (no file writes)
Use this when you want analysis, an explanation, a code snippet for the orchestrator to apply itself, or a summary. The model writes nothing on the remote — output comes back in the wrapper's stdout. No sync step needed.
```
Agent({
subagent_type: "desktop-coder",
description: "<3-5 word summary>",
prompt: "
Task: <one-paragraph description, imperative mood>
Context (paste relevant snippets — keep under 8K tokens):
```<lang>
<relevant code>
```
Output format:
- <e.g., 'one Rust function, no markdown fences, no explanation'>
- <e.g., 'bullet list of files that match the pattern, one per line'>
Out of scope:
- Don't write any files. Return your answer as plain text only.
- Don't run any commands.
"
})
```
**Concrete no-edit examples**:
- *Explain*: "Explain in 4 sentences what this function does (pasted below). Output: 4 sentences, plain text, no headings."
- *Snippet for orchestrator to paste*: "Write a Rust closure equivalent to this Python lambda: `lambda x, y: x * 2 + y`. Output: only the closure, one line, no `let` binding."
- *Translation*: "Translate this SQL `WHERE` clause to a `serde_json::Value` filter expression. Output: only the Rust expression."
### Shape C — direct Bash SSH, no subagent (guaranteed routing)
Use this when you need a **hard guarantee** the remote model actually ran — typically because the task is trivial enough that the subagent might decide to answer it directly from its own knowledge instead of invoking the wrapper. (Sonnet-as-subagent follows multi-paragraph rules ~95% of the time, but trivial one-liner tasks tempt any model to shortcut.)
You give up the subagent's structured report; you pay one Bash call's worth of orchestrator context for the wrapper's raw output.
```
Bash({
command: "ssh desktop-local \"bash -lc '~/llm/scripts/local-coder-task.sh'\" <<'TASK'\n<your task here>\nTASK\n",
description: "force-route through desktop model"
})
```
**`bash -lc` is required.** Non-interactive SSH does not source `~/.bash_profile`, so the remote `claude` binary (at `~/.local/bin/claude`) is not on PATH. The login shell sources it. Always wrap in `bash -lc '…'`.
The wrapper's stdout becomes the Bash result. You parse it yourself.
**When Shape C is the right call**:
- The task is one-liner-trivial (e.g., "convert this Python lambda to Rust").
- You're benchmarking the remote model and need every call to actually hit it.
- You're testing the remote stack (smoke test, latency measurement, output-format check).
- You suspect the subagent will shortcut because the task is too easy.
**When Shape A or B is still better**:
- Real coding subtasks where a structured report is useful.
- Tasks where the brief is long and you don't want to manage SSH heredoc escaping yourself.
### Quick decision tree
```
Task fits the remote model? ── no ──> keep on real Claude
yes
Will the model write files? ── yes ──> Shape A (subagent, sync back after)
│ └── If you can't or don't want to sync, use Shape B instead.
no
Is the task trivial enough that the
subagent might answer directly? ── yes ──> Shape C (direct Bash SSH, guaranteed)
no
└──> Shape B (subagent, text-only output)
```
## Pre-flight checklist (orchestrator side)
Before invoking, mentally check:
1. **Sizing** — can the task be described in <500 tokens + ≤8K tokens of context? If no, scope-split or keep on real Claude.
2. **Cohesion** — is the task contained to 1-3 files? If it sprawls, keep on real Claude.
3. **Verifiability** — can you state an objective acceptance criterion (a passing test, a successful build, a grep returning N hits)? If you can't state how you'd know it worked, don't delegate.
4. **Recoverability** — if the remote model produces wrong output, can you `git checkout -- <files>` and try again on real Claude? If not (e.g., it's a brand-new file), reduce blast radius first.
5. **Cross-machine sync** — for Shape A, do you have a clear plan to pull the edits back? If not, downshift to Shape B.
## Stack health (drop into a Bash if unsure)
```bash
ssh desktop-local 'curl -sf http://127.0.0.1:8080/health' # llama-server (loads model on first start, ~65 s cold)
ssh desktop-local 'ccr status' # CCR
ssh desktop-local 'systemctl --user status llama-server' # if either above fails
```
The wrapper auto-starts both if missing. But on cold start, the first call takes ~65 s for model load. Subsequent calls (within the 30-min keep-alive) are warm.
## SSH health
If `ssh desktop-local …` itself fails, none of this works. Quick sanity:
```bash
ssh -o ConnectTimeout=3 desktop-local 'echo ok'
```
The hostname `desktop-local` must resolve (mDNS / `/etc/hosts` / SSH config) and the user must be able to log in non-interactively (key-based auth). If you get an interactive password prompt in a Bash call, the subagent will hang — fix auth before delegating.
## Failure handling
| Symptom | Likely cause | Action |
|---|---|---|
| Exit 255 — SSH error | Host unreachable, key auth not set up, hostname not resolving | Fix connectivity. Don't retry on real Claude (this isn't a capability issue). |
| Wrapper exit 2 — "llama-server failed health check" | Model load failed on remote (GPU contention, OOM) | `ssh desktop-local journalctl --user -u llama-server --since '5 min ago'`. Often: another GPU consumer started. `ssh desktop-local ~/llm/scripts/use-llama-server.sh` to force-restart clean. |
| Wrapper exit 1 — claude session error | CCR translation issue or context overflow on remote | Check `~/.claude-code-router/` logs on remote. Shrink the prompt context, retry. |
| Clean exit, output references edits that aren't there | Remote model hallucinated the edit | Fall back to real Claude. (No subagent verification step here — orchestrator verifies via its own SSH if Shape A was used.) |
| Clean exit, output is mid-sentence cut | Hit max_tokens or context overflow | Reduce prompt size and retry, OR raise max_tokens in the wrapper on desktop-local. |
| Repeated/looping output | Sampling broke (rare with our config) | Retry on real Claude — don't iterate on remote. |
## Anti-patterns
- **Don't retry the same task on the remote.** If first attempt fails, fall back to real Claude. Iterating burns wall clock without fixing the underlying capability gap.
- **Don't chain remote subagents.** Sequential remote calls compound error rate. Use real Claude as the connecting tissue.
- **Don't pass the orchestrator's full CLAUDE.md / rules context.** Wrapper uses `--bare` precisely to avoid this — the remote model gets a clean context. Pass only the task-relevant context inline.
- **Don't delegate work you wouldn't trust a junior dev to do with the same brief.** If the brief itself requires deep project knowledge to write correctly, the implementer needs it too.
- **Don't forget Shape A edits live on the *other* machine.** "I delegated, why doesn't the file have my change?" — because it's on desktop-local. Sync back.
## CLI usage (outside Claude Code)
Useful for testing the SSH path and remote stack without spawning a subagent:
```bash
echo "Write a Rust function that reverses a string in-place." \
| ssh desktop-local "bash -lc '~/llm/scripts/local-coder-task.sh'"
```
Output goes to stdout. Same env, same flags as what the subagent uses.
## See also
- `~/.claude/agents/desktop-coder.md` — the subagent profile (this machine)
- `~/llm/scripts/local-coder-task.sh` — the wrapper, hosted on `desktop-local`
- `desktop-local:~/.claude/skills/local-delegate/SKILL.md` — the original local-only sibling skill (running this skill from the desktop itself)
-1
View File
@@ -3,4 +3,3 @@ alacritty_theme = "Catppuccin-Macchiato"
helix_theme = "catppuccin_mocha"
zellij_theme = "catppuccin-macchiato"
bat_theme = "Catppuccin Mocha"
yazi_flavor = "catppuccin-mocha"
+1
View File
@@ -12,3 +12,4 @@ tmp/**/*
.pryrc
.psqlrc
.helix/
.claude/settings.local.json
+18 -1
View File
@@ -23,8 +23,25 @@ wrap-at-text-width = true
center = ["version-control"]
[keys.normal]
C-r = ":config-reload"
C-R = ":config-reload"
_ = { n = ":set whitespace.render none", a = ":set whitespace.render all" }
# Git integration with lazygit
A-g = [
":write-all",
":insert-output lazygit >/dev/tty",
":redraw",
":reload-all"
]
# Search and replace with scooter
C-r = [
":write-all",
":insert-output scooter >/dev/tty",
":redraw",
":reload-all"
]
[keys.normal.space]
i = ":toggle lsp.display-inlay-hints"
+15
View File
@@ -3,9 +3,24 @@ name = "env"
scope = "text.env"
file-types = ["test", "local", "development", "staging", "production", "example", "env"]
[[language]]
name = "java"
file-types = ["java", "jav", "pde", "painless"]
[language-server.rust-analyzer.config.check]
command = "clippy"
[[language]]
name = "go"
auto-format = true
language-servers = [ "gopls", "golangci-lint-lsp" ]
[language-server.golangci-lint-lsp]
command = "golangci-lint-langserver"
[language-server.golangci-lint-lsp.config]
command = ["golangci-lint", "run", "--output.json.path", "stdout", "--show-stats=false", "--issues-exit-code=1"]
# It is recommended to place the necessary configurations below inside a project's
# .helix/languages.toml directory
#
-1
View File
@@ -3,4 +3,3 @@ alacritty_theme = "Catppuccin-Latte"
helix_theme = "catppuccin_latte"
zellij_theme = "catppuccin-latte"
bat_theme = "Catppuccin Latte"
yazi_flavor = "catppuccin-latte"
+289
View File
@@ -0,0 +1,289 @@
"$schema" = 'https://starship.rs/config-schema.json'
format = """
[](red)\
$os\
$username\
[](bg:peach fg:red)\
$directory\
[](bg:yellow fg:peach)\
$git_branch\
$git_status\
[](fg:yellow bg:green)\
$c\
$rust\
$golang\
$nodejs\
$bun\
$php\
$java\
$kotlin\
$haskell\
$python\
[](fg:green bg:sapphire)\
$conda\
[](fg:sapphire bg:lavender)\
$time\
[ ](fg:lavender)
$cmd_duration\
$line_break\
$jobs\
$character"""
palette = 'catppuccin_mocha'
[jobs]
symbol = "⎔ "
[os]
disabled = false
style = "bg:red fg:crust"
[os.symbols]
Windows = ""
Ubuntu = "󰕈"
SUSE = ""
Raspbian = "󰐿"
Mint = "󰣭"
Macos = "󰀵"
Manjaro = ""
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "󰣛"
Alpine = ""
Amazon = ""
Android = ""
AOSC = ""
Arch = "󰣇"
Artix = "󰣇"
CentOS = ""
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"
[username]
show_always = true
style_user = "bg:red fg:crust"
style_root = "bg:red fg:crust"
format = '[ $user]($style)'
[directory]
style = "bg:peach fg:crust"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = "󰝚 "
"Pictures" = " "
"Developer" = "󰲋 "
[git_branch]
symbol = ""
style = "bg:yellow"
format = '[[ $symbol $branch ](fg:crust bg:yellow)]($style)'
[git_status]
style = "bg:yellow"
format = '[[($all_status$ahead_behind )](fg:crust bg:yellow)]($style)'
[nodejs]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[bun]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[c]
symbol = " "
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[rust]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[golang]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[php]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[java]
symbol = " "
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[kotlin]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[haskell]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
[python]
symbol = ""
style = "bg:green"
format = '[[ $symbol( $version)(\(#$virtualenv\)) ](fg:crust bg:green)]($style)'
[docker_context]
symbol = ""
style = "bg:sapphire"
format = '[[ $symbol( $context) ](fg:crust bg:sapphire)]($style)'
[conda]
symbol = "  "
style = "fg:crust bg:sapphire"
format = '[$symbol$environment ]($style)'
ignore_base = false
[time]
disabled = false
time_format = "%R"
style = "bg:lavender"
format = '[[  $time ](fg:crust bg:lavender)]($style)'
[line_break]
disabled = true
[character]
disabled = false
success_symbol = '[](bold fg:green)'
error_symbol = '[](bold fg:red)'
vimcmd_symbol = '[](bold fg:green)'
vimcmd_replace_one_symbol = '[](bold fg:lavender)'
vimcmd_replace_symbol = '[](bold fg:lavender)'
vimcmd_visual_symbol = '[](bold fg:yellow)'
[cmd_duration]
show_milliseconds = true
format = " in $duration "
style = "bg:lavender"
disabled = false
show_notifications = true
min_time_to_notify = 45000
[palettes.catppuccin_mocha]
rosewater = "#f5e0dc"
flamingo = "#f2cdcd"
pink = "#f5c2e7"
mauve = "#cba6f7"
red = "#f38ba8"
maroon = "#eba0ac"
peach = "#fab387"
yellow = "#f9e2af"
green = "#a6e3a1"
teal = "#94e2d5"
sky = "#89dceb"
sapphire = "#74c7ec"
blue = "#89b4fa"
lavender = "#b4befe"
text = "#cdd6f4"
subtext1 = "#bac2de"
subtext0 = "#a6adc8"
overlay2 = "#9399b2"
overlay1 = "#7f849c"
overlay0 = "#6c7086"
surface2 = "#585b70"
surface1 = "#45475a"
surface0 = "#313244"
base = "#1e1e2e"
mantle = "#181825"
crust = "#11111b"
[palettes.catppuccin_frappe]
rosewater = "#f2d5cf"
flamingo = "#eebebe"
pink = "#f4b8e4"
mauve = "#ca9ee6"
red = "#e78284"
maroon = "#ea999c"
peach = "#ef9f76"
yellow = "#e5c890"
green = "#a6d189"
teal = "#81c8be"
sky = "#99d1db"
sapphire = "#85c1dc"
blue = "#8caaee"
lavender = "#babbf1"
text = "#c6d0f5"
subtext1 = "#b5bfe2"
subtext0 = "#a5adce"
overlay2 = "#949cbb"
overlay1 = "#838ba7"
overlay0 = "#737994"
surface2 = "#626880"
surface1 = "#51576d"
surface0 = "#414559"
base = "#303446"
mantle = "#292c3c"
crust = "#232634"
[palettes.catppuccin_latte]
rosewater = "#dc8a78"
flamingo = "#dd7878"
pink = "#ea76cb"
mauve = "#8839ef"
red = "#d20f39"
maroon = "#e64553"
peach = "#fe640b"
yellow = "#df8e1d"
green = "#40a02b"
teal = "#179299"
sky = "#04a5e5"
sapphire = "#209fb5"
blue = "#1e66f5"
lavender = "#7287fd"
text = "#4c4f69"
subtext1 = "#5c5f77"
subtext0 = "#6c6f85"
overlay2 = "#7c7f93"
overlay1 = "#8c8fa1"
overlay0 = "#9ca0b0"
surface2 = "#acb0be"
surface1 = "#bcc0cc"
surface0 = "#ccd0da"
base = "#eff1f5"
mantle = "#e6e9ef"
crust = "#dce0e8"
[palettes.catppuccin_macchiato]
rosewater = "#f4dbd6"
flamingo = "#f0c6c6"
pink = "#f5bde6"
mauve = "#c6a0f6"
red = "#ed8796"
maroon = "#ee99a0"
peach = "#f5a97f"
yellow = "#eed49f"
green = "#a6da95"
teal = "#8bd5ca"
sky = "#91d7e3"
sapphire = "#7dc4e4"
blue = "#8aadf4"
lavender = "#b7bdf8"
text = "#cad3f5"
subtext1 = "#b8c0e0"
subtext0 = "#a5adcb"
overlay2 = "#939ab7"
overlay1 = "#8087a2"
overlay0 = "#6e738d"
surface2 = "#5b6078"
surface1 = "#494d64"
surface0 = "#363a4f"
base = "#24273a"
mantle = "#1e2030"
crust = "#181926"
Submodule yazi/flavors deleted from 68326b4ca4
-3
View File
@@ -1,3 +0,0 @@
[flavor]
dark = "{{yazi_flavor}}"
light = "{{yazi_flavor}}"
+7 -303
View File
@@ -1,286 +1,10 @@
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
normal {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
}
resize {
bind "Ctrl n" { SwitchToMode "Normal"; }
bind "h" "Left" { Resize "Increase Left"; }
bind "j" "Down" { Resize "Increase Down"; }
bind "k" "Up" { Resize "Increase Up"; }
bind "l" "Right" { Resize "Increase Right"; }
bind "H" { Resize "Decrease Left"; }
bind "J" { Resize "Decrease Down"; }
bind "K" { Resize "Decrease Up"; }
bind "L" { Resize "Decrease Right"; }
bind "=" "+" { Resize "Increase"; }
bind "-" { Resize "Decrease"; }
}
pane {
bind "Ctrl p" { SwitchToMode "Normal"; }
bind "h" "Left" { MoveFocus "Left"; }
bind "l" "Right" { MoveFocus "Right"; }
bind "j" "Down" { MoveFocus "Down"; }
bind "k" "Up" { MoveFocus "Up"; }
bind "p" { SwitchFocus; }
bind "n" { NewPane; SwitchToMode "Normal"; }
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
}
move {
bind "Ctrl h" { SwitchToMode "Normal"; }
bind "n" "Tab" { MovePane; }
bind "h" "Left" { MovePane "Left"; }
bind "j" "Down" { MovePane "Down"; }
bind "k" "Up" { MovePane "Up"; }
bind "l" "Right" { MovePane "Right"; }
}
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "Normal"; }
bind "x" { CloseTab; SwitchToMode "Normal"; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
scroll {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
search {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
bind "n" { Search "down"; }
bind "p" { Search "up"; }
bind "c" { SearchToggleOption "CaseSensitivity"; }
bind "w" { SearchToggleOption "Wrap"; }
bind "o" { SearchToggleOption "WholeWord"; }
}
entersearch {
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
bind "Enter" { SwitchToMode "Search"; }
}
renametab {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
}
renamepane {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
}
session {
bind "Ctrl o" { SwitchToMode "Normal"; }
bind "Ctrl s" { SwitchToMode "Scroll"; }
bind "d" { Detach; }
}
tmux {
bind "[" { SwitchToMode "Scroll"; }
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "c" { NewTab; SwitchToMode "Normal"; }
bind "," { SwitchToMode "RenameTab"; }
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
bind "n" { GoToNextTab; SwitchToMode "Normal"; }
bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
bind "o" { FocusNextPane; }
bind "d" { Detach; }
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
bind "Ctrl q" { Quit; }
bind "Alt n" { NewPane; }
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
bind "Alt =" "Alt +" { Resize "Increase"; }
bind "Alt -" { Resize "Decrease"; }
}
shared_except "normal" "locked" {
bind "Enter" "Esc" { SwitchToMode "Normal"; }
}
shared_except "pane" "locked" {
bind "Ctrl p" { SwitchToMode "Pane"; }
}
shared_except "resize" "locked" {
bind "Ctrl n" { SwitchToMode "Resize"; }
}
shared_except "scroll" "locked" {
bind "Ctrl s" { SwitchToMode "Scroll"; }
}
shared_except "session" "locked" {
bind "Ctrl o" { SwitchToMode "Session"; }
}
shared_except "tab" "locked" {
bind "Ctrl t" { SwitchToMode "Tab"; }
}
shared_except "move" "locked" {
bind "Ctrl h" { SwitchToMode "Move"; }
}
shared_except "tmux" "locked" {
bind "Ctrl b" { SwitchToMode "Tmux"; }
}
}
plugins {
tab-bar { path "tab-bar"; }
status-bar { path "status-bar"; }
strider { path "strider"; }
compact-bar { path "compact-bar"; }
}
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
// - detach (Default)
// - quit
//
// on_force_close "quit"
// Send a request for a simplified ui (without arrow fonts) to plugins
// Options:
// - true
// - false (Default)
//
// simplified_ui true
// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
// default_shell "fish"
// Toggle between having pane frames around the panes
// Options:
// - true (default)
// - false
//
// pane_frames true
// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
// dracula {
// fg 248 248 242
// bg 40 42 54
// red 255 85 85
// green 80 250 123
// yellow 241 250 140
// blue 98 114 164
// magenta 255 121 198
// orange 255 184 108
// cyan 139 233 253
// black 0 0 0
// white 255 255 255
// }
// }
// themes {
// bogster-dark {
// bg "#161C23"
// fg "#C6B8AD"
// black "#161C23"
// red "#D32C5D"
// green "#57A331"
// orange "#DC7759"
// yellow "#DCB659"
// blue "#36B2D4"
// magenta "#B759DC"
// cyan "#23A580"
// white "#C6B8AD"
// }
// }
// Choose the theme that is specified in the themes section.
// Default: default
//
// theme "default"
theme "{{zellij_theme}}"
// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"
// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"
// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
// - true (default)
// - false
//
// mouse_mode false
// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
// scroll_buffer_size 10000
// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy" // wayland
// copy_command "pbcopy" // osx
default_layout "compact"
// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
@@ -288,30 +12,10 @@ theme "{{zellij_theme}}"
// Options:
// - system (default)
// - primary
//
// copy_clipboard "primary"
copy_clipboard "primary"
// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
// copy_on_select false
// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"
// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true
// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"
// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"
// Toggle between having pane frames around the panes
// Options:
// - true (default)
// - false
pane_frames false
-87
View File
@@ -1,87 +0,0 @@
layout {
pane_template name="explorer" {
pane split_direction="vertical" {
pane size="14%" borderless=true command="zsh" {
args "-i" "-c" "exex"
}
children
}
}
pane_template name="sidebar-pane" {
pane size="24%" split_direction="horizontal" { children; }
}
pane_template name="console-pane" {
pane size="28%" split_direction="vertical" { children; }
}
pane_template name="stacked-console-pane" {
pane size="28%" stacked=true { children; }
}
tab_template name="project-tab" {
pane size=1 borderless=true { plugin location="zellij:compact-bar"; }
children
}
default_tab_template {
pane size=1 borderless=true { plugin location="zellij:compact-bar"; }
explorer { pane focus=true; }
}
swap_tiled_layout name="ide" {
project-tab max_panes=3 {
explorer { pane; }
}
project-tab exact_panes=4 {
explorer { pane; }
console-pane split_direction="vertical" size="28%" { pane; }
}
project-tab exact_panes=5 {
explorer { pane; }
console-pane split_direction="vertical" size="28%" {
pane
pane
}
}
project-tab exact_panes=6 {
explorer { pane; }
stacked-console-pane stacked=true size="28%" {
pane
pane
pane
}
}
project-tab exact_panes=7 {
explorer split_direction="vertical" {
pane
sidebar-pane size="24%" { pane borderless=true; }
}
stacked-console-pane stacked=true size="28%" {
pane
pane
pane
}
}
project-tab min_panes=8 {
explorer {
pane split_direction="vertical" {
pane
pane
pane
}
pane split_direction="vertical" {
pane
pane
pane
}
pane split_direction="vertical" {
pane
pane
pane
}
}
}
}
}
+4
View File
@@ -0,0 +1,4 @@
# Enable goenv if it is installed
# if (( $+commands[goenv] )); then
# eval "$(goenv init -)"
# fi
+5 -6
View File
@@ -1,7 +1,6 @@
# NVM
if [[ -s "$NVM_DIR/nvm.sh" ]]; then
source "$NVM_DIR/nvm.sh" # This loads nvm
fi
if [[ -s "$NVM_DIR/bash_completion" ]]; then
source "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Enable nvm if it is installed
if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
fi
+4
View File
@@ -0,0 +1,4 @@
# Enable rbenv if it is installed
if (( $+commands[rbenv] )); then
eval "$(rbenv init - --no-rehash zsh)"
fi
+9
View File
@@ -0,0 +1,9 @@
# Allow Ctrl-z to toggle between suspend and resume
function Resume {
fg
zle push-input
BUFFER=""
zle accept-line
}
zle -N Resume
bindkey "^Z" Resume
+19 -17
View File
@@ -1,32 +1,34 @@
# zellij
if (( $+commands[zellij] )); then
ZELLIJ_AUTO_ATTACH=true
eval "$(zellij setup --generate-auto-start zsh)"
# Uncomment to start/exit zellij automatically
# ZELLIJ_AUTO_ATTACH=true
# ZELLIJ_AUTO_EXIT=true
# eval "$(zellij setup --generate-auto-start zsh)"
if (( $+commands[sk] )); then
za() {
function za {
local zj_sessions=$(zellij list-sessions -ns)
local no_sessions=$(echo "${zj_sessions}" | wc -l)
if [ "${no_sessions}" -ge 2 ]; then
zellij attach \
"$(echo "${zj_sessions}" | sk)"
zellij attach \
"$(echo "${zj_sessions}" | sk)"
else
zellij attach -c
zellij attach -c
fi
}
fi
ide() {
local layout="${ZELLIJ_LAYOUT:-${HOME}/.config/zellij/layouts/project.kdl}"
local name="${PROJECT_NAME:-/}"
# Name tabs after current working directory
if [[ -v ZELLIJ ]]; then
function zrt {
zellij action rename-tab "${PWD##*/}"
}
if (( ${+ZELLIJ} )); then
# FIXME: https://github.com/zellij-org/zellij/issues/2299
zellij action new-tab --layout "${layout}" --cwd "${PWD}" --name "${name}"
else
zellij --layout "${layout}" --session "${name}"
fi
}
function znt {
zellij action new-tab
}
chpwd_functions+=( zrt )
fi
fi
+11 -17
View File
@@ -1,30 +1,24 @@
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/docker.sock"
export DOCKER_SOCKET="$XDG_RUNTIME_DIR/docker.sock"
export EDITOR="helix"
# export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/docker.sock"
# export DOCKER_SOCKET="$XDG_RUNTIME_DIR/docker.sock"
if (( $+commands[hx] )); then
export EDITOR="hx"
export VISUAL="hx"
elif (( $+commands[helix] )); then
export EDITOR="helix"
export VISUAL="helix"
fi
export FINDER="sk"
export GPG_TTY=$(tty)
export HELIX_RUNTIME="$HOME/src/helix/runtime"
export HELIX_RUNTIME="/usr/lib/helix/runtime"
export NVM_DIR="$HOME/.nvm"
export SKIM_DEFAULT_COMMAND="git ls-tree -r --name-only HEAD || rg --files"
export VISUAL="helix"
fpath+=(~/.zsh/completions)
# Setup cargo
[[ -s ~/.cargo/env ]] && source ~/.cargo/env
# Local gems
if (( $+commands[ruby] )); then
local gem_bin_path="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
[[ -d "$gem_bin_path" ]] && path+=("$gem_bin_path")
fi
# Setup go paths
if (( $+commands[go] )); then
local go_bin_path="$(go env GOPATH)/bin"
[[ -d "$go_bin_path" ]] && path+=("$go_bin_path")
fi
if (( $+commands[fd] )); then
export FZF_DEFAULT_COMMAND="fd --type f"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
+1 -1
View File
@@ -1,7 +1,7 @@
# Option adjustments
unsetopt nomatch
# Swap CAPSLOCK and ESC
# Swap CAPSLOCK and ESC (keyd is a better option)
setxkbmap -option caps:swapescape
# conf.d style configurations