Coding Agents

Build inference.sh apps with AI coding assistants like Claude Code, Cursor, or Windsurf.


Setup

1. Install CLI

bash
1curl -fsSL https://cli.inference.sh | sh2infsh login

2. Create App

bash
1# Python app2infsh app init my-app3cd my-app45# Or Node.js app6infsh app init my-app --lang node7cd my-app

This creates your app with all the files needed, including skills that teach your coding agent how to build inference.sh apps.


Skills Included

When you run infsh app init, the CLI creates a skills/ directory containing guidance for AI coding assistants:

SkillWhat it teaches
building-inferencesh-appsOverview, CLI commands
writing-app-logicHow to write inference.py / inference.js
configuring-resourcesHow to set up inf.yml
managing-secretsHandling API keys
using-oauth-integrationsGoogle Sheets, Drive
tracking-usageOutput metadata for billing
handling-cancellationGraceful task cancellation
optimizing-performanceBest practices
debugging-issuesTroubleshooting

How It Works

  1. You describe what you want — Tell your coding agent what app to build
  2. Agent reads skills — The agent uses the skills to understand inference.sh patterns
  3. Agent writes code — Creates inference.py, updates inf.yml, adds dependencies
  4. Test locally — Run infsh app test to verify
  5. Deploy — Run infsh app deploy to publish

Example Prompts

code
1Create an image resizing app that takes an image and dimensions, 2and returns the resized image.
code
1Build an LLM app that calls OpenAI's API. 2It should track token usage for billing.
code
1Make a YouTube audio downloader that extracts audio from videos 2and returns MP3 files.

Supported Agents

The skills work with any AI coding assistant that supports project-level context:

  • Claude Code — Plugin marketplace via belt plugin init claude (see below)
  • Codex — Plugin marketplace via belt plugin init codex when the Codex CLI is installed (see Codex plugin)
  • Cursor, Gemini CLI, Windsurfbelt plugin init <agent> installs belt skills and lifecycle hooks
  • GitHub Copilot — Project context; install skills manually or via belt skill add

Other agent runtimes (belt plugin init)

For Cursor, Gemini CLI, and Windsurf:

bash
1belt login2belt plugin init cursor     # Cursor3belt plugin init gemini     # Gemini CLI4belt plugin init windsurf   # Windsurf

For Codex, use belt plugin init codex — see Codex plugin below. Codex requires the Codex CLI on your PATH.

Each manual install command installs five core belt skills (suggest, skill, apps, remember, belt) into the agent's skills directory and writes a hooks config with event names that match that runtime. Skills are downloaded from inference.sh when you are logged in; embedded copies are used when you are not logged in, offline, or the download fails.

AgentSkills directoryHooks config
cursor~/.cursor/skills/~/.cursor/hooks.json
gemini~/.gemini/skills/~/.gemini/settings.json
windsurf~/.windsurf/skills/~/.codeium/windsurf/hooks.json

Lifecycle hooks installed by belt plugin init:

Hook eventBelt commandPurpose
SessionStart (codex, cursor)belt plugin hook session-start (plugin) or belt me (manual Cursor)Show account email when logged in; start device authorization when not
Prompt submitbelt suggest --jsonInject relevant skills, knowledge, and apps into context
Stop (or agent-specific end event)belt review --agent <name> --trigger stopEvaluate the session for knowledge worth saving (every 10 user turns by default)
PreCompact (codex, cursor only)belt review --agent <name> --trigger precompact --forceCapture knowledge before context compaction

SessionStart (plugin installs): Claude Code and Codex (marketplace plugin) call belt plugin hook session-start. When you are logged in, the hook prints your account email. When you are not (including anonymous guest sessions with no API key), it opens a browser for device authorization, prints the approval URL and user code into session context, and polls for up to 45 seconds. A 6-hour cooldown (~/.inferencesh/hook-auth-cooldown) prevents reopening the browser on every session. Cursor (manual install) uses a lighter check: belt me output or a login reminder.

For non-Claude agents, review reads the session transcript from hook stdin. Extraction prefers a local agent CLI on your PATH (codex, gemini, grok, or claude) so it can ride your existing subscription; when none is available, it falls back to the inference.sh API (paid). Claude Code uses a richer pipeline (fork-based extraction and optional skill auto-publish) — see Claude Code plugin below.

If a hooks file already exists, manual init skips overwriting it (delete the file to reinstall). After init, follow the CLI message — Cursor and Windsurf users restart the IDE.

Hook data and privacy

Before installing, belt plugin init prints what belt hooks send upstream:

SentPurpose
Prompt textSemantic search for matching skills, knowledge, and apps
Session statsMessage count, tool names, files touched

Never sent: source code, file contents, secrets, or full conversation history.

Traffic is encrypted (TLS 1.2+). See privacy and trust. Run belt plugin info for the per-hook upstream data table (Claude Code plugin) and compliance details.

Disabling hooks

Disable belt hooks for a project tree by adding .beltsh/config.json at the repo root (the CLI walks up from CWD like .git):

json
1{2  "hooks_disabled": true,3  "suggest_disabled": true,4  "knowledge_disabled": true5}
FieldEffect
hooks_disabledDisables all plugin hooks for this project
suggest_disabledDisables prompt-time skill/knowledge/app suggestions only
knowledge_disabledDisables session-end knowledge extraction only

