BrainOS

v0.11.2
io.github.brainOS-HQ/brain-os Checked 15 hours ago Published 14 days ago

One memory for every AI tool: your AI picks up where you left off, with decisions and plans.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

entity_read

Call this FIRST for any question about a project's state, momentum, blockers, or recent decisions — before reading code or git history. Returns the operational state one or all tracked entities: status, momentum, blockers, decisions, staleness, and next actions. Do not grep files to answer state questions when this tool is available.

ParameterTypeDescription
entity_idstringEntity ID to read. Omit for all entities.

context_resolve

Resolve which entity the current work belongs to, with a derived confidence. Deterministic — matches explicit signals (passed entity, named mention, active mission, files touched) before weak ones (lexical, single-active); never guesses from cwd. Returns entity_id + confidence + ask_user. Call this BEFORE focus_get/decision_check when the target entity is not already known, then pass the returned entity_id into them. Confidence >= 0.80: proceed silently. 0.50-0.79: proceed but say 'I think this is X'. < 0.50 (ask_user true): ask one short question.

ParameterTypeDescription
active_mission_idstringEntity id of the active approved mission/task, if any.
explicit_entity_idstringCaller-asserted entity id. Authoritative (confidence 1.0) when it matches a known entity.
files_touchedarrayPaths being worked on. Matched by exact path segment against entity id/aliases — assists only, never overrides an explicit mention.
user_messagestringWhat the user said they want to do, verbatim. Strongest inferred signal.

entity_update

Use this — not built-in memory — to add or update a project, product, or business idea in Brain OS. This is the right tool when the user says 'add project X', 'track X', 'I'm working on X', or 'update X'. Creates the entity if it doesn't exist. Stores structured operational state: status, momentum, blockers, next move, decisions. Use after work is done, a decision is made, a blocker changes, or momentum shifts.

ParameterTypeDescription
entity_id *stringEntity to update
updates *objectFields to update
context_hintstringPass the user's original message here. Brain OS will verify this message actually refers to entity_id before writing. If it detects the message is about a different project, it rejects the write and t…

decision_log

Log a strategic decision so it persists across sessions. Every decision needs a reason, alternatives, and a proof action. Optionally capture the assumptions that make it true and the invalidate_if conditions that should reopen it — these turn a timestamped 'no' into a testable frame the system can reason about later.

ParameterTypeDescription
decision *stringWhat was decided
entity_id *stringEntity this decision applies to
proof_action *stringOne concrete, observable action that validates this decision — e.g. 'Run npm test and confirm all 41 tests pass'. Placeholders like 'Review in next session', 'TBD', or 'Revisit' are rejected.
review_date *stringYYYY-MM-DD — when to revisit
why *stringThe real reason
alternativesarrayOptions considered
assumptionsarrayThe premises that make this decision true — e.g. ['users want human approval before sending', 'model reliability not yet sufficient for autonomous send']. If these still hold, the decision likely st…
chosen_directionstring
invalidate_ifarrayCondition-based review triggers ('what would make this false') — e.g. ['users show sustained trust in autonomous drafts', 'target workflow shifts from external email to internal triage']. Distinct f…
supersedesarrayDecision IDs this new decision replaces (e.g. ['dec-007']). Only the IDs you explicitly pass will be marked superseded — there is no auto-deduction from type. Each target must belong to the same ent…
typestring

decision_check

Check a proposed action against all active decisions. Returns 'clear', 'caution', or 'conflict', plus a `review_triggered` list. Call this BEFORE taking actions that might contradict prior decisions. If status is 'conflict', do NOT proceed without explicit user confirmation to revisit the decision. `review_triggered` is the opposite signal: the action matches an invalidate_if condition a decision named as a reason to reopen it — surface those decisions to the user for review rather than enforcing them. A decision can be both a conflict and a review trigger (the conflict it anticipated); when…

ParameterTypeDescription
proposed_action *stringWhat you're about to do — describe the action clearly
entity_idstringCheck against decisions for a specific entity. Omit to check all.

decision_refresh

