modscode / Code / Add a slash command
Add a slash command ($.command.register)
A Markdown file in .claude/commands/ only saves a prompt; a mod's command runs code. Call $.command.register({ name, description }) in session.start, handle on('command.run', { command: name }), and return { text } (or {} to print nothing). Commands often open a pane.
The smallest form
export function register(on) {
on('session.start', async ($, e, next) => {
await $.command.register({ name: 'standup', description: 'Summarize what changed today', argumentHint: '[days]' })
return next(e)
})
on('command.run', { command: 'standup' }, async ($, e) => {
const days = e.args || '1'
const log = await $.process.run(['git', 'log', '--oneline', '--since=' + days + '.days'])
return { text: log.stdout || 'Nothing changed.' }
})
}
Written by modscode with the API of the official docs. Free to use.
Real mods' code (6)
Quoted as is from public mods on GitHub, at the commit the gallery read. The heading leads to the mod's page (what it does, its good points, its design, what its code reaches); the file name leads to the lines on GitHub.
Check the code yourself before you copy or install it. Mods run unsandboxed, with your permissions. modscode does not vouch for what the code does.
better-statusline Ewen Gao · Terminal + desktop · ★ 135
The status line above the prompt: the session's status and the music playing, one design
on('session.start', async ($, e, next) => {
const started = await next(e)
if (!e.isInteractive) return started
await Promise.all([
$.command.register({ name: 'fold', description: 'Fold the status line into one row, or open it to five', immediate: true }),
seed($),
])
void readGit($)
plan($)
watchAgents($)
$.clock.every(60_000, () => void readGit($))
void setUp($, options as Options).then(machine => (machine.folder === null ? undefined : listen($)))
return started
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2026 Ewen Gao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
intermission Jarrod Watts · Terminal + desktop · ★ 99
Play Doom deathmatch while Claude works, and get handed back when it's done
on('session.start', async ($, e, next) => {
isOn = (await $.store.get('isOn')) === true
name = await $.store.get('name')
if (!name) {
name = randomName()
await $.store.set('name', name)
}
await $.command.register({
name: 'intermission',
description: 'Play Doom while Claude works',
argumentHint: '[off]',
})
return next(e)
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2026 Jarrod Watts Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ruflo-rag-memory ruvnet · Hooks only · ★ 73986
RuVector memory with HNSW search, AgentDB, and semantic retrieval. As a mod (ADR-445): a write guard that keeps secrets out of memory, /rag-mod, and a status file the console shows
on('session.start', async ($, e, next) => {
const result = await next(e)
try {
s.root = (await $.session.root()) as string | undefined
} catch {
/* no project root: the mod still answers, it just writes no status file */
}
try {
await $.command.register({ name: 'rag-mod', description: 'ruflo-rag-memory mod: status, scan <text>, tools' })
} catch {
/* a name taken by another plugin must not stop the mod */
}
await flush($, s)
return result
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2024-2026 ruvnet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ruflo-ruvllm ruvnet · Hooks only · ★ 73986
RuVLLM local inference with chat formatting (Claude/GPT/Gemini/Ollama/Cohere), model configuration, MicroLoRA fine-tuning, and SONA real-time adaptation. As a mod (ADR-445): a guard that keeps secrets out of adapters and the pattern router…
on('session.start', async ($, e, next) => {
const result = await next(e)
try {
s.root = (await $.session.root()) as string | undefined
} catch {
/* no project root: the mod still answers, it just writes no status file */
}
try {
await $.command.register({ name: 'ruvllm-mod', description: 'ruflo-ruvllm mod: status, scan <text>, tools' })
} catch {
/* a name taken by another plugin must not stop the mod */
}
await flush($, s)
return result
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2024-2026 ruvnet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ruflo-ruvector ruvnet · Hooks only · ★ 73986
Self-learning vector database via npx ruvector@0.2.25 — HNSW, adaptive LoRA embeddings, code-graph clustering, hooks routing, brain/SONA, 103 MCP tools. As a mod (ADR-445): a write guard that keeps secrets out of the vector store and share…
on('session.start', async ($, e, next) => {
const result = await next(e)
try {
s.root = (await $.session.root()) as string | undefined
} catch {
/* no project root: the mod still answers, it just writes no status file */
}
try {
await $.command.register({ name: 'ruvector-mod', description: 'ruflo-ruvector mod: status, scan <text>, tools' })
} catch {
/* a name taken by another plugin must not stop the mod */
}
await flush($, s)
return result
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2024-2026 ruvnet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ruflo-rvf ruvnet · Hooks only · ★ 73986
RVF format for portable agent memory, session persistence, and cross-platform transfer. As a mod (ADR-445): a write guard that keeps secrets out of memory, sessions and transfers, /rvf-mod, and a status file the console shows
on('session.start', async ($, e, next) => {
const result = await next(e)
try {
s.root = (await $.session.root()) as string | undefined
} catch {
/* no project root: the mod still answers, it just writes no status file */
}
try {
await $.command.register({ name: 'rvf-mod', description: 'ruflo-rvf mod: status, scan <text>, tools' })
} catch {
/* a name taken by another plugin must not stop the mod */
}
await flush($, s)
return result
})MIT licence. Keep its notice when you copy the code. Its code and design
Licence text (MIT)
MIT License Copyright (c) 2024-2026 ruvnet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Start building
Put a .claude-plugin/plugin.json ({"name": "my-mod"}) and a hooks/hooks.json ({"modules": ["register.js"]}) in a folder, save the code above as hooks/register.js, and run claude --plugin-dir . to load it for one session. claude plugin validate . lists the events it hooks and the APIs it calls.