Skip to main content

Session Intelligence

All Tiers

A closed intelligence loop: your sessions end with a debrief, agents process overnight, and your next session starts with a briefing

The Intelligence Loop
Every session makes the next one smarter

Session Intelligence connects the end of one coding session to the start of the next. When you finish work, ACE captures what happened. Between sessions, agents analyze your changes. When you start again, you get a briefing of everything that was discovered.

Session Intelligence Loop

End SessionDebriefAgents ProcessBriefingStart Session
No manual work needed — hooks automate the entire cycle
Pre-Session Briefing
Start every session with full context from your agents

When you start a new coding session, the briefing hook calls the ACE API and injects agent intelligence into your AI's context. This means your AI immediately knows about contradictions found, quality issues flagged, patterns learned, and open issues — without you having to explain anything.

The briefing queries 6 data sources:

SourceWhat it returnsPriority
observationsAgent findings — contradictions, quality issues, insightsSorted by severity (critical first)
decisionsProposed decisions awaiting your reviewMost recent first
agent_eventsSignificant events: risks identified, relationships discovered, knowledge correctionsMost recent first
agent_runsAgent activity summary — how many runs, failures, items processedGrouped by agent
issuesOpen issues (not time-filtered — always shows unresolved work)Critical/high first
memoriesHot memories — things your AI keeps needing (access_count ≥ 3)Most accessed first

Example briefing output

This is what gets injected into your AI's context at session start:

## Session Briefing (last 24h) **Activity**: 14 agent runs (0 failures), 3 proposed decisions, 5 open issues ### Open Issues (5) - **[critical]** /settings/users is a stub - no user management exists - **[critical]** No User.status field - cannot deactivate users - **[high]** API rate limiter not enforcing weekly limits ### Recent Decisions (3) - Add semantic search to all list methods across all 10 entity types - Standardize on Python 3.13 with single venv - Use JWT refresh tokens for session persistence ### Agent Findings (2) - [warning] Knowledge Guardian: Contradictory patterns detected in auth module - [info] Pattern Detector: Recurring test failure pattern in CI

API Endpoint

POST /api/v1/{namespace}/sessions/begin

Returns agent intelligence from the last N hours (1–168). Default: 24 hours. Hours are read from your saved dashboard config (Settings → Session Hooks).

MCP Tool

ace_session_briefing()

Available on Pro, Founder, and Enterprise plans. Uses your weekly API budget.

CLI Command

ace session start --format markdown

Formats: markdown (for AI context), json, or default human-readable.

Post-Session Capture
Automatically log what happened in each session

The PreCompact hook runs automatically when Claude Code compacts your conversation context. It parses the transcript and creates a work log in ACE with session statistics — edits, reads, writes, and bash commands.

What it captures:

File edits, reads, and writes
Bash commands executed
Files modified (last 10)
Session ID and timestamp

Automatic: The PreCompact hook only fires on automatic compaction (when your context window fills up), not manual compaction. This ensures work logs reflect real session activity.

Session Debrief
Record a rich summary of what happened in a session

The debrief endpoint records a session summary as three separate entities, each serving a different purpose in the intelligence loop:

Work Log

What was done. Visible in the dashboard timeline. Includes summary, files changed, hours worked, and tasks completed.

Memory

Key learnings. Stored as session_debrief_{timestamp}. Retrievable by future recall() queries so context carries forward.

Observation

For agent processing. Agents pick up observations between sessions to detect patterns, flag risks, and discover relationships.

Request Body

{
  "summary": "Implemented auth middleware and wrote tests",
  "files_changed": ["src/auth.ts", "tests/auth.test.ts"],
  "decisions_made": ["Use JWT over session tokens"],
  "issues_encountered": ["CORS config needed for staging"],
  "session_id": "optional-session-id",
  "duration_minutes": 90
}

API Endpoint

POST /api/v1/{ns}/session/debrief

MCP Tool

ace_session_debrief(summary="...")

CLI Command

ace session end "summary of what was done"
MCP Prompts
Pre-built prompts that wrap the intelligence loop

ACE provides two MCP prompts that wrap the briefing and debrief into ready-to-use instructions for your AI tool.

start-session

Fetches your briefing and presents it as a structured context block. Use at the beginning of any session.

