felan-ai/felan

Open-source, model-portable coding agent built for cost-efficient, verifiable software work—with model routing, progressive context, compact tool output, explicit task state, and estimated savings.

13

stars

176

commits

TypeScript

primary language

Sep 11, 2026

updated

agent-evaluation
ai
ai-coding-agent
coding-agent
context-management
developer-tools
harness
llm-optimization
model-routing

README

Felan

Get the job done. Waste less.
An open-source, model-portable coding agent built for cost-efficient, verifiable software work.

npm version CI status MIT license Node.js 22.19 or newer Join Felan on Discord

Felan is built around one rule: an optimization only counts when the task still succeeds. It combines model routing, progressive context, compact tool output, explicit task state, and estimated API-equivalent savings for supported optimizations.

Correctness first. Efficiency by design.

[!IMPORTANT] The local agent runs with your user's filesystem and process permissions. It is a host application, not a sandbox. Use an isolated host for untrusted projects or commands.

36.6% lower aggregate AI model cost in controlled benchmarks

Across six controlled, extension-specific comparisons, candidate configurations used $13.7132 versus $21.6297 for their baselines when summing median-reduced case costs—a 36.6% reduction. Individual results ranged from 5.2% to 66.0%. Each extension was measured separately against its disabled baseline, not as one all-enabled configuration. Every candidate met its configured quality gate.

ExtensionQuality vs baselineCost vs baselineSecondary result
Subagents100%23.7% lower
MarkItDown100%31.0% lower13.8% fewer prompt tokens
Concise output100%14.5% lower16.4% fewer output tokens
Prewalk100%66.0% lower
RTK83.3%26.6% lower40.6% fewer prompt tokens
Codebase Memory100%5.2% lower3.0% shorter agent-step duration

View the methodology, cases, and full benchmark results

Install and run

Felan supports Node.js 22.19.0 or newer. Run the published package without a global installation:

npx @felan-ai/felan

Or install the felan command:

npm install --global @felan-ai/felan
felan

Connect a provider inside the TUI with /login, then start working:

felan "inspect this project and explain how to run its tests"
felan --continue
felan savings
felan --diagnostics
felan update

Initial messages start the interactive TUI by default. Use --mode text for a one-shot final response or --mode json for Pi-compatible JSONL session events. Both modes support --continue and exact --provider, --model, and --thinking selection. A verified global npm installation also supports the finite felan update command. See Getting started for first-run setup and Local CLI for all accepted commands, flags, and local state.

Efficient by design

Felan treats correctness as the constraint and cost as the optimization target. Fewer tokens can support that goal, but they are not the outcome: a cheaper run that fails is not an efficiency win.

BoundaryWhat Felan does
Model routingPrewalk can start a task with a stronger planner and continue the same conversation trajectory on a configured implementation model.
Context controlProgressive nested instructions, scoped subagents, lazy MCP discovery, and bounded research keep context focused on the current work.
Tool outputRTK-backed command rewriting and post-tool compaction reduce noisy model input while preserving failures, complete JSON, and recoverable output.
Explicit stateDependency-aware tasks, structured questions, retained subagent records, and local project memory keep decisions and progress inspectable.
Measurement/savings, felan savings, and the Powerline footer report estimated API-equivalent cost avoided by supported optimizations.

Felan is developed against cost per verified task, not token count alone. The public harness-bench project holds the task, starting repository, verifier, timeout, and environment equivalent when comparing configurations. Correctness is primary; cost, token usage, and latency are supporting measurements. Read Efficient execution and savings for the measurement boundaries and claim limits.

Local agent, portable core

@felan-ai/felan is the account-free local terminal agent. The Felan cloud platform at felan.ai and app.felan.ai composes the same portable core and extensions as a managed host. Each host owns the boundaries that cannot be portable:

Local FelanFelan cloud platform
Runs on your machine from @felan-ai/felanRuns as managed background agents
Uses provider-owned local credentials; no Felan account requiredAdds tenant/team workflows, integrations, visibility, and guardrails
Stores sessions and project memory under the local agent directoryProvides host-managed storage, credentials, and integrations
Applies a fixed source-controlled built-in and resource policyChooses the managed host's policy and integrations

Read Architecture for the ownership boundary and Local memory architecture for the local versus host-managed memory lifecycle.

Built for software work

WorkflowWhat Felan adds
Delegate and inspectTracked asynchronous subagents with bounded nesting, live transcripts, steering, continuation, cancellation, and completion notices.
Plan and hand offA shared task graph with prerequisites, ownership, acceptance criteria, ready/blocked views, verified results, and same-session Prewalk model routing.
Ask instead of guessingSearchable one-question and one-to-four-question wizards with multi-select, freeform answers, comments, and timeout handling.
Load context where it appliesCwd instructions plus progressive nested AGENTS.md/CLAUDE.md discovery and explicit Agent Skills.
Remember locallyAn account-free, project-scoped Markdown wiki with bounded evidence ingestion, validation, citations, and retryable host-owned publication.
Retrieve web evidenceProvider-backed URL discovery, bounded matching text/PDF passages, and explicit SSRF-untrusted remote content boundaries.
Connect external tools carefullyA lazy OAuth-only remote MCP gateway, explicit credential ownership, and bounded untrusted remote results.
Use the right model toolsGPT-specific structured command/patch/image tools, detached Background Bash for other providers, and RTK-backed command/output optimization.
Inspect efficiencySession, project, and retained local estimates through /savings, felan savings, and the default Powerline footer.
Keep the TUI readableGrouped tool activity, full-call inspection, agent/task/process overlays, and an ANSI-aware Powerline footer.

The extension catalog maps each workflow to its package, host boundary, commands, and runtime conditions.

Explicit host boundaries

Felan keeps the local host narrow in some places on purpose:

  • only source-controlled built-in extensions are loaded;
  • ambient Pi packages, extensions, prompts, themes, project settings, and package resources are filtered;
  • model credentials and MCP OAuth tokens belong to the local host;
  • web, document, browser, MCP, memory, and model-facing remote content are bounded and treated as untrusted; and
  • missing binary dependencies degrade safely and require explicit interactive installation or disablement.

These controls do not sandbox ordinary shell or filesystem operations. Read the runtime and security guide before using Felan with sensitive repositories.

Architecture

Felan runtime architecture: the local product and Felan cloud platform compose portable extensions over Agent Core and pinned Pi packages.

Felan wraps Pi; it does not fork Pi. Pinned Pi packages provide the model, session, extension, and TUI primitives; Felan owns the host contracts, feature behavior, policy, storage, and presentation around them.

Behavior stays in its owning layer: apps/tui owns local policy, storage, and presentation; ext-* packages own portable feature behavior; and Agent Core owns adapter-neutral runtime contracts and base composition.

Documentation

The documentation hub routes readers by audience:

Repository map

PackagePurposeDocumentation
@felan-ai/felanCost-efficient, model-portable local coding agent and felan binaryLocal CLI
@felan-ai/agent-corePortable runtime contracts, prompt, tools, model tiers, and Pi compositionArchitecture
@felan-ai/ext-subagentsTracked asynchronous subagent protocolAgents and tasks
@felan-ai/ext-tasksDependency-aware root-session task graphAgents and tasks
@felan-ai/ext-prewalkSame-session planner-to-implementation handoffAgents and tasks
@felan-ai/ext-ask-userStructured one-to-four-question inputCommands
@felan-ai/ext-contextProgressive nested project contextContext and memory
@felan-ai/ext-context-viewEstimated context-window usage inspectorContext and memory
@felan-ai/ext-insightsLocal session analytics reportsCommands
@felan-ai/ext-prompt-historyTUI prompt-history pickerCommands
@felan-ai/ext-memoryPortable local-first memory contractsMemory architecture
@felan-ai/ext-output-styleValidated concise, explanatory, and custom response instructionsConfiguration
@felan-ai/ext-web-accessBounded web discovery and matching text/PDF passagesWeb access
@felan-ai/ext-mcpPortable OAuth-only remote MCP gatewayMCP
@felan-ai/ext-felan-apiSingle authenticated Felan API gatewayConfiguration
@felan-ai/ext-browserReviewed agent-browser CLI integrationBrowser
@felan-ai/ext-markitdownBounded office-document conversionDocuments
@felan-ai/ext-background-bashDetached Bash processes and logsCommands
@felan-ai/ext-codexGPT-specific structured tools and request controlsConfiguration
@felan-ai/ext-rtk-optimizerRTK command rewriting and output compactionRuntime dependencies
@felan-ai/ext-codebase-memoryStructural code search, symbol reads, and bounded grep augmentationRuntime dependencies
@felan-ai/ext-powerlineANSI-aware local TUI footerLocal CLI
@felan-ai/ext-session-titleAutomatic first-prompt session namesLocal CLI