Quick disable everywhere: BELT_NO_HOOKS=1 (or any truthy value except 0 / false).

Using skills with other agents


Codex plugin

When the Codex CLI is on your PATH, belt plugin init codex uses the Codex plugin marketplace (same belt-sh/skills marketplace as Claude Code):

bash
1belt login2belt plugin init codex    # add marketplace + install plugin

init runs:

bash
1codex plugin marketplace add belt-sh/skills2codex plugin add belt@belt-sh-skills

This installs the full belt plugin — hooks, skills, bin scripts, agents, and rules — instead of the simplified manual install.

After install, run /hooks in Codex to review and trust belt hooks.

Duplicate hook cleanup: A successful plugin install removes belt hook entries from ~/.codex/hooks.json if that file already exists (for example after an earlier belt init codex fallback install). The plugin's own hooks.json manages belt hooks, so leaving both would run each hook twice. Non-belt entries in the global file are preserved; if every entry was belt-related, the global file is deleted. The CLI prints which path was updated.

Requires Codex CLI: If the codex command is not on your PATH, belt plugin init codex prints an error with a link to install the Codex CLI. belt init codex (without plugin) still falls back to a manual skills-and-hooks install in that case.


Claude Code plugin

The belt CLI installs a belt plugin for Claude Code and Cowork (same hooks when CLAUDE_CODE_IS_COWORK is set). Hooks run in the background to suggest skills and apps, capture reusable knowledge, and optionally auto-publish skills from your sessions.

Use the belt plugin command group:

bash
1belt login2belt plugin init claude    # add marketplace + install plugin3belt plugin init claude --inject-rules   # also append belt rules to ~/.claude/CLAUDE.md4belt plugin info           # verify install and hook configuration5belt plugin doctor         # check plugin health (use --fix to auto-repair)

Hook shims: Plugin hook scripts in bin/ are thin shims that delegate to belt plugin hook <event>. The marketplace cache can serve older hook scripts with embedded logic, so belt plugin init claude and belt plugin doctor --fix (when reinstalling) both scan Claude and Codex plugin caches and rewrite any stale hook scripts to shims immediately after install.

Troubleshooting: If hooks stop firing or Claude Code reports a missing plugin directory, run belt plugin doctor. It checks authentication, the plugin cache in Claude's installed_plugins.json, hooks.json inside the install path, that hook scripts in bin/ are thin shims across Claude and Codex caches, and recent activity in ~/.belt/hooks.log. With --fix, it reinstalls the belt plugin when the cache path is stale or missing (claude plugin uninstall belt@belt-sh-skills, then claude plugin install belt, with marketplace add as fallback), removes other stale cache directories, and patches hook scripts that still contain embedded logic. When no fixes are needed, doctor reports All checks passed; when --fix applies repairs, it lists each change (for example fixed: removed stale cache dir abc123 or fixed: patched hook-stop.sh in <hash>) and then prompts a context-aware restart — inside Claude Code, Run /reload-plugins or restart this session to apply changes; from a regular terminal, Restart your agent session to apply changes.

Use --inject-rules when you want belt guidance in your user-level CLAUDE.md (persists across sessions and survives context compaction). If a belt section already exists, init replaces it.

After install, restart Claude Code or run /reload-plugins. Plugin slash commands include /skill, /knowledge, /apps, and /suggest.

HookBelt commandPurpose
SessionStartbelt plugin hook session-startShow account email when logged in; run device authorization when not (browser + approval code in context, 45s poll, 6h cooldown)
UserPromptSubmitbelt suggest --jsonInject relevant skills, knowledge, and apps into context
Stopbelt plugin review (or belt review --agent claude-code --trigger stop)Evaluate the session for knowledge worth saving (every 10 user turns by default)
SessionEndbelt plugin session-endPost a session summary to inference.sh

Claude Code review also runs fork-based extraction and can auto-publish reusable workflows as skills. Other agents use transcript-based extraction, preferring local CLIs (codex, gemini, grok) when installed — see Other agent runtimes above.

Knowledge import from existing Claude Code projects:

bash
1belt plugin history --dry-run   # preview ~/.claude/projects memory + skill signals2belt plugin history             # import memory files + skill usage (requires belt login)3belt plugin history --extract   # also mine transcripts with Haiku (~$3; requires login)
FlagPurpose
--dry-runShow what would be imported without saving
--extractMine session transcripts for knowledge Claude's native memory missed (uses Haiku, ~$3)
--narrativesWith --extract, also process large session narratives (Haiku, ~$5–8 extra)
--max-sessions NWith --narratives, cap how many large sessions to process (0 = all)

Tips and notices: Contextual stderr tips after commands can be disabled with INFSH_NO_TIPS=1. Hook tip: lines inside belt suggest --json output are separate (rate-limited in ~/.belt/notices/) and are not suppressed by that variable.

Survey prompts: When unanswered customer-discovery questions remain, belt suggest --json may append survey instructions to hook context (per-question 1-hour cooldown, same four questions as CLI stderr notices: use_case, discovery, need, testimonial). Agents can respond with belt feedback <question-id> "answer" or belt feedback "open message". Submissions go to POST /me/survey with optional agent and context metadata (the CLI sends your five most recent belt commands as context). See CLI setup — Feedback.

Using skills with other agents · CLI setup


Next

CLI Setup — Manual CLI installation

Creating an App — Manual app creation

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.