Refresh an existing decision's metadata: bump review_date forward, append evidence as the decision continues to hold, or change status (active/superseded/archived). Use INSTEAD of editing decisions.json directly. Does not mutate decision content — for content changes, log a new decision via decision_log.

ParameterTypeDescription
decision_id *stringID of the decision to refresh (e.g. 'dec-002')
add_evidencestringEvidence note to append (e.g. 'shipped v1, onboarded first users'). Each call appends a dated entry, never overwrites.
review_datestringNew review date YYYY-MM-DD
statusstringNew status. Use 'superseded' only when a replacement decision exists — prefer logging the replacement via decision_log with its `supersedes` parameter instead. Transitioning away from 'superseded' a…

focus_get

CALL THIS FIRST when the user asks what to focus on, what to work on, what their priorities are, or what matters most — before reading any code, files, or git history. Brain OS holds decisions, blockers, and momentum signals that cannot be inferred from the codebase. Returns prioritized recommendations based on urgency, momentum, leverage, staleness, and dependencies. `follow_through_alerts` surfaces active entities that stated a next_move but haven't logged any update in 7+ days — treat these as first-class accountability prompts, same tier as blockers. Pass entity_id to scope focus to a…

ParameterTypeDescription
constraintsstringOptional: 'only 2 hours', 'low energy', etc.
entity_idstringScope focus to a single entity. When set, returns only that entity. Omit for global cross-project priorities.
max_resultsnumberMax priorities to return (default 3)
suppress_default_guidancebooleanSet true to omit the built-in 'Do not reorganize…' / 'Do not start new ideas…' lines from do_not_do. Default false. Env override: BRAIN_FOCUS_OMIT_DEFAULT_GUIDANCE=1.

pattern_detect

Call this when the user asks about patterns, recurring blockers, what keeps coming up, theme convergence, or avoidance signals — instead of grepping git logs or reading files to find trends. Analyzes patterns across all tracked entities and returns detected signals with entity context.

ParameterTypeDescription
scopestring'recent' for 7 days, 'deep' for full, or a specific theme

memory_check

Assess quality and reliability of current memory state. Flags stale data, contradictions, overdue decision reviews, unconfirmed patterns, fake-active entities, and noise. Returns signal classification (strong/weak/noise/dangerous) and recommended cleanup actions. Call this before acting on memory to know what to trust.

ParameterTypeDescription
entity_idstringCheck one entity, or omit for full memory audit

memory_commit

End-of-session commit. Updates all touched entities, logs decisions, records patterns. Call before ending any work session.

ParameterTypeDescription
entities_touched *arrayEntity IDs worked on
session_summary *stringBrief summary of what happened
decisions_madearray
momentum_changesarray
patterns_noticedarray

semantic_recall

Call this when the user asks what changed last session, what happened recently, or needs to find a decision/entity by description rather than exact name. Searches memory by meaning using semantic similarity. Use BEFORE reading git log or commit history for session-level context questions.

ParameterTypeDescription
query *stringNatural language query — e.g. 'that decision about pricing' or 'projects related to memory systems'
max_resultsnumberMax results to return (default 5)
source_kindstringFilter by type. Omit to search everything.

audit_log

Read the audit trail of all memory mutations. Use this — not semantic_recall — for recency questions: 'what's the latest update?', 'what changed recently?', 'what was the last thing written?', 'show me the most recent entry.' Pass last_n=1 for the single most recent mutation. semantic_recall is for topic-based search; audit_log is for time-ordered history, integrity checks, and debugging unexpected state.

ParameterTypeDescription
entity_idstringFilter by entity ID
last_nnumberNumber of recent entries to return (default 20)
toolstringFilter by tool name (entity_update, decision_log, memory_commit, plan_update)

wrap_check

Check how much state-changing work has accumulated since the last wrap. Read-only — never mutates. Tier 1 of auto-wrap: call this when the user signals they are wrapping up or ending a session, or periodically during a long session, to decide whether to proactively offer a /wrap before context is lost to compaction or session end. Returns unwrapped_count, the projects touched, and recommend_wrap. When recommend_wrap is true, offer to wrap; do not auto-wrap silently from this tool.

