一键导入
about-fin
Learn about fin itself — what it is, how it works, its architecture. Use when asked about fin.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Learn about fin itself — what it is, how it works, its architecture. Use when asked about fin.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | about_fin |
| description | Learn about fin itself — what it is, how it works, its architecture. Use when asked about fin. |
fin is a minimal, opinionated CLI agent harness written in Go by meain. Source code: https://github.com/meain/fin
fin takes a prompt, runs an agent loop (stream LLM response → execute tool calls → repeat), and exits. It supports session persistence, multiple LLM providers, an extensible skill system, and multiple output modes.
fin "explain this code" # basic prompt
fin -c "follow up" # continue last session
fin -s <uuid> "follow up" # continue specific session (prefix match or 1-based index)
fin -n <name> "prompt" # named session (resumes if it exists, else creates)
fin -match "prompt" # search recent sessions, offer to resume a match
git diff | fin "review this" # piped input
fin -export json|html|message # export session
fin -export message | glow # pipe last response to glow
fin -ui debug "what is in go.mod" # default + turn timings + token usage
fin -ui quiet "summarize" > out.txt # just the response on stdout
fin -sessions # list last 10 sessions (JSON if piped, ANSI table on TTY)
fin -all -sessions # list all sessions
fin -since 1h -sessions # filter sessions by age (1h, 2d, 1w, 30m)
fin -approve all|safe|none "prompt" # tool approval mode
fin -yolo "prompt" # alias for -approve all
fin --max-turns 5 "prompt" # cap agent loop iterations
fin -model provider/model "prompt" # override model for this run (alias names also work)
fin -color auto|always|never # color output (NO_COLOR honored)
fin -config <path> # override config file location
fin -f script.fin # read prompt from file (strips shebang line)
fin -f script.fin "extra args" # file prompt + positional args appended
fin -tools read,shell "prompt" # restrict tool set (also: all, none)
fin -temp "quick question" # mark session as temporary (skipped by -c, shown as [temp] in listings)
fin -c -temp "follow up" # continue the last temp session
fin -tag work "prompt" # tag session as "work" (shown as #work in listings)
fin -c -t work "follow up" # continue last session tagged "work"
fin -c -t -work "follow up" # continue last session NOT tagged "work"
fin -sessions -t work # list sessions tagged "work"
fin -sessions -t -work # list sessions NOT tagged "work"
fin -fork "try different approach" # fork the last session into a new one and continue from there
fin -s <uuid> -fork "try differently" # fork a specific session
fin -doctor # print diagnostic summary: models, providers (key status), tools, skills, AGENTS.md files
Prompt files can be made executable so they run like a normal CLI tool. See the README for full examples.
#!/usr/bin/env -S fin -f
Summarize the files in the current directory
#!/usr/bin/env -S fin -yolo --max-turns 3 -f
Read all TODO comments in this project and create a summary
The leading #! line is stripped before the prompt is sent. Positional args after the script path are appended to the prompt; piped stdin is prepended.
TOML at ~/.config/fin/config.toml:
[models] — primary (main conversation model), secondary (title generation and any secondary tasks)[settings] — project_file (default: AGENTS.md), max_turns, approve, ui, disable_claude_memory[settings.matching] — tuning for -match: title_weight (default 3), content_cap (default 5), recency_decay_d (default 7), recency_bonus (default 0.5)[model_aliases] — short names mapping to provider/model (e.g. sonnet = "anthropic/claude-sonnet-4-6"). Alias chains resolved up to 10 hops.[providers.*] — base_url, api_key_env, headers[tools.*] — approval (auto/confirm/deny), allow/deny glob patterns for shellAnthropic Claude, OpenAI, and any OpenAI-compatible API (Groq, OpenRouter, Ollama, local models). All via raw HTTP — no provider SDKs. Configurable per-provider base URLs, API keys, and custom headers.
sh -c, returns stdout and stderr separatelyProgressive disclosure: only skill names and descriptions are loaded at startup. Full instructions load on activation. Skills are discovered from .agents/skills/ in the project (walks up to root), ~/.agents/skills/ globally, and any extra directories listed in settings.skills_dirs in the config (each expected to directly hold <name>/SKILL.md subdirs). Follows symlinks. Builtin skills are embedded in the binary.
~/.local/share/fin/sessions/. First line is a session header (id, title, model, cwd, started_at); each subsequent line is one message.tmp + rename full rewrite.fin process modified the file since load, to avoid clobbering concurrent runs.fin -s abc12 works). Named sessions via -n. Match recent sessions to the current prompt with -match.-tag <name> or -t <name>. Use -t <name> with -c or -sessions to filter by tag; prefix with - (e.g. -t -work) to exclude sessions with that tag.-fork: copies all messages into a new session with previous_session pointing to the origin. Forks are shown grouped under their parent in fin -sessions (TTY) and as a flat array with parent_id in JSON. Exports walk the full ancestor chain root-first.pbcopy, glow, etc.)git diff | fin "review this" — stdin pipe detected automatically, content prepended to prompt.
Per-tool configurable: auto, confirm, or deny. Shell tool supports allow/deny glob patterns. -approve all|safe|none overrides at runtime; -yolo is shorthand for -approve all.
-tools filters the active tool set. all (default) enables everything; none disables every tool; a comma list (-tools read,shell) enables only the named tools. Filter applies to subagents too. Valid names: read, write, edit, shell, compact, use_skill, subagent.
Rate limits (429) and server errors (5xx) retried up to 3 times with exponential backoff + jitter.
Assembled from: embedded base prompt → runtime context (date, OS, cwd) → skill list → ~/.agents/AGENTS.md → project AGENTS.md (walks up to root) → Claude Code auto-memory. Base prompt sections are gated by -tools so a disabled tool's section never reaches the model.
If the current project has a Claude Code auto-memory directory (~/.claude/projects/<project>/memory/, keyed by git root with / replaced by -, falling back to cwd outside a repo), fin reads its MEMORY.md index — capped at 200 lines/25KB, the same limit Claude Code itself applies — and appends it to the system prompt, along with paths to any sibling topic files the model can read on demand. Read-only; fin never writes to that directory. Disable with disable_claude_memory = true under [settings]. Shown in fin -doctor.
The agent talks to the UI through agent.UIWriter. Payloads crossing the boundary are structured data (no ANSI escapes, no pre-formatted strings). The terminal ui package is the current implementation; a TUI, web, or audio frontend can drop in by implementing the same interface — no agent change needed.
Shows streaming line count during tool call argument generation (e.g. write (47 lines) updates in real-time). Esc / Ctrl+C cancels a turn.
Raw-mode TTY multiplexer captures keystrokes during execution so the next prompt can be typed while a turn is still running.
Clone into a temporary directory and read through the files:
git clone https://github.com/meain/fin.git /tmp/fin-source
Then use the read tool on /tmp/fin-source to explore. Layout:
main.go — 10-LOC entry point, calls cli.Run()internal/cli/ — flag parsing, session glue, the driverinternal/agent/ — Agent type, turn loop, UIWriter interface, Debug* payloads, subagent runnerinternal/ui/ — terminal UIWriter implementation (ANSI, cursor moves, parallel-tool display)internal/session/ — JSONL persistence, loaders, -match scoringinternal/export/ — JSON / HTML / message exportersinternal/provider/ — Anthropic (SSE) and OpenAI-compatible (NDJSON) implementationsinternal/tool/ — Tool interface and the seven builtin tools, plus Labeler for displayinternal/skill/ — Skill discovery (project + global)internal/prompt/ — System prompt assembly + section gatinginternal/config/, internal/approval/, internal/render/, internal/input/, internal/fsutil/, internal/embed/, internal/types/ — supporting leaves