| name | code-expert |
| description | Build expert knowledge bases from codebases โ explore, explain, extract beliefs |
| argument-hint | [init|scan|explain|explore|walk-commits|update|topics|propose-beliefs|review-proposals|accept-beliefs|derive|generate-summary|file-issues|status] |
| allowed-tools | Bash(code-expert *), Bash(uv run code-expert *), Bash(uvx *ftl-code-expert*), Read, Grep, Glob |
Code Expert
Build expert knowledge bases from codebases by combining code exploration with belief extraction.
How to Run
Try these in order until one works:
code-expert $ARGUMENTS (if installed via uv tool install)
uv run code-expert $ARGUMENTS (if in the repo with pyproject.toml)
uvx --from git+https://github.com/benthomasson/ftl-code-expert code-expert $ARGUMENTS (fallback)
Typical Workflow
code-expert init ~/git/some-project --domain "Web framework"
code-expert scan
code-expert explore
code-expert explore --pick 1,3,8
code-expert explore --skip
code-expert topics
code-expert propose-beliefs
code-expert review-proposals
code-expert accept-beliefs
code-expert derive --auto
code-expert status
code-expert update --since-last
Commands
init <repo-path> โ Bootstrap knowledge base for a codebase
scan โ Quick repo scan, identify key files, populate topic queue
explain file <path> โ Explain a file, create entry
explain function <file:symbol> โ Explain a function/class, create entry
explain repo [path] โ Repo architecture overview entry
explain diff [--branch B] โ Explain changes, create entry
explore [--skip] [--pick N[,N,...]] [--loop N] โ Work through topic queue (--loop N explores up to N topics continuously)
walk-commits --since DATE|--since-commit SHA|--since-last [--dry-run] โ Walk commits and explore each changed file
topics [--all] โ Show exploration queue
propose-beliefs [--auto] [--since DATE] โ Extract beliefs from entries (--auto accepts all without review; --since filters by entry date)
review-proposals [--batch-size N] โ LLM quality filter: rejects meta, duplicate, ephemeral, speculative, trivial proposals
accept-beliefs โ Import accepted beliefs (uses reasons if installed, falls back to beliefs)
derive [--auto] [--exhaust] [--dry-run] โ Propose deeper reasoning chains (--exhaust loops until no new derivations; delegates to reasons derive)
generate-summary โ Morning summary entry: new gated OUT beliefs, new negative IN beliefs, critical watch list
update --since-last|--since DATE [--file-issues] โ Full automated pipeline: walk-commits โ propose-beliefs โ review-proposals โ accept-beliefs โ derive --exhaust โ generate-summary
file-issues [--dry-run] [--repo OWNER/REPO] [--label L] [--skip-confirm] [--no-negative] โ File issues from gated blockers and negative beliefs; confirms issues still exist in code before filing (GitHub/GitLab)
status โ Dashboard (shows reasons.db stats if available)
Natural Language
If the user says:
- "study this codebase" โ
code-expert init <path> && code-expert scan
- "what should I look at next" โ
code-expert explore
- "explain this file" โ
code-expert explain file <path>
- "extract what we've learned" โ
code-expert propose-beliefs
- "review the proposals" / "filter proposals" โ
code-expert review-proposals
- "build deeper chains" / "derive conclusions" โ
code-expert derive
- "derive everything" / "exhaust derivations" โ
code-expert derive --exhaust
- "file issues for blockers" / "what's blocking features" โ
code-expert file-issues --dry-run
- "file issues for bugs" / "what negative findings do we have" โ
code-expert file-issues --dry-run
- "walk through recent commits" / "explore what changed this week" โ
code-expert walk-commits --since "1 week ago"
- "catch up on changes" / "nightly update" / "update the knowledge base" โ
code-expert update --since-last
- "morning summary" / "what's the status" โ
code-expert generate-summary
- "how far along are we" โ
code-expert status
Belief Storage
When ftl-reasons is installed (reasons CLI on PATH), accept-beliefs writes directly to reasons.db and re-exports beliefs.md and network.json. When only ftl-beliefs is installed, it writes to beliefs.md directly. The init command sets up whichever store is available.