# Repository Briefing: alexknowshtml/smaug
> Source: https://repoforai.com/repo/alexknowshtml/smaug (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/alexknowshtml/smaug
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: JavaScript
- **License**: MIT
- **Engineering Health**: B (53/100 · Maintenance 6/35 · Adoption 16/25 · Releases 11/20 · License 20/20)
- **Latest Release**: v0.3.1 (2026-01-06) — https://github.com/alexknowshtml/smaug/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: CLI
- **Momentum**: 956 ★ total (+0 24h / +3 7d) · 88 forks
- **When to Use**: Best for: Individuals or small teams that routinely save links on X and want searchable, editable Markdown notes with source context and configurable filing. Skip if: You only need a repeatable list of URLs, cannot share bookmark content with the chosen inference backend, or need a fully offline workflow or built-in media transcription.

## Overview
```text
### Architecture & Core Mechanics
Smaug is a JavaScript CLI for Node.js 20+. Its `smaug` entry point separates `fetch` from `process`, while `run` combines them. Bird handles authenticated collection from X; Smaug expands `t.co` URLs and enriches the collected records with linked content. The default pending and state files live under `.state/`, and `dayjs` is the only declared runtime package dependency. Bird and the AI CLI are separate executables.

Processing delegates analysis and filing to Claude Code by default or to a configured OpenCode backend. The Claude workflow is defined in `.claude/commands/process-bookmarks.md`. Output goes to a date-organized `bookmarks.md` index and, where configured, separate notes under `knowledge/`. Category rules are the main extension point: users can match links and set a filing action, destination, and template rather than add a new service.

### Key Capabilities & Differentiators
Smaug collects bookmarks, likes, or both. It expands shortened links and can capture GitHub metadata and READMEs, external article text, and context from quoted posts or reply threads. For native X articles it tries the original post, then searches for the author's post if needed, and falls back to basic metadata. Configured bookmark folders are fetched independently because bulk results lack folder membership; their mapped tags appear in the archive and note frontmatter.

Claude Code supports Sonnet, Haiku, and Opus settings, while OpenCode exposes a broader choice of models. The Claude workflow defaults to parallel Haiku subagents from eight items per batch. The `-t` flag reports Claude token usage, cache reads and writes, and estimated costs by model. Media metadata is experimental and depends on a Bird build with media support; the `transcribe` action only flags items and does not perform transcription.

### Trade-offs & Limitations
Compared with a plain bookmark export, Smaug trades predictable output and a smaller dependency chain for richer context, summaries, and a portable Markdown library. Separating fetch from processing makes it easier to inspect inputs and bound model spend. Large batches with long articles or repository READMEs can still be expensive, and filing quality varies by model. Collection also depends on a valid X session and a compatible Bird build, so scheduled runs need monitoring.

The main trust boundary is between untrusted posts or linked pages and the AI CLI that processes them. The example Claude configuration allows Bash as well as file-writing tools. For unattended runs, narrow permissions to what filing needs, restrict workspace and credential access, and confirm what text the selected provider receives. A local Markdown archive does not make inference local or the workflow offline.

### Hardware & Deployment Guide
Install Node.js 20+, Bird, and either Claude Code or OpenCode. From a checkout, run `npm install`, then `npx smaug setup` to prepare directories and configuration. Bird needs valid X session credentials (`auth_token` and `ct0`); the local config is gitignored, and `AUTH_TOKEN` and `CT0` are available as environment variables. Verify a small fetch and processing run before scheduling larger batches with cron or PM2. The archive runs on your host, but fetching requires network access and inference may run with a hosted provider.

Version 0.3.0 added folder support and Claude token accounting. Version 0.3.1 fixed parsing of Bird v0.6.0 paginated JSON, replaced `curl` with native `fetch` for Windows compatibility, and added a setup warning for credentials. Treat pagination support as a separate compatibility check: the `fetch --all` instructions call for a Git build of Bird, so do not assume that the parser fix makes every published Bird build suitable for backfills.
```

## Key Capabilities
```text
- Runtime: Node.js 20+ CLI with `dayjs` as its only declared runtime package dependency; Bird and the AI CLI are separate prerequisites.
- Collection: Bird fetches bookmarks, likes, or both; mapped bookmark folders are fetched separately and preserved as tags.
- Enrichment: Expands `t.co` links and gathers GitHub repository metadata and READMEs, article text, and quote or reply context.
- Storage: A date-organized `bookmarks.md` index links to Markdown notes under `knowledge/tools/` and `knowledge/articles/`; pending work and state use JSON files.
- AI processing: Claude Code is the default, OpenCode is configurable, and the Claude workflow uses Haiku subagents for batches of eight or more by default.
- Operations: `-t` reports Claude token usage, cache activity, and estimated cost; v0.3.1 adds native `fetch` for Windows compatibility and fixes Bird v0.6.0 paginated JSON handling.
```

## Quick Start / Clone
```bash
# 1. Install bird CLI (Twitter API wrapper)
# See https://github.com/steipete/bird for installation

# 2. Clone and install Smaug
git clone https://github.com/alexknowshtml/smaug
cd smaug
npm install

# 3. Run the setup wizard
npx smaug setup

# 4. Run the full job (fetch + process with Claude)
npx smaug run
```