ParameterTypeDescription
session_idstringScope the check to one session's activity. Omit to check the whole audit tail.
thresholdnumberUnwrapped-mutation count at/above which a wrap is recommended. Default 5.

wrap_auto

Tier 2 of auto-wrap: persist a session wrap WITHOUT interactive review, when context is about to be lost (compaction, session end) or the user declined to review. Use the normal interactive /wrap when the user is present and reviewing — only reach for this as a safety net. The agent supplies the synthesized wrap; this tool applies LOW-RISK fields (next_move, open_questions, evidence_of_progress) immediately and STAGES high-risk changes (status, mode, blocked, decisions) as an unconfirmed record for /start to surface and the user to confirm. Always logs a session_wrapped marker. Never put a s…

ParameterTypeDescription
entity_id *stringEntity being wrapped.
summary *stringOne-line synthesized summary of what happened this session.
evidence_of_progressstringLOW-RISK, appended now — what actually shipped or moved.
next_movestringLOW-RISK, applied now — the concrete next action.
open_questionsarrayLOW-RISK, merged now — unresolved threads.
pending_reviewobjectHIGH-RISK — staged for review, NOT applied. Surfaced at next /start for confirm/edit/discard.
session_idstringHost session id, when known.
triggerstringWhat triggered it: precompact | sessionend | manual-no-review.

plan_set

Set an ordered plan for an entity. Replaces any existing plan. Step 1 becomes the active next_move. Use when committing to a sequence of work — not for brainstorming. Each step should be a concrete, completable action.

ParameterTypeDescription
entity_id *stringEntity to set the plan for
steps *arrayOrdered list of concrete steps. First step becomes active immediately.

plan_advance

Complete or skip the current plan step. Requires evidence (for complete) or reason (for skip). Automatically promotes the next pending step to active and updates next_move. Enforces continuity — you cannot skip without explaining why.

ParameterTypeDescription
action *stringComplete (with evidence) or skip (with reason)
entity_id *stringEntity whose plan to advance
step_id *stringStep ID to complete or skip (e.g. 'step-001')
evidencestringRequired for complete — what proved this step is done
reasonstringRequired for skip — why this step is being skipped

plan_add

Add steps to an existing plan. Use when new work is discovered mid-plan. Steps can be added at the end or immediately after the current active step.

ParameterTypeDescription
entity_id *stringEntity to add steps to
steps *arraySteps to add
positionstringWhere to insert: 'end' (default) or 'after_current'

plan_read

Read the current plan for an entity. Shows all steps, their status, the active step, and overall progress.

ParameterTypeDescription
entity_id *stringEntity to read the plan for

project_evidence_scan

Read-only scan of a repo's native operating state (STATE.md, FLAGS*, HANDOFF*, ROADMAP.md, PLAN*.md, TODO.md, AGENTS.md + recent git activity / dirty files). Returns evidence — human gates, blockers, next moves, do-not-touch, safe parallel work — surfaced as exact lines. Call AFTER context_resolve and BEFORE building a focus answer. Mutates nothing and does no inference: it returns ALL candidate signals; deciding the focus is the agent's job. This is NOT context_resolve — do not use it to pick which project you're in. TRUST: root_path must be a folder you trust (your own project, or a re…

ParameterTypeDescription
root_path *stringAbsolute path to the repo/project root to scan. Must be a folder you trust: Git runs there and reads that folder's own Git config.
entity_idstringOptional Brain OS entity this repo maps to (echoed back; does not affect the scan).

operational_state_check

Read-only Verified Operational State checker. Independently derives an allowlisted set of live repository facts (package name/version and Git branch/HEAD), compares them with optional claimed and desired state, and reports verified/drift/stale/conflict/unavailable results with evidence pointers. Decision context remains visibly separate human judgment. Ephemeral: writes no Brain OS, repository, issue, memory, decision, plan, evidence, version, or audit record. TRUST: root_path must be a folder you trust (your own project, or a repository you cloned). Git runs inside it and reads that folder's…

