creating-mods

Creates and edits trusted local Letta Code mod files with tools, commands, events, and providers.

3.2k|385|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/letta-ai/letta-code --skill creating-mods
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-mods
Source: https://github.com/letta-ai/letta-code/tree/main/src/skills/builtin/creating-mods
Command: npx skills add https://github.com/letta-ai/letta-code --skill creating-mods

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Extending Letta Code with custom behavior requires knowing which mod capability to use, where to place the mod file, and how to guard registrations across host surfaces that load different capability subsets. This Skill guides the creation of correct, capability-guarded mod files without importing app internals.

Core Features & Use Cases

  • Capability selection guidance: Maps user requests to the right mod type, including agent-callable tools, slash commands, lifecycle/turn events, permission overlays, local model providers, and panels.
  • Scoped API patterns: Enforces use of ctx.conversation, ctx.cwd, and letta.capabilities guards so mods work across TUI, headless, and desktop listener hosts.
  • Recipe references: Loads focused references for tools, commands, providers, events, permissions, UI panels, plan mode, analysis mode, and multi-capability architecture.
  • Use Case: Ask the agent to add a /review slash command that runs while the main agent is busy, and it produces a capability-guarded mod file in ~/.letta/mods/ that forks a scoped conversation and returns handled output.

Quick Start

Ask the agent to create a mod that adds a slash command or tool, for example: create a mod that adds a /whereami command showing the current agent and working directory.

Frequently Asked Questions about creating-mods

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Letta Code mod?

Write a single TypeScript file in ~/.letta/mods/ that exports a default activate(letta) function registering capabilities like tools or commands, then run /reload. Guard each registration with letta.capabilities so the mod works across TUI, headless, and desktop hosts.

How do I add a custom slash command to Letta Code?

Register a command with letta.commands.register using a lowercase hyphenated id without the leading slash. Return a prompt result to send text to the agent, an output result for local-only display, or handled when the command owns its own UI.

Should I use a mod tool or a mod command?

Use a tool when the model should autonomously decide to call the capability, and a command when the human explicitly invokes it with a slash. For reusable agent workflows, put instructions in a skill and keep the command as a thin launcher.

Can a mod add a custom model provider to Letta Code?

Yes, provider mods register local provider metadata with letta.providers.register, but they only work for local-backend agents in the TUI, headless runtime, and desktop listener. They do not add providers for agents managed through the Letta API.

Why does my mod command do nothing on the desktop app?

The desktop listener loads commands but not panel UI, so a command whose run function only opens a panel silently no-ops. Guard the command registration itself on letta.capabilities.ui.panels so it is not advertised on hosts that cannot render panels.

How do I recover when a mod breaks Letta Code startup?

Start with letta --no-mods or set LETTA_DISABLE_MODS=1 to bypass mod loading, then fix or remove the broken mod file. Mod diagnostics are also recorded at ~/.letta/mods/diagnostics/latest.json for inspection.