shell-builtins SKILL.md skillA
shell-builtins from charmbracelet/crush is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add charmbracelet/crush/shell-builtins@git:20260427.af002dcPins git:20260427.af002dc in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- charmbracelet/crush
- Path
.agents/skills/shell-builtins/SKILL.md- Versions recorded
- 3
- Latest version
- git:20260427.af002dc, committed Apr 27, 2026
- First version recorded
- Apr 16, 2026
- Size
- 3,163 bytes
- Repository stars
- 29,003
- License
- a license file GitHub does not identify
Use when creating a new shell builtin command for Crush (internal/shell/), editing an existing one, or when the user needs to understand how commands are intercepted in Crush's embedded shell.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Shell Builtins
Crush's shell (`internal/shell/`) uses `mvdan.cc/sh/v3` for POSIX shell
emulation. Commands can be intercepted before they reach the OS by adding
**builtins** — functions handled in-process.
## How Builtins Work
Builtins live in `builtinHandler()` in `internal/shell/run.go`. This is an
`interp.ExecHandlerFunc` middleware registered in `standardHandlers()`
**before** the block handler, so builtins run even for commands that would
otherwise be blocked. The same handler chain is shared by the stateful
`Shell` type and the stateless `Run` entrypoint used by the hook runner,
so builtins are available identically in the `bash` tool and in hooks.
The handler is a switch on `args[0]`. Each case either handles the command
inline or delegates to a helper function.
## Adding a New Builtin
1. **Add the case** to the switch in `builtinHandler()` in `run.go`.
2. **Get I/O from the handler context**, not from `os.Stdin`/`os.Stdout`.
This ensures the builtin works with pipes and redirections:
```go
case "mycommand":
hc := interp.HandlerCtx(ctx)
return handleMyCommand(ctx, args, hc.Stdin, hc.Stdout, hc.Stderr)
```
…Read the whole file at its exact version.
How to install
mdr add charmbracelet/crush/shell-builtins@sha256:cf06499c315c8fabThe line at the top of this page pins the label git:20260427.af002dc, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_evmwqjszcuduk2gn)
4 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between Apr 16, 2026 and Apr 27, 2026, about one every 5 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260427.af002dc latest | 2026-04-27 | af002dc | 3,163 B | A | view · diff |
| git:20260420.0a86d5f | 2026-04-20 | 0a86d5f | 2,098 B | A | view · diff |
| git:20260416.3773b23 | 2026-04-16 | 3773b23 | 2,145 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3163 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
charmbracelet/crush · 29,003 stars · license a license file GitHub does not identify · pushed 2026-11-08 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_evmwqjszcuduk2gn GET https://markdownregistry.com/api/v1/resolve?ref=charmbracelet/crush/shell-builtins GET https://markdownregistry.com/api/v1/blob/cf06499c315c8fab0d1be7a9454ab044189e8e2ba4367f7009795f41f181bbee
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.