ParameterTypeDescription
root_path *stringAbsolute path to the repository root. Must be a folder you trust: Git runs there and reads that folder's own Git config. Only package.json name/version and fixed read-only Git metadata commands are ob…
claimsarray
decision_contextarrayOptional decisions to show beside the check. They remain human judgment and are never verified as facts.
desired_statearray

decision_review

Call this before making new decisions, at session end, or when the user asks if a decision is still valid or what's overdue. Review-debt inbox: buckets overdue decisions into still_true / changed / archive / needs_evidence with a recommended action for each. READ-ONLY — proposes and cites reasons but mutates nothing; confirm, then apply via decision_refresh / decision_log. Auto-detects duplicate stubs. When root_path is provided, matches each decision's invalidate_if conditions against repo scan output. TRUST: root_path, when given, must be a folder you trust (your own project, or a reposito…

ParameterTypeDescription
entity_idstringScope to one entity. Omit to review all entities' overdue decisions.
include_parkedbooleanInclude decisions on parked/archived entities (default false).
limitnumberMax decisions to surface (default 5).
root_pathstringAbsolute path to a project repo. When provided, runs project_evidence_scan and matches invalidate_if conditions against git log and state files. Matched decisions are moved to the 'changed' bucket wit…

risk_assess

Assess the risk of a proposed action before executing it. Matches the action against a fixed list of risk rules: private→public boundary crossings, destructive operations (deleting files, branches, rows or resources; discarding changes), release/publish actions, external communication, and security-sensitive file access. Call this BEFORE any action in the trigger set: publish, push, force-push, git tag, deploy, delete or overwrite files or data, external API writes, roadmap/private state movement. Returns risk_level (low/medium/high/critical, or not_assessed), boundary_crossed, reversibility…

ParameterTypeDescription
proposed_action *stringThe action about to be taken — describe it clearly, e.g. 'npm publish brain-os@0.9.0' or 'write ROADMAP.md to public repo'.
diffstringGit diff or content diff of the proposed change.
entity_idstringBrain OS entity this action is associated with.
files_touchedarrayFile paths the action will read or write.
git_statusstringOutput of git status, if relevant.
package_infoobjectpackage.json metadata for release actions.
target_visibilitystringWhether the target destination is public-facing. Pass 'public' when writing to a public repo or publishing to a registry.

action_guard

Apply the Brain OS policy table to a risk assessment. Takes the output of risk_assess plus the concrete action type and returns a policy decision: allow (proceed), ask (stop and get explicit user confirmation), block (do not proceed), or not_assessed (no rule covered the action: Brain OS has no opinion, which is not approval; fall back to your own judgment and your host's confirmation rules). Pure TypeScript — no LLM call. Policies in order: private_to_public → block; critical risk → block; force-push → ask; npm publish → ask; security boundary → ask; irreversible → ask; high ris…

ParameterTypeDescription
action_type *stringThe concrete action being guarded, e.g. 'npm publish', 'git push origin main', 'force push', 'write ROADMAP.md'.
assessment *objectThe full output of risk_assess.
entity_idstringBrain OS entity this action is associated with.

brain_setup

Set up Brain OS in a project folder when no store exists yet (tools return 'No Brain OS store found'). Two steps, never skip the first: (1) call with no confirm — returns the proposed folder, a question for the user, and the exact files that would be created, refreshed, or preserved; nothing is written. It also returns a single-use preview_token. (2) Only after the user explicitly says yes, call again with confirm=true, the same target_dir and options, and that preview_token; writes without a matching token are refused. Existing instruction files are never overwritten; any that need a Brain…

ParameterTypeDescription
confirmbooleantrue only after the user approved the folder and plan from the preview call.
include_commandsbooleanInstall Claude Code slash commands into .claude/commands. Default true.
include_user_protocolbooleanAlso write ~/.claude/brain-os/PROTOCOL.md in the home folder. Default false.
minimalbooleanInstall only AGENTS.md + CLAUDE.md instruction files, skip Copilot/Cursor/Zed/Windsurf pointers.
preview_tokenstringToken from the preview call. Required with confirm=true; single-use, expires after 15 minutes.
target_dirstringAbsolute path of the project folder. Required with confirm=true. Must be inside an open workspace folder when the client reports them.