v0.3.56 source version · three everyday journeys · from the first instruction to long-term continuity

From the first instruction
to the next handoff

Three complete everyday journeys—tidying a Downloads folder, researching a café business, and evolving a long-running AI project—show Agent Handoff Kit from installation through handoff. At each stage the AI says which working mode it loaded, how it will plan, how it will verify the result, and when it will synchronise the next-session prompt.

Version note: this page is aligned with v0.3.56. The version actually obtained through @latest is determined by the npm registry. Terminal output below is a v0.3.56 example.

🚀 First time here?

You do not need to read this guide first. In the folder you want to work in, open an AI agent that can read and write local folders. Ask it to read agent-handoff-kit-ai-install.html and install or upgrade there. After installation, if the AI is already in the correct project, type:

Start Agent Handoff
or: 開工

Only if the AI is not yet pointed at the folder, use: Work in <your folder>. Read AGENTS.md first, then Start Agent Handoff. The AI follows AGENTS.md to the authoritative SESSION_HANDOFF. A plain start only shows the current state, risks and recommended next step, then waits for your next message; a same-message task starts work directly. START_NEXT_SESSION_PROMPT.txt is only for an AI that has not yet been pointed at the folder. To finish a session, say Wrap up Agent Handoff.

Ordinary web-chat AI that cannot read and write your local folder is not suitable for this tool. This guide demonstrates long-running local-agent work.

01Install completeThe AI has placed the handoff files
02Say “Start”Read the previous state
03AI continues workLoad rules for the task
04Say “Closeout”Save handoff and checks
05Next time say “Start”A new conversation picks up the same baton
( o.o )

continuity ready

Ready to continue. The AI has read the handoff state and can proceed from the current objective.

( -.- )

handoff saved

Closeout has been saved. Next time, say Start Agent Handoff or 「開工」 in the same project.

( x.x )

handoff blocked

Not broken: something remains unsaved, uncommitted, unverified, or unresolved. Follow the Blocker line before treating the round as handed off.

⚙️ These three journeys assume the relevant external tools are already connected in the AI tool (GitHub, Notion, Google Drive, and so on). If they are not connected, the AI pauses at that step and asks you to set them up, or produces material you can synchronise manually.

After a long task uses MCPs, a browser, automation, notebooks, or helper servers, the AI closes only resources it can prove belong to this task. For an unknown, shared, user-owned, or other-agent-owned resource, it records the evidence and waits for your confirmation.

AI working rules

The AI does more than read a handoff: it changes working mode for the task

The point of Agent Handoff Kit is not merely to remember where work stopped. After startup it helps the AI select task-appropriate rules. A new user needs one simple idea: you state the goal; the AI chooses the working rules; a high-risk operation stops for your approval.

What happens after startupautomatic sequence
1. Start: read the authoritative handoff for current state, next action and risks; read the project index only when the task needs it.
2. Classify the task: writing, development, research, knowledge organisation, or external tools.
3. Load rules: only relevant packs, not every internal file at once.
4. Work and verify: plan first, read facts, make changes, then check them in a verifiable way.
5. Wrap up: durable state returns to the handoff; one-off output does not pollute long-term rules.
YouWhen we write public Chinese documents in future, use formal Traditional Chinese and avoid half-Chinese, half-English wording. Connect this rule to Agent Handoff Kit.
AII will first decide whether this is a one-off preference, next-handoff state, a project-index fact, or a long-term working rule. For a durable rule I will find the existing source of truth instead of putting everything into one file.
Adding your own rule

Do not begin by editing rule files yourself. Say: “Connect this lesson to Agent Handoff Kit”, “Connect this document to Agent Handoff Kit”, or “Turn this mistake into a future mechanism.” The AI should decide whether it belongs in handoff state, the project index, a sync register, a durable decision, or a working rule.