Develop from source

Repository development and CI use Node.js 22.20.0 and pnpm 9.15.5:

git clone https://github.com/felan-ai/felan.git
cd felan
corepack enable
pnpm install --frozen-lockfile
pnpm build
node apps/tui/dist/cli.js

Run the complete build, type-check, test, license, packaging, and packed installation suite with:

pnpm verify

To review the Felan Pi themes in a browser, run pnpm theme:preview and open http://127.0.0.1:4173. Use pnpm theme:preview:check for a no-write validation or pnpm theme:preview:build to generate the ignored local artifact at .artifacts/theme-preview/index.html. The preview is a visual review aid; the Pi TUI remains the runtime source of truth.

See Contributing and the maintainer architecture map before changing a shared runtime or public package.

Community and license

Join the Felan Discord community to connect with users and contributors.

Felan is licensed under the MIT License. See NOTICE for third-party attribution and immutable upstream review details.

Contributors

mslavov

138 commits

yboychev

12 commits

felan-ai[bot]

6 commits

felan-ai/felan

Open-source, model-portable coding agent built for cost-efficient, verifiable software work—with model routing, progressive context, compact tool output, explicit task state, and estimated savings.

13

stars

176

commits

TypeScript

primary language

Sep 11, 2026

updated

agent-evaluation
ai
ai-coding-agent
coding-agent
context-management
developer-tools
harness
llm-optimization
model-routing

README

Felan

Get the job done. Waste less.
An open-source, model-portable coding agent built for cost-efficient, verifiable software work.

npm version CI status MIT license Node.js 22.19 or newer Join Felan on Discord

Felan is built around one rule: an optimization only counts when the task still succeeds. It combines model routing, progressive context, compact tool output, explicit task state, and estimated API-equivalent savings for supported optimizations.

Correctness first. Efficiency by design.

[!IMPORTANT] The local agent runs with your user's filesystem and process permissions. It is a host application, not a sandbox. Use an isolated host for untrusted projects or commands.

36.6% lower aggregate AI model cost in controlled benchmarks

Across six controlled, extension-specific comparisons, candidate configurations used $13.7132 versus $21.6297 for their baselines when summing median-reduced case costs—a 36.6% reduction. Individual results ranged from 5.2% to 66.0%. Each extension was measured separately against its disabled baseline, not as one all-enabled configuration. Every candidate met its configured quality gate.

ExtensionQuality vs baselineCost vs baselineSecondary result
Subagents100%23.7% lower
MarkItDown100%31.0% lower13.8% fewer prompt tokens
Concise output100%14.5% lower16.4% fewer output tokens
Prewalk100%66.0% lower
RTK83.3%26.6% lower40.6% fewer prompt tokens
Codebase Memory100%5.2% lower3.0% shorter agent-step duration

View the methodology, cases, and full benchmark results

Install and run

Felan supports Node.js 22.19.0 or newer. Run the published package without a global installation:

npx @felan-ai/felan

Or install the felan command:

npm install --global @felan-ai/felan
felan

Connect a provider inside the TUI with /login, then start working:

