Skip to main content
Run corestory help <command> or corestory <command> --help for the same information in your terminal. Every command except setup and update works on the corpus in the current folder, so run them from the repository root.

Machine setup

setup

Accept the Terms of Use and Privacy Policy, choose whether to share anonymous usage data, and configure model providers. Settings are saved to ~/.config/corestory/config.toml and apply to every repository on the machine. Setup is interactive, and other commands do not run until it is complete.

update

Check for and install new CLI releases. Every release’s signature is verified before installation, even with --force.

Corpus and snapshots

init

Create a corpus in the current folder. This creates .corestory/ and records the corpus settings. It does not read your files or call any models.

ingest

Read the repository and build a new snapshot. By default it reads the working tree as it is now, including uncommitted changes. This command calls your model provider, so it costs money on your key. Cost and time grow with the size of the repository. Aliases: build, b.
Targets. Most people should use the default. Use targets to rebuild one part of a snapshot or to control model spend:

list

List the corpus’s snapshots, newest first.

summary

Show the selected snapshot: its ID, label, creation time, and content hash.

delete

Delete the corpus and all of its snapshots. Aliases: rm, drop.
delete does not ask for confirmation. Snapshots cannot be recovered afterward, and rebuilding them means paying for a new ingest.

Agents

mcp

Start the local MCP server over standard input and output. Coding agents run this command themselves, so you rarely run it by hand. It serves the corpus in the folder it starts in. See Connect Your Agent for setup and the list of tools.

Exploring a snapshot

These commands read the selected snapshot. They do the same lookups as the MCP tools, so you can check what your agent sees. Add --json where available to get the same JSON the MCP tools return. Search results and graph lookups return entities. Two kinds come up most often:
  • Chunks (plot:Chunk): a section of a source file
  • Rules (sao:Rule): a business rule the code enforces, with its summary and evidence
Each entity has an ID that you can pass to entity show and entity connections. Find code and rules related to a description, ranked by meaning. The query is embedded with your embedding model, so it makes a small model call.

rules-for

List the rules whose evidence falls in a file, or in a range of lines within it. Use this before you change a file to see what it enforces. This is an exact lookup, so it makes no model calls.
An empty result does not prove that no rules apply. A rule can be evidenced in a different file, and extraction can miss rules. Read the code before concluding a file enforces nothing.

entity show

Show one entity’s details and source locations.

entity connections

List the links into and out of an entity: for a rule, its summary, its evidence, and the file content it was found in.

explore

Browse the snapshot in an interactive terminal view. It starts at an overview of the snapshot, a search, or one entity, and you move between results and connections from there.

Files and settings