Advanced maponly when you want the internal structure
dev/RULE_PACKS.md routes rules to tasks. onboarding.md is only made available by first install; it does not start automatically. A clear goal starts directly, while no goal yet leads to guidance or short questions. safety.md covers deletion, Git, releases, external APIs and secrets; writing.md covers public writing; research.md covers source comparison and uncertainty; coding.md covers code and tests; agent-governance.md covers handoff and long-term governance; release.md covers versions, tags, releases, deployment and npm publishing; knowledge.md covers Notion, Drive and source-of-truth boundaries; integrations.md covers connectors, MCPs, plugins, skills, credentials and resource closeout; communication.md covers language and user-facing reporting.
Step 01 · Case A

Install — one instruction creates the handoff files in the folder

You can give this first step to an AI agent that can read and write the local folder. Create an empty folder such as ~/Downloads-tidy, open the AI there, and ask it to read the AI install page. It confirms the current folder, then decides whether to install, upgrade, or stop. Use the terminal route only if you want to do it yourself.

AI conversation~/Downloads-tidy
Please read https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html and install or upgrade Agent Handoff Kit in this folder.
Manual terminal route~/Downloads-tidy
$ npx --yes @adamchanadam/agent-handoff-kit@latest init

📋 Before writing: no Kit files are present. The tool will create handoff files, AI entry files and working rules. No existing files will be overwritten.

create: 21
AGENTS.md · CLAUDE.md · GEMINI.md · START_NEXT_SESSION_PROMPT.txt
dev/SESSION_HANDOFF.md · dev/SESSION_LOG.md · dev/PROJECT_INDEX.md
dev/DOC_SYNC_REGISTRY.md · dev/RULE_PACKS.md · dev/PROJECT_DECISIONS.md
dev/rules/safety.md · dev/rules/coding.md · dev/rules/onboarding.md · dev/rules/integrations.md · ...

Continue? (yes/no): yes

✅ created: 21 · 🔀 merged: 0 · ⏭️ skipped existing: 0
📦 Version: v0.3.56 · 🛠️ Mode: first-install
🔎 Just finished: init; create 21 / merge 0 / skip 0 / conflict 0.
🚀 Next: leave the terminal and open your AI tool to start Agent Handoff.

⚠️ This is not a terminal command. In an AI conversation in this folder, type:
Start Agent Handoff
or: 開工

Only if the AI is not pointed at this folder:
Work in ~/Downloads-tidy. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.
What was created

One set of rules, three AI entry points

  • Three entries, one rule set: AGENTS.md, CLAUDE.md and GEMINI.md are created together. Antigravity reads the folder’s AGENTS.md and GEMINI.md; GEMINI.md is a bridge, not a second rule set.
  • The AI install page confirms the folder first: before confirmation it should not run init, upgrade or doctor.
  • The next line belongs in AI chat: newcomers often paste Start Agent Handoff into a terminal. The warning marks that it belongs in the AI conversation instead.
  • Important documents can be connected: after an AI creates a stock list, production guide, workflow or checklist, say Connect docs/example.md to Agent Handoff Kit.
  • Run doctor only when uncertain: normally start the AI directly. If you later doubt the files, run npx --yes @adamchanadam/agent-handoff-kit@latest doctor. A temporarily lagging next-session prompt is a reminder to synchronise at closeout, not an excuse to overwrite work.
Step 02 · Case A

Start the handoff — plain start shows status; a task starts work

Open a new conversation in an AI agent that can read and write the local project folder. If it is already in the right project, you may type Start Agent Handoff or 開工; that only recovers the minimum state, shows the current objective, risks and recommended next step, then waits for your next message. When the platform can safely read and control the current title, the AI may use already-loaded facts to replace a generic or stale title with <project name>|<primary action>; it keeps an informative title, skips silently when unsupported, and performs no extra file or network reads. The title is display-only, not state, progress, or authority. If you include the goal in the same message, or explicitly say to continue to the next blocker or finish the current objective, the AI may begin under the normal task rules.

You
Start Agent Handoff
What actually happens

The start phrase is not automatic execution authority

  • A plain start stops after status: the AI reads only the minimum handoff state, shows the startup card, risks and recommended next step, and does not search, plan or start a task.
  • A same-message task can start: you can write “Start Agent Handoff, tidy my Downloads”; when facts are sufficient, the AI chooses the closest working situation without making you choose A–F.
  • Guidance needs a real signal: phrases such as “teach me”, “I’m new” or “help me start”, or a task that still needs clarification, are what load newcomer guidance.
Step 03 · Case A

When you enter only the start phrase — show status, recommend the next step, then wait

In this example the user entered only Start Agent Handoff and the fresh project’s handoff had no goal. The new behaviour is not a menu, a plan or a task protocol. The AI shows the current state and recommended next step, ends the turn, and waits for the user to provide a task. To begin work, the user sends the task in the next message or includes it in the original startup message.

This response stops after the startup card

AI (started from AGENTS.md)
   /\_/\   Agent Handoff Kit vX.Y.Z
( o.o ) continuity ready
> ^ <

🔎 Handoff state: fresh install
📌 Current objective: not set
⚠️ Risks: none
🚀 Recommended next step: tell me what you want to do, for example “tidy Downloads and show me a preview first”.

I have read that this is a fresh install and no task objective is set yet. Tell me what you want to do next; if you want guided onboarding, say “teach me how to start”.

YouI want to tidy ~/Downloads. It has one or two years of mixed files—more than a thousand. Sort by documents, images, installers, archives and others; then by year. Make a small reusable tool. I must see a preview list before any real move.
AI · narrowed task

You have now provided a clear task, folder, sorting direction and safety limit. The first small task is: build a reusable Downloads organiser, but produce only the preview list; do not move files yet.

That is safest for a large file move. After you accept the preview, the next step can perform the real move.

Coding write the organiser Safety protect a large file move

After you confirm this first scope, the work follows five visible stages: plan → read → change → check → approved execution. I will plan the rules, read the folder facts, write the reusable tool, show the preview, and wait for your separate approval before any real move.

What actually happens

Status and work start are separate

  • A plain start returns only status: the AI does not turn an empty handoff into a task plan.
  • The next task message starts work: in this example the Downloads request is what lets the AI enter Coding and Safety.
  • High-risk work still stops: moving many files is irreversible, so the AI must stop at the planning stage and wait for confirmation.
Step 04 · Case A

You confirm; the AI plans, reads, then changes code

After you approve the first small task, the AI loads Coding and Safety. It writes a plan before it writes code, scans real facts before it designs the script, and writes a dry-run option before it proposes a real file move.

AI · plan, then read

Plan: sort .pdf, .docx, .doc, .txt, .md, .rtf and .pages as documents; .jpg, .jpeg, .png, .gif, .webp, .heic and .svg as images; .dmg, .pkg, .exe, .msi, .deb and .rpm as installers; .zip, .tar, .gz, .7z and .rar as archives; and unknown types as others. Put each under a year. Exclude shortcuts, hidden files and directories. Preserve collisions by adding _1, _2. Do not touch files outside ~/Downloads.

Before scanning: I will show this plan and wait for your “yes, continue” before I inspect the folder. The later approval for the preview is separate from this read-stage confirmation.

Read: scan the actual folder for extensions, dates and a sample—not guesses. The sample contains a HEIC image, a PDF bank statement, a DMG installer, a ZIP archive and a screenshot. The scan finds 1,043 files.

Change: write ~/Downloads-tidy/sort_downloads.py with --dry-run. It prints where each file would go and moves nothing until a separate confirmation.

~/Downloads/IMG_2837.HEIC              (2025-04, image)
~/Downloads/bank-statement-2024-11.pdf (2024-11, document)
~/Downloads/Notion-2.0.41.dmg (2024-08, installer)
~/Downloads/design-backup.zip (2025-01, archive)
~/Downloads/Screenshot 2025-03-15.png (2025-03, image)

Ready to run the preview?

Five stages

Plan → read → change → check → approved execution

  • Plan lists the goal, scope, acceptance checks and what is excluded. It is not “write code immediately”.
  • Read collects facts from the real folder; the AI does not build a script from assumptions.
  • Change writes the script and dry-run flag, but stops before the irreversible action.
  • Check presents the preview and consequences.
  • Approved execution happens only after your explicit acceptance.
Step 05 · Case A

Safety mode adds guardrails — a preview lists the move; you confirm the real action

Safety mode was loaded when the large move became clear. Irreversible actions—moving, deleting or overwriting files, Git reset, publication—must first state a plan. A large file move requires a preview list and explicit user confirmation. The AI may not do it quietly.

What safety mode does in this step

YouOK, run the preview.
AI · preview
$ python sort_downloads.py --dry-run

==== Dry-run summary ====
Total scanned: 1,043 files
documents/2025/ 234 · documents/2024/ 178 · documents/2023/ 62
images/2025/ 198 · images/2024/ 134
installers/2025/ 48 · installers/2024/ 39
archives/2025/ 26 · archives/2024/ 21 · others/ 103

⚠️ 5 filename collisions will receive _1 / _2 suffixes.
⚠️ 0 files cross a disk partition.

Preview complete. No files moved. Type yes only if you accept the allocation.

You may also ask to keep recent files—for example, files from the last seven days—in ~/Downloads instead of moving them.

YouThe list is fine. I accept it; perform the real action.
AI · real action
Moving 1,043 files...
[████████████████████████████████] 100% (1043/1043)

Moved: 1,043 · Renamed collisions: 5 · Failed: 0

The Downloads folder now has five main categories with year subfolders. You can inspect it in your file manager.

Safety mode did three things
  • Preview is compulsory: moving more than 1,000 files cannot be a one-line action; first preview, list and explicit approval.
  • The list is transparent: category counts, year distribution and collision handling are visible and adjustable.
  • Secrets and destructive boundaries remain protected: commands such as rm -rf and git reset --hard, system-root paths, and force pushes have separate hard guards. A force push requires distinct approval and affected-ref checking.
Practical · Governance Bridge

After creating an important document — connect it so it does not become an orphan

Some documents are not ordinary drafts: a stock list, production guide, runbook, workflow, checklist or source of truth. A future AI needs to know their purpose, when to read and update them, and whether an older document already has the same role. You can nominate one document, or scan a repository for likely unconnected important documents.

YouI just created docs/production-guide.md. Connect this document to Agent Handoff Kit.
AI

I will first perform a read-only connection audit:

  1. Does the document state its purpose, scope and update timing?
  2. Does dev/PROJECT_INDEX.md register it and say when to read it?
  3. Does dev/DOC_SYNC_REGISTRY.md carry a matching sync obligation?
  4. Do relevant workflows remind us to update this guide?
  5. Does the handoff contain only current state and the log only this-session evidence?
  6. Is there another production guide or an older source of truth?

I will report connected items, gaps, proposed patches and decisions you must make. A repository scan produces candidates and gaps first; it does not silently repair, delete, rename or merge documents.

Two entry points

Say Connect docs/production-guide.md to Agent Handoff Kit or legacy form: bridge governance docs/production-guide.md. For discovery, say Scan for important documents not connected to Agent Handoff Kit or scan for unbridged governance documents. Scan results are candidates; only after you agree may the AI update an index, sync register or workflow.

Step 06 · Case A

Wrap up — one phrase updates the handoff and prepares the next-session prompt

When you are ending the session, you do not need to remember which files to update. Say “收工”, “Wrap up Agent Handoff”, “wrap up”, or “handoff”. The AI detects closeout intent, reconciles the handoff, writes this session’s log evidence, and synchronises the next-session text into START_NEXT_SESSION_PROMPT.txt.

Closeout triggers the full handoff sequence

YouWrap up.
AI · closeout
   /\_/\   Agent Handoff Kit vX.Y.Z
( -.- ) handoff saved
> ^ <

✅ Completed: Downloads organiser finished; 1,043 files are in five categories with year subfolders
🔎 Checked: preview + real run + 0 failures
📌 Handoff: next-session prompt prepared
⚠️ Boundary: not yet published (README, version tag, GitHub push remain)

I updated the handoff to “sort_downloads.py completed and executed”, recorded preview and execution evidence in the session log, and added the tool’s role to the project index. At the next session, a plain Start Agent Handoff shows this state; to continue immediately, include the next task in the same message or the next message. The next handoff prompt is synchronised; the handoff itself remains authoritative.