felan "inspect this project and explain how to run its tests"
felan --continue
felan savings
felan --diagnostics
felan update

Initial messages start the interactive TUI by default. Use --mode text for a one-shot final response or --mode json for Pi-compatible JSONL session events. Both modes support --continue and exact --provider, --model, and --thinking selection. A verified global npm installation also supports the finite felan update command. See Getting started for first-run setup and Local CLI for all accepted commands, flags, and local state.

Efficient by design

Felan treats correctness as the constraint and cost as the optimization target. Fewer tokens can support that goal, but they are not the outcome: a cheaper run that fails is not an efficiency win.

BoundaryWhat Felan does
Model routingPrewalk can start a task with a stronger planner and continue the same conversation trajectory on a configured implementation model.
Context controlProgressive nested instructions, scoped subagents, lazy MCP discovery, and bounded research keep context focused on the current work.
Tool outputRTK-backed command rewriting and post-tool compaction reduce noisy model input while preserving failures, complete JSON, and recoverable output.
Explicit stateDependency-aware tasks, structured questions, retained subagent records, and local project memory keep decisions and progress inspectable.
Measurement/savings, felan savings, and the Powerline footer report estimated API-equivalent cost avoided by supported optimizations.

Felan is developed against cost per verified task, not token count alone. The public harness-bench project holds the task, starting repository, verifier, timeout, and environment equivalent when comparing configurations. Correctness is primary; cost, token usage, and latency are supporting measurements. Read Efficient execution and savings for the measurement boundaries and claim limits.

Local agent, portable core

@felan-ai/felan is the account-free local terminal agent. The Felan cloud platform at felan.ai and app.felan.ai composes the same portable core and extensions as a managed host. Each host owns the boundaries that cannot be portable:

Local FelanFelan cloud platform
Runs on your machine from @felan-ai/felanRuns as managed background agents
Uses provider-owned local credentials; no Felan account requiredAdds tenant/team workflows, integrations, visibility, and guardrails
Stores sessions and project memory under the local agent directoryProvides host-managed storage, credentials, and integrations
Applies a fixed source-controlled built-in and resource policyChooses the managed host's policy and integrations

Read Architecture for the ownership boundary and Local memory architecture for the local versus host-managed memory lifecycle.

Built for software work

WorkflowWhat Felan adds
Delegate and inspectTracked asynchronous subagents with bounded nesting, live transcripts, steering, continuation, cancellation, and completion notices.
Plan and hand offA shared task graph with prerequisites, ownership, acceptance criteria, ready/blocked views, verified results, and same-session Prewalk model routing.
Ask instead of guessingSearchable one-question and one-to-four-question wizards with multi-select, freeform answers, comments, and timeout handling.
Load context where it appliesCwd instructions plus progressive nested AGENTS.md/CLAUDE.md discovery and explicit Agent Skills.
Remember locallyAn account-free, project-scoped Markdown wiki with bounded evidence ingestion, validation, citations, and retryable host-owned publication.
Retrieve web evidenceProvider-backed URL discovery, bounded matching text/PDF passages, and explicit SSRF-untrusted remote content boundaries.
Connect external tools carefullyA lazy OAuth-only remote MCP gateway, explicit credential ownership, and bounded untrusted remote results.
Use the right model toolsGPT-specific structured command/patch/image tools, detached Background Bash for other providers, and RTK-backed command/output optimization.
Inspect efficiencySession, project, and retained local estimates through /savings, felan savings, and the default Powerline footer.
Keep the TUI readableGrouped tool activity, full-call inspection, agent/task/process overlays, and an ANSI-aware Powerline footer.

The extension catalog maps each workflow to its package, host boundary, commands, and runtime conditions.

Explicit host boundaries

Felan keeps the local host narrow in some places on purpose:

  • only source-controlled built-in extensions are loaded;
  • ambient Pi packages, extensions, prompts, themes, project settings, and package resources are filtered;
  • model credentials and MCP OAuth tokens belong to the local host;
  • web, document, browser, MCP, memory, and model-facing remote content are bounded and treated as untrusted; and
  • missing binary dependencies degrade safely and require explicit interactive installation or disablement.

