Recollect.Learner.CodingAgent (recollect v0.5.1)

Copy Markdown View Source

Unified learner for all coding agents (Claude Code, Codex, Gemini CLI, Goose, OpenCode).

Each agent has a provider module under Recollect.Learner.CodingAgent.* that knows how to read that agent's specific directory layout. This module implements the Recollect.Learner behaviour, dispatches to all enabled providers, and aggregates results.

Adding a new agent

  1. Create lib/recollect/learning/coding_agent/my_agent.ex
  2. Implement the provider callbacks (see Recollect.Learner.CodingAgent.Provider)
  3. Add the module to @providers below

Provider registry

AgentModuleDefault data dir(s)
Claude CodeCodingAgent.ClaudeCode~/.claude/projects/
CodexCodingAgent.Codex~/.codex/
Gemini CLICodingAgent.Gemini~/.gemini/
OpenCodeCodingAgent.OpenCode~/.local/share/opencode/
GooseCodingAgent.Goose~/.config/goose/

Data paths can be overridden by passing an :agent_configs map (keyed by agent name) through the opts. This allows the caller (e.g. Worth) to inject paths from a central registry (e.g. AgentEx) without creating a circular dependency.

Summary

Functions

Fetch events only from providers that pass the given filter.

Fetch events from authorized providers with optional project and time filtering.

Build [{module, config}] tuples for all providers.

Get the list of provider modules.

Run the full coding agent learning pipeline.

List available providers and their status.

Functions

fetch_authorized_events(filter_fn)

Fetch events only from providers that pass the given filter.

filter_fn receives the provider module and returns true to include it. Used by Worth to gate providers behind user permission checks.

fetch_authorized_events(filter_fn, opts)

Fetch events from authorized providers with optional project and time filtering.

Options

  • :projects — map of %{agent_name => [project_slug, ...]} to filter by. If a provider has no entry, all its projects are included.
  • :since — map of %{agent_name => %{project_slug => timestamp_string, ...}} to only fetch events newer than the given timestamps.
  • :agent_configs — map of %{agent_name => %{data_paths: [...]}} to override default data paths. Injected by Worth from agent_ex's central registry.

provider_configs(overrides \\ %{})

Build [{module, config}] tuples for all providers.

overrides is a map of %{agent_name => %{data_paths: [...]}}. Providers not in the overrides map use their default_data_paths/0.

providers()

Get the list of provider modules.

run(opts \\ [])

Run the full coding agent learning pipeline.

status(overrides \\ %{})

List available providers and their status.

summarize(events, scope_id)

Callback implementation for Recollect.Learner.summarize/2.