You use Istok by talking to your agent. This page shows what to say in the situations that come up every day, and what Istok records each time, so you know what the next session will find.
The examples use the project acme-api with Claude Code and Codex. They assume the agent is connected and has the instructions from the Quick start.
Start a task
Describe the work the way you normally would. You do not need to mention Istok.
GET /orders/{id} returns 500 when the order does not exist. Unknown orders should get 404; other errors must stay 500.
What Istok records: a task such as #18 “Return 404 for missing orders” with a description and acceptance criteria. When the agent starts coding it starts the task, which opens a run under the agent’s actor ID and saves exactly what context it was given.
For a question or a one-line fix the agent just answers. Tasks are for work that is worth picking up later.
Check where things are
Ask about the project instead of scrolling back through chats.
What is open in Istok for this project?
3 tasks are open, 2 are blocked. #20 has an active run by Codex; #19 waits on #10.
What happened with task 18? Who worked on it and why did the first attempt fail?
What Istok records: nothing. The agent reads tasks, their history and runs. In a terminal, istok task list and istok task show 18 show the same.
Continue in a new session
Before a session ends or its context is compacted, the agent writes a handoff: what is done, where it stopped, the decisions it made and the next step. With istok hooks install claude --stop (or codex), the agent is reminded to write one when it stops in the middle of a task.
A new chat knows nothing about the old one, but with the hooks installed it is shown the interrupted work as soon as it starts. Otherwise, point it at the task:
Continue task 20.
Continue the unfinished work on payment retries.
What Istok records: the agent starts the task again and receives the latest handoff, recent notes and earlier runs. If its previous run is still active it continues that run; otherwise a new run starts with fresh context. istok resume prints the same interrupted work in a terminal.
Finish with proof
The instructions already ask the agent to validate before completing. You can be explicit about what counts as proof.
Run the full test suite through Istok and close the task only if it passes.
go test ./... passed (validation recorded). Task 18 is done.
What Istok records: a check with the command, its result and its output, attached to the run. The task is completed with a reference to that check, so “done” points at evidence. If a check fails, the failure stays in the history and the task stays open.
A check made elsewhere, such as a CI pipeline or a manual test, can be recorded too; Istok marks it as reported by the agent rather than run by Istok. When no check applies, for example a documentation change, the agent has to give an explicit reason to finish without one. That reason is recorded too.
Remember a rule
When you correct the agent and want the correction to stick, tell it to remember the rule:
Remember for this project: public API fields use snake_case.
The agent saves it as a rule for the project, and later finds and changes saved rules when you ask. From a terminal, add one yourself:
istok context add "API naming convention" --kind decision \
--body "Public API fields use snake_case."
A rule is a short context record with a kind: note, decision, constraint or instruction. Its delivery mode decides when an agent receives it:
always— every run gets it. The default for instructions. Keep these short, because they take space in every run.ranked— included when it matches the task. The default for the other kinds.manual— never included automatically, only when asked for by ID.
istok context list shows what the project has saved; istok context disable switches an instruction off without deleting it.
Keep longer knowledge
Knowledge is for material too long to send with every task: how the refund flow works, why orders use UUIDv7, how to rotate keys. Each run gets only the titles and summaries of current items, and the agent reads a full item when the task needs it.
The usual way to create it is at the end of an investigation (this needs --tools full):
Write up what you learned about the refund flow as a knowledge draft, with this task as the source.
A new item is a draft. Agents rely on it only after you review it and promote it to current:
istok knowledge show ID
istok knowledge review ID --expected-revision 1 \
--note "Checked against internal/refunds on main"
istok knowledge promote ID --expected-revision 2
Editing a draft clears its review. Current items cannot be edited: when facts change, a new reviewed draft supersedes the old one. istok knowledge list and istok knowledge search browse what exists.
Check what an agent saw
When an agent ignored a rule, find out whether it received it.
istok context preview 18shows what starting task 18 would deliver, without starting a run.istok run show RUN_IDshows the context saved for a run, next to its commands and checks.istok context doctorreports expired, oversized and duplicate records.
Several agents, one project
Claude Code and Codex can work on the same project. They share tasks, history and proof, but not their conversations.
Give each agent an identity. The --actor-id you set when connecting the agent is its stable identity; --actor-name is how it is shown. Runs and history entries carry it, so a task shows that Codex made the first attempt and Claude Code the second. If you leave out --actor-id, every MCP process gets a new identity, and a restarted agent cannot continue its own run.
Hand work over. There is no document to write: the task already holds the description, notes, earlier runs and the handoff.
Stop working on task 18, I’ll hand it to Claude Code.
The agent writes a handoff and ends its run, leaving the task open. Then, in the other agent:
Pick up task 18 in Istok. Read the handoff first.
The other agent starts the task at once and gets the handoff.
When a run is left behind. An agent that just went quiet did not end its run. An active run holds a lease, and every Istok call of the agent extends it. If the agent goes quiet for 15 minutes, the lease expires and the run becomes stale. Then:
- the same agent continues its run with its next call, for example after you ask it to continue the task;
- another agent that starts the task closes the stale run as
abandonedand begins a fresh attempt; - you can abandon it at once with
istok run abandon. The run stays in the history and the task is released.
Working in parallel. A task with a live run cannot be taken by another agent, and a task that depends on an unfinished one does not appear among the ready tasks.
Show me the tasks that are ready to start.
When the agent forgets to use Istok
Sometimes an agent starts coding without a task. Usually one of three things is missing:
- The MCP server is not connected. Check with
/mcpin Claude Code or your agent’s MCP settings. - The project is not registered. Run
istok project list, or ask the agent to register the project. - The instructions are missing or too weak. The agent does not know when to use the tools.
To correct it in the moment:
Use Istok for this: find or create a task, start it, and record validation before you finish.
If it keeps happening, replace the short block from the quick start with this longer version in your global instructions (~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, or User Rules in Cursor):
## Working with Istok
Istok is the preferred source of durable project state for non-trivial work in repositories registered with Istok.
Use Istok MCP tools as the primary interface for project state, tasks, context, runs, validation, and repository retrieval. Fall back to the Istok CLI only when MCP is unavailable or does not expose an operation, and prefer structured output.
### Before non-trivial work
1. Determine the current repository or project root.
2. Resolve the project in Istok. If several projects match, use the most specific one. Never silently use a different project.
3. If the project is registered, load its enabled project instructions and use the bounded context Istok assembles for the task. Do not bulk-load all saved context or knowledge.
4. Check existing tasks when the work may already be represented by one.
If the repository is not registered, tell the user, do not initialize it automatically, and continue without Istok unless the user asks to initialize it.
### Tasks
Use a task for feature work, bug fixes, refactoring, migrations, investigations, and other non-trivial changes. Do not create tasks for questions, explanations, tiny edits, or quick code reading.
1. Reuse a relevant task, or create a focused one without waiting to be asked.
2. Start the task and use the run for the current attempt.
3. Record meaningful progress, blockers, dependencies, and decisions as they happen.
4. Before you stop or the context is compacted, write a handoff.
5. Validate the result and record the commands, results, and evidence.
6. Complete the task only after the result is implemented and verified. Implementation alone is not completion.
### Context and knowledge
Follow enabled project instructions returned by Istok. Use context for short durable decisions, constraints, and conventions. Use knowledge for longer current truth such as architecture notes and runbooks: find it through the catalog or search and read only what is relevant.
Distill knowledge as a draft with provenance, verify it against current code, record a review, and promote it only after review. Supersede knowledge that is no longer accurate.
Never write Istok-managed content into the project root. Do not copy active task state into TODO files, plans, or status documents unless the user asks.
### Retrieval and completion
Prefer Istok search and graph tools to locate code, but verify details against the current source before changing it.
Never claim validation passed unless it ran successfully. If some validation could not be performed, say so instead of presenting the work as fully verified. Keep Istok in sync with the work so the user does not have to.
For a repository where every contributor should follow the same workflow, you can also commit a shorter version of these rules to the project’s AGENTS.md or CLAUDE.md.