These controls do not sandbox ordinary shell or filesystem operations. Read the runtime and security guide before using Felan with sensitive repositories.

Architecture

Felan runtime architecture: the local product and Felan cloud platform compose portable extensions over Agent Core and pinned Pi packages.

Felan wraps Pi; it does not fork Pi. Pinned Pi packages provide the model, session, extension, and TUI primitives; Felan owns the host contracts, feature behavior, policy, storage, and presentation around them.

Behavior stays in its owning layer: apps/tui owns local policy, storage, and presentation; ext-* packages own portable feature behavior; and Agent Core owns adapter-neutral runtime contracts and base composition.

Documentation

The documentation hub routes readers by audience:

Repository map

PackagePurposeDocumentation
@felan-ai/felanCost-efficient, model-portable local coding agent and felan binaryLocal CLI
@felan-ai/agent-corePortable runtime contracts, prompt, tools, model tiers, and Pi compositionArchitecture
@felan-ai/ext-subagentsTracked asynchronous subagent protocolAgents and tasks
@felan-ai/ext-tasksDependency-aware root-session task graphAgents and tasks
@felan-ai/ext-prewalkSame-session planner-to-implementation handoffAgents and tasks
@felan-ai/ext-ask-userStructured one-to-four-question inputCommands
@felan-ai/ext-contextProgressive nested project contextContext and memory
@felan-ai/ext-context-viewEstimated context-window usage inspectorContext and memory
@felan-ai/ext-insightsLocal session analytics reportsCommands
@felan-ai/ext-prompt-historyTUI prompt-history pickerCommands
@felan-ai/ext-memoryPortable local-first memory contractsMemory architecture
@felan-ai/ext-output-styleValidated concise, explanatory, and custom response instructionsConfiguration
@felan-ai/ext-web-accessBounded web discovery and matching text/PDF passagesWeb access
@felan-ai/ext-mcpPortable OAuth-only remote MCP gatewayMCP
@felan-ai/ext-felan-apiSingle authenticated Felan API gatewayConfiguration
@felan-ai/ext-browserReviewed agent-browser CLI integrationBrowser
@felan-ai/ext-markitdownBounded office-document conversionDocuments
@felan-ai/ext-background-bashDetached Bash processes and logsCommands
@felan-ai/ext-codexGPT-specific structured tools and request controlsConfiguration
@felan-ai/ext-rtk-optimizerRTK command rewriting and output compactionRuntime dependencies
@felan-ai/ext-codebase-memoryStructural code search, symbol reads, and bounded grep augmentationRuntime dependencies
@felan-ai/ext-powerlineANSI-aware local TUI footerLocal CLI
@felan-ai/ext-session-titleAutomatic first-prompt session namesLocal CLI

Develop from source

Repository development and CI use Node.js 22.20.0 and pnpm 9.15.5:

git clone https://github.com/felan-ai/felan.git
cd felan
corepack enable
pnpm install --frozen-lockfile
pnpm build
node apps/tui/dist/cli.js

Run the complete build, type-check, test, license, packaging, and packed installation suite with:

pnpm verify

To review the Felan Pi themes in a browser, run pnpm theme:preview and open http://127.0.0.1:4173. Use pnpm theme:preview:check for a no-write validation or pnpm theme:preview:build to generate the ignored local artifact at .artifacts/theme-preview/index.html. The preview is a visual review aid; the Pi TUI remains the runtime source of truth.

See Contributing and the maintainer architecture map before changing a shared runtime or public package.

Community and license

Join the Felan Discord community to connect with users and contributors.

Felan is licensed under the MIT License. See NOTICE for third-party attribution and immutable upstream review details.

Contributors

mslavov

138 commits

yboychev

12 commits

felan-ai[bot]

6 commits

Languages

TypeScript

97.3%

JavaScript

2.2%