npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-autotitle

v0.1.3

Published

AI-powered automatic session naming for OpenCode - titles your sessions based on context

Readme

opencode-autotitle

AI-powered automatic session naming for OpenCode.

Automatically generates descriptive titles for your OpenCode sessions based on conversation context, replacing generic timestamp-based names like "2024-01-15 14:30" with meaningful descriptions like "Setup React Auth Flow".

From Timestamp Chaos to Meaningful Titles

| Before | After | |--------|-------| | Before - Timestamp titles | After - Auto-generated titles |

Features

  • Two-phase titling: Instant keyword title on user message, refined AI title after response
  • AI-powered: Auto-selects cheapest available model (flash/haiku/fast) for title generation
  • Instant feedback: Keyword-based title appears immediately, no waiting for AI
  • Zero configuration: Works out of the box with sensible defaults
  • Non-blocking: Runs in the background, never slows your workflow
  • Respects custom titles: Won't overwrite manually set session names

Installation

Quick Install (Recommended)

Option 1: Let your AI agent install it

Paste this into OpenCode, Claude Code, Cursor, or any AI coding assistant:

Install opencode-autotitle by following the instructions here:
https://raw.githubusercontent.com/pawelma/opencode-autotitle/refs/heads/master/docs/install.md

Option 2: One-liner

curl -fsSL https://raw.githubusercontent.com/pawelma/opencode-autotitle/refs/heads/master/install.sh | bash

Manual Installation

OpenCode loads plugin files directly from ~/.config/opencode/plugins/.

# Clone, build, and copy the plugin file
tmp_dir=$(mktemp -d)
git clone --depth 1 https://github.com/pawelma/opencode-autotitle "$tmp_dir"
cd "$tmp_dir" && npm install && npm run build
mkdir -p ~/.config/opencode/plugins
cp dist/index.js ~/.config/opencode/plugins/opencode-autotitle.js
rm -rf "$tmp_dir"

How It Works

The plugin uses a two-phase approach for instant feedback with quality refinement:

┌─────────────────────────────────────────────────────────────────────────┐
│                         OPENCODE SESSION                                │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│  PHASE 1: Quick Title (on message.part.updated)                         │
│  ───────────────────────────────────────────────────────────────────────│
│                                                                         │
│   User types message ──► Extract keywords ──► Set title immediately     │
│                                                                         │
│   "Help me set up JWT auth"  ──►  "🔍 Jwt Auth Express"                 │
│                                                                         │
│   • No API call needed                                                  │
│   • Instant title update                                                │
│   • Uses keyword extraction + stop word filtering                       │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│  PHASE 2: AI Title (on session.idle)                                    │
│  ───────────────────────────────────────────────────────────────────────│
│                                                                         │
│   AI responds ──► Find cheap model ──► Generate title ──► Update        │
│                                                                         │
│   Context: user question + AI response                                  │
│                                                                         │
│   "🔍 Jwt Auth Express"  ──►  "✨ Setup JWT Auth Express"               │
│                                                                         │
│   • Uses cheapest available model (flash/haiku/fast)                    │
│   • Creates temp session for title generation                           │
│   • More specific title based on actual conversation                    │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│  RESULT                                                                 │
│  ───────────────────────────────────────────────────────────────────────│
│                                                                         │
│   🔍 = Keyword-based title (fast fallback)                              │
│   ✨ = AI-generated title (final quality)                               │
│                                                                         │
│   Custom user titles are never overwritten                              │
└─────────────────────────────────────────────────────────────────────────┘

State Management

┌──────────────────────────────────────────────────────────────┐
│                      Plugin State                            │
├──────────────────────────────────────────────────────────────┤
│  keywordTitledSessions: Set<string>   ← Has 🔍 title         │
│  aiTitledSessions: Set<string>        ← Has ✨ title (done)  │
│  pendingAISessions: Set<string>       ← Currently processing │
│  cheapestModel: cached model choice   ← Lazily discovered    │
└──────────────────────────────────────────────────────────────┘

Title Generation

Phase 1 sets a quick keyword title, Phase 2 refines it with AI:

| User Message | Generated Title | |--------------|-----------------| | "Help me set up authentication with JWT in my Express app" | "Setup JWT Auth Express" | | "There's a bug in the login form, it's not validating emails" | "Fix Login Email Validation" | | "Can you refactor the database queries to use connection pooling?" | "Refactor Database Pooling" | | "Write tests for the payment processing module" | "Testing Payment Module" |

Configuration

All configuration is optional. The plugin works out of the box.

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | OPENCODE_AUTOTITLE_MODEL | (auto) | Model ID like anthropic/claude-haiku-4-5 | | OPENCODE_AUTOTITLE_MAX_LENGTH | 60 | Maximum title character length | | OPENCODE_AUTOTITLE_DISABLED | false | Set to 1 to disable the plugin | | OPENCODE_AUTOTITLE_DEBUG | false | File path for debug logs (e.g., debug.log) |

Model Selection

By default, the plugin auto-discovers the cheapest available model from your connected providers, preferring models with names like fast, flash, haiku, or mini. To use a specific model:

export OPENCODE_AUTOTITLE_MODEL="anthropic/claude-haiku-4-5"

Debugging

Enable debug mode to see what's happening:

export OPENCODE_AUTOTITLE_DEBUG=debug.log
opencode
# In another terminal: tail -f debug.log

Look for [autotitle] messages in the output.

Development

# Clone the repository
git clone https://github.com/pawelma/opencode-autotitle
cd opencode-autotitle

# Install dependencies
bun install

# Build
bun run build

# Watch mode
bun run dev

# Type check
bun run typecheck

Inspirations

This project was inspired by and builds upon ideas from:

  • oh-my-opencode - The comprehensive OpenCode enhancement suite that pioneered the agent-assisted installation pattern and demonstrated what's possible with OpenCode plugins. The installation documentation approach used here is directly inspired by their excellent developer experience.

  • opencode-zellij-namer - AI-powered Zellij session naming plugin that showed how to elegantly combine AI generation with fallback heuristics for naming. The signal collection and intent inference patterns in this plugin were influenced by their implementation.

Thank you to the maintainers and contributors of these projects for sharing their work with the community.

License

MIT - see LICENSE

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Note: Currently tested with the GitHub Copilot provider only.