> ## Documentation Index
> Fetch the complete documentation index at: https://learn.cleftnotes.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Access from the command line

> Point any agent that runs commands, or a script of your own, at your Cleft notes with one line

Point any agent that can run a command, or a script of your own, at your notes
with one line. You do not need to know what MCP is or edit a configuration
file. Cleft writes the line for you, and the agent learns the rest from the
command itself.

Use this route when your agent is not in the [Agent Access](https://learn.cleftnotes.com/user-guides/integrations/agent-access/overview.md)
list, or when you want a script to read your notes. It also suits anyone who
prefers one line in a file they already keep. For Claude Desktop, Cursor, and
the other apps Cleft names, the setup on the Agent Access page is shorter.

## Get your command

1. Open **Cleft > Settings > Agent Access**.
2. Turn on **Let AI tools read your notes** and choose a source.
3. Select **Use it from the command line**.
4. Select **Copy command**.

The command stays hidden until you ask for it, so the pane is safe to share.
It names the source your agent reads and the Cleft helper on this Mac, and it
ends in `--help`. Run it in Terminal once to see what the helper can do. The
helper lists `notes list`, `notes search`, `notes show`, `notes export`, and
`tags list`.

The line looks like this, with your own folder and helper filled in:

```bash theme={null}
CLEFT_AGENT_BACKEND='localExportFolder' CLEFT_EXPORT_FOLDER='/Users/you/Cleft Notes' '/Applications/Cleft.app/Contents/Helpers/CleftAgentAccess.app/Contents/MacOS/cleft' --help
```

Replace `--help` with a command from that list to read your notes. For
example, `notes search "budget"` finds every note that mentions the budget.
The copied line contains paths from your Mac. Use the instructions file in your
home folder if others can see or commit the project file.

## What the command line can read

The command line only reads. It cannot create, edit, delete, archive, or share a note.
It reads the source you chose in Agent Access: your Local Export folder on
this Mac, or your Cleft account library with Plus. It sees your own notes and
tag names and skips Cleft's system notes. Your account key never appears in
the command. Cleft keeps it in your Mac's Keychain.

## Claude Code

Add one line to `CLAUDE.md` in the folder you work in: "To read my Cleft
notes, run" followed by the command you copied. Claude Code reads that file at
the start of every session. Put the line in `~/.claude/CLAUDE.md` instead to
make it apply to every folder. If your project already uses `AGENTS.md`, you
can put the line there instead. By default, Claude Code reads it only when no `CLAUDE.md`
or `CLAUDE.local.md` applies to your folder. If either Claude file applies, put
the line in that file.

## Codex

Add the same line to `AGENTS.md` in the folder you work in. Codex reads it
before every task. Put the line in `~/.codex/AGENTS.md` to make it apply to
every folder.

## Gemini CLI

Add the same line to `GEMINI.md` in the folder you work in. Gemini CLI sends
that file with every prompt. Put the line in `~/.gemini/GEMINI.md` to make it
apply to every folder.

## OpenCode

Add the same line to `AGENTS.md` in the folder you work in. OpenCode uses the
first file it finds. Put the line in `~/.config/opencode/AGENTS.md` to make it
apply to every folder.

## Another agent with a shell tool

Give the copied line to your agent and ask it to run the line ending in
`--help` first. Then ask it to replace `--help` with a note command, such as
`notes search "budget"`.
If your agent has an instructions file, use its own guide to find that file.
Put the line there if you want the agent to remember it. Otherwise, give it
the line when you need it.

## A shell script

Paste the command into your script and replace `--help` with the command you
want. Add `--json` to get output your script can parse.

```bash theme={null}
CLEFT_AGENT_BACKEND='localExportFolder' CLEFT_EXPORT_FOLDER='/Users/you/Cleft Notes' '/Applications/Cleft.app/Contents/Helpers/CleftAgentAccess.app/Contents/MacOS/cleft' notes list --json
```

The script sees the same notes an agent sees, and it cannot change them
either.

## Stop an agent reading your notes

Remove the line from the agent's instructions file, then stop that agent.
A running agent may remember a command it already saw. Remove the command from
any script that uses it, then stop the script. The command line never registers
with Cleft, so **How to disconnect** in Agent Access lists nothing for it.

Turning Agent Access off stops Cleft offering the command. It does not stop an
agent that already has the line. Turning Local Export off stops new exports. It
does not remove files already in the folder or stop a copied command from
reading them. Delete exported files you no longer want in that folder.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.