start-session(project="my-app")

end-session

Guides you through recording a debrief with summary, files, decisions, and issues.

end-session(summary="...")
Setup Guide
Get the full intelligence loop running in minutes

Claude Code (Automatic)

Zero setup required. Session hooks are automatically installed when you run ace login. The briefing hook, MCP config, and settings are all configured for you.

1

Install and login

npm install -g @ace3-memory/ace
ace login

This automatically installs the session briefing hook, MCP server config, and Claude Code settings.

2

Start a Claude Code session

The session briefing automatically runs at the start of every session, injecting agent intelligence into your AI's context.

What gets installed: A session hook at ~/.claude/hooks/ace-session-start.sh that runs ace session start on every session. The hook and settings are added to your global Claude Code config so they work in every project.

Optional: Project-level hooks

To install hooks for a specific project instead of globally, run inside the project directory:

ace hooks setup --provider claude-code

All AI Providers (MCP)

Session intelligence works with every MCP-compatible AI tool. Claude Code has automatic hooks, but the MCP tools work with Cursor, VS Code, Windsurf, ChatGPT, Gemini, and any MCP client.

ace_session_briefing()

_session_alerts: [{severity: "critical", message: "..."}]

ace_session_debrief(summary="What I did this session")
Cursor / Windsurf — Add to .cursorrules or .windsurfrules: "At start, call ace_session_briefing. At end, call ace_session_debrief."
VS Code / Copilot — Add to .github/copilot-instructions.md or Continue rules file.
ChatGPT / Gemini — MCP tools available directly. Call ace_session_briefing at conversation start.
Claude Desktop — Use MCP prompts: /start-session and /end-session.
Agent Processing Between Sessions
What happens while you're away

Between sessions, autonomous agents run on 2–4 hour cycles, processing the data captured by your debriefs and work logs. Their findings appear in your next session briefing.

Session Manager

Scans work logs, memories, and episodes for context gaps. Flags long periods without activity and surfaces relevant historical context when you resume.

Runs every 2h

Knowledge Guardian

Checks new debriefs for contradictions with existing knowledge. Catches stale data and knowledge graph drift before it causes problems.

Runs every 3h

Pattern Detector

Identifies recurring patterns across sessions. Consolidates observations into higher-level insights and identifies emerging risks.

Runs every 4h

Observation Consolidator

Merges related observations from different agents into consolidated insights. Reduces noise so your briefing contains high-signal findings.

Runs every 3h

All 10 agents contribute to session intelligence. The agents above are the most directly involved. See Agentic Intelligence for the full list.

CLI Commands
Manage sessions from the command line
CommandWhat it doesWhen to use
ace session startFetches and displays the session briefingRuns automatically via hook. Or run manually anytime.
ace session log "..."Quick mid-session work log entryAfter completing a milestone mid-session
ace session end --summary "..."Records a debrief (work log + memory + observation)When finishing a coding session

Options

ace session start --hours 48 --format json
ace session log "Fixed auth bug" --tags "bugfix,auth" --files "src/auth.ts"
ace session end --summary "Shipped v2.1" --hours 3 --files-changed "src/api.ts,tests/api.test.ts"
Dashboard Configuration
Customise session intelligence per namespace

Session hooks are configurable per namespace in the dashboard at Settings → Session Hooks.

Briefing settings

  • Lookback period (1–168 hours)
  • Which agents to use for briefings
  • Include/exclude: agent insights, open issues, proposed decisions, hot memories

Debrief settings

  • Auto-debrief on/off
  • Which agents process debriefs
  • Agent sequence mode (parallel, sequential, consensus)
  • Auto-learn from session patterns
Session Coordinator
Multi-agent coordination across session phases

The Session Coordinator maps agents to specific session phases. Each phase can run agents in parallel or sequential mode, with context flowing between phases.

Briefing: Session manager gathers context, error tracker checks recent issues
Analysis: Guardian, pattern detector, and analyzer run in parallel
Work: Best practice enforcer monitors in the background
Debrief: Decision recorder and memory consolidator capture learnings

5 session templates: Default, Development, Code Review, Incident Response, Learning. Each template pre-configures which agents run in which phase with appropriate execution modes.