Skip to main content

Coding Agent Overview

Coding Agent is AI4J's runtime and host entry point for local code repository tasks. It is not "a general-purpose agent with a few file tools bolted on", but rather organizes workspace, tools, sessions, approval, MCP, Skills, and CLI/TUI/ACP into a single local development workflow.

If you want to embed a general-purpose agent in a business system, start with Agent. If you want AI to read files, run commands, write patches, persist sessions, and accept host approval inside a code repository, read this section.

In One Sentence

Coding Agent addresses:

Inside a local code repository context, letting the model complete trackable, recoverable, approvable development tasks through controlled tools.

Its core value is not just "being able to call bash", but rather that workspace, tool policy, session lifecycle, and host protocol live within the same runtime model.

Module Responsibilities

ModuleResponsibility
ai4j-codingcoding runtime, workspace-aware tools, outer loop, compact, child session
ai4j-cliCLI, TUI, ACP host, session store, provider profile, approval UI
ai4j-agentunderlying Agent runtime
ai4jfoundation capabilities such as model, Tool, Skill, MCP

A simple way to remember:

  • ai4j-coding decides how a task runs.
  • ai4j-cli decides how a person or external host uses it.

Suitable Scenarios

ScenarioSuitable?
Embedding a general-purpose business agent in a Java projectPrefer ai4j-agent
Local code repository Q&A, modification, verificationYes
Needing a CLI or TUI as the development entry pointYes
Needing an IDE / desktop app to integrate through a structured protocolYes, via ACP
Needing files, commands, patches, approval, and session stateYes
Only a single model call or Tool callCoding Agent not needed
Needing a visual workflow canvasSee FlowGram

What a Single Run Includes

When Coding Agent is assembled, it simultaneously decides:

  • The current workspace and path boundary.
  • The visible built-in tools, such as read file, write file, shell, and patch.
  • Whether to wire in MCP tools.
  • The available Skills and workspace instructions.
  • The provider profile, model, baseUrl, and apiKey source.
  • The approval policy.
  • Whether the session is created, recovered, saved, or forked.

Therefore, CLI, TUI, and ACP are not three separate agents, but rather three host entry points. They share the same core runtime, but differ in interaction style and approval channel.

Three Entry Points

Entry pointSuited forFocus
CLIUsers who want to run a quick one-shot or REPLprovider, workspace, session, command arguments
TUIPeople who work in the terminal for long stretchesslash command, state view, interaction density
ACPIDEs, desktop apps, custom frontendsJSON-RPC session, permission request, host-injected capabilities
More than three top-level subcommands

The table above distinguishes the three entry points CLI/TUI/ACP by host interaction mode. But the ai4j-cli executable itself exposes more top-level subcommands: beyond the three session-style entry points code/tui/acp, there are also run (run an Agent Blueprint YAML once), extension (inspect/assemble/run extension packages), and trust (manage workspace hook trust directories). See Command Reference §7 for the full list.

If you are only evaluating features, start with Quickstart and CLI / TUI.

Core Concepts

ConceptDescription
WorkspaceThe current code repository context and file boundary
Built-in ToolsCoding-native tools such as read file, write file, shell, and patch
ApprovalThe confirmation mechanism for high-risk tool calls
SessionWork state that can be saved, recovered, and forked
Compact / CheckpointContext compaction and state retention during long tasks
Provider ProfileThe combination of provider, protocol, model, baseUrl, and key source
SkillsWorkflow instructions and project experience that the model reads on demand
MCP / ACPMCP wires in tool capabilities; ACP wires in the host application

Security and Limits

Security boundary

Coding Agent has a larger high-risk surface than a normal agent, because it may touch the file system, shell, processes, and external services.

Before going to production or long-term use, confirm that:

  • The workspace root directory is correct and the forbidden paths are explicit.
  • Write file, shell, patch, and package manager commands have approval rules.
  • The session store does not record real secrets.
  • MCP tools are not exposed in full by default.
  • Subagents or delegation do not cross the original permission boundary.
  • Run output and traces do not leak private code or configuration.

Related pages:

Direct Use

  1. Why Coding Agent
  2. Quickstart
  3. Install and Release
  4. CLI / TUI
  5. Provider Profiles
  6. Tools and Approvals
  7. Session Runtime

Extension Development

  1. Architecture
  2. Runtime Architecture
  3. Prompt Assembly
  4. MCP and ACP
  5. Command Reference

If you want to compare Coding Agent with agent SDKs in the JS/TS ecosystem, see Comparison.