Work in ~/Downloads-tidy. Read AGENTS.md first, then Start Agent Handoff.
Before changing anything, tell me the current state and your recommended next step.
What closeout guarantees
  • Natural trigger phrases: “收工”, “Wrap up Agent Handoff”, “wrap up”, “handoff”, “end session” and “done for today” use the same closeout flow.
  • Reconcile, do not append: current handoff state is rewritten against facts; new text is not simply added beneath old state.
  • Prompt mirror: the next-session text is written to START_NEXT_SESSION_PROMPT.txt for convenience. It is not a second authority.
  • Log maintenance: old log entries compact into an index and later archive, so ordinary startup need not read a growing log.
Step 07 · Case A

Next handoff and public release — the new conversation resumes state; work starts only with a task

A day later, you want a README, version tag and GitHub publication. Open a new AI conversation—perhaps a different tool such as Codex or Antigravity. A plain Start Agent Handoff first shows the state; if you want the AI to begin immediately, include the release task in the same message or the next message. The new AI reads the entry rules and authoritative handoff, so you do not repeat the background. A connected GitHub integration still does not authorise pushing, tagging or creating a release: each needs explicit approval.

Handoff and public-release safeguards

You · next day
Start Agent Handoff. Continue the release work: add a README, create the version tag, and prepare the GitHub push; wait for my step-by-step confirmation before any external write.
AI · continuation
🔎 Handoff: loaded
📌 Current state: sort_downloads.py completed and executed (1,043 files moved)
✅ Verified: GitHub integration is connected
⚠️ Boundary: tag, push and release are irreversible and each require explicit approval
🚀 Recommended next step: load Release + Safety and plan

Release approve before a real tag or push Safety protect remote Git writes

The plan is to write README.md, initialise local Git and commit, create local git tag v0.1.0, then—with your separate confirmation—create a public or private downloads-tidy repository, push code and tag, create a release, and read the GitHub result back.

YouThe plan is fine. Use a public repository named downloads-tidy.
AI

The README, first local commit and local v0.1.0 tag are complete. Before I create the GitHub repository, push, and create the release, please confirm that separate irreversible operation.

After confirmation, the AI reports each result—repository creation, remote, main push, tag push and release—then reads back the GitHub page to confirm the commit, tag and release link agree.

Release safeguards
  • A new AI does not need your whole history: entry files and the handoff state tell it what happened, what is next and what risk remains.
  • Cross-tool continuity: Claude today and Codex or Antigravity tomorrow can use the same handoff data; actual entry support follows the tool’s documentation and local verification.
  • Connected integration plus readback: if GitHub is connected, the AI can execute and then read back the result; if it is not, it gives detailed manual steps.
  • Two approvals: a plan approval is not a publication approval. A tag, push and release each require your clear go-ahead.
  • Credentials stay separate: integration credentials live in the AI tool’s secure store, never in dev/ governance files.

After all three cases, the same flow works for different tasks

The AI reads the install page to decide whether to install or upgrade, or you install manually in the terminal — you open a new AI conversation to start the handoff — a plain start first shows state and a recommended next step, and work begins only when there is a task — the planning stage stops for your confirmation — Safety, Knowledge and Writing rules load when the task needs them — when you are ending the session, one wrap-up phrase writes the next-session prompt — a later conversation can recover the state with “start”. Case A and Case B each have seven steps, while Case C evolves across months, but the backbone is the same across cases, tools and days.

For your third or fourth task — a newsletter, stock-market observation, or invoices across several projects — the flow is still the same. The working mode changes with the task, but your habit stays consistent: start to see status, state the task, confirm the plan; wrap up when you are ending the session.

One more recommendation: if you want durable baseline rules for how an AI behaves inside a single conversation—tone, priority, response structure, safety guardrails and output-layer split—use Adam-AI-Instructions alongside this kit. In that repository, choose the suitable version from “五、提示詞索引”, copy the matching prompt.md, and paste it into your AI tool settings. Agent Handoff Kit manages continuity between conversations; Adam-AI-Instructions manages single-conversation quality. They do not overlap.

Back to the 60-second beginner intro →See the local Agentic AI workflow case study →Read README on GitHub →Read Adam-AI-Instructions →