refs/notes/commits, which matches Git’s own default for
git notes.
Choose a notes ref
Use the default ref when all notes belong to one stream. Use a custom notes ref when different systems need independent note namespaces. For example:cifor build and deploy statusreviewsfor review summariesagents/session-123for per-agent handoff state
ref to the SDK note methods to target a custom notes ref:
ref in the write/delete request body,
or as a query parameter when reading a note.
Ref rules
Empty or omittedref values use refs/notes/commits.
Custom notes refs are canonicalized like Git’s git notes --ref option:
| Input | Canonical ref |
|---|---|
reviews | refs/notes/reviews |
notes/reviews | refs/notes/reviews |
refs/notes/reviews | refs/notes/reviews |
refs/ prefix, it must be a
safe refs/notes/* ref. Short inputs are resolved inside refs/notes/ before
the same validation runs.
The server rejects refs outside the notes namespace and unsafe ref paths,
including parent traversal, empty path segments, trailing slashes, trailing
dots, and .lock suffixes. Invalid notes refs return 400.
List notes refs
Use the notes refs list API to discover custom notes namespaces before reading individual notes. It returns notes refs under arefs/notes/ prefix in lexical
order.
prefix is canonicalized like the note ref above: short inputs resolve
inside refs/notes/, and a fully qualified refs/notes/* prefix also works. A
trailing slash restricts the listing to descendants of that ref. Omit prefix
to list everything under refs/notes/.
| Prefix | Canonical prefix | Matches |
|---|---|---|
| (omitted) | refs/notes/ | All notes refs |
reviews | refs/notes/reviews | refs/notes/reviews and descendants |
reviews/ | refs/notes/reviews/ | Descendants under refs/notes/reviews/ |
refs/notes/reviews | refs/notes/reviews | refs/notes/reviews and descendants |
next_cursor as the cursor query parameter to read the next page.
limit defaults to 20 and is capped at 100. Responses echo the normalized
full prefix and full notes ref names. Invalid prefixes and cursors return
400.
Write behavior
createNote() creates a new note and fails if the target already has a note on
the selected notes ref. To replace a note, delete it first with
deleteNote(), then create the new note.
appendNote() appends text to the note on the selected ref. If no note exists,
the server creates one.
deleteNote() removes the note from the selected ref.
targetRef in write responses is always the canonical full ref, such as
refs/notes/reviews. refSha in read responses is the current SHA of the notes
ref that was read.
Concurrency and policies
expectedRefSha protects the selected notes ref with optimistic concurrency.
When ref is omitted, the guard applies to refs/notes/commits. When ref is
set, it applies to that custom notes ref.
refPolicies are evaluated against the selected notes ref for createNote(),
appendNote(), and deleteNote(). See the Branch Protection guide.