Skip to main content

Agent Nerve

PyPI version Python 3.10+ License: MIT GitHub stars

Agent Nerve is a local-first shared operations layer for mixed agent fleets.

It gives Claude Code, Codex, Hermes, and custom agents a small common place to:

  • write durable task updates
  • hand off work across sessions and machines
  • claim shared resources before they step on each other
  • resume a task from what another agent already did

This is not a vector-memory product. It is an append-only coordination layer with task state, event history, and lease-based claims.

Install

pip install agent-nerve

Why it exists

Most agent tools remember prompts. Fewer solve operational continuity.

The problem people actually hit is:

  • one Claude session starts the work
  • another Claude or Codex session picks it up later
  • a server-side worker like Hermes does the heavy lifting
  • nobody has a clean, shared, machine-readable history of what happened, what is still blocked, and who currently owns a risky resource

Agent Nerve is the missing shared log.

What you get

  • stdlib-only Python server
  • SQLite storage
  • bearer-token protected write API
  • queued writes for flaky networks
  • task records with next_action
  • append-only event history
  • lease-based claims for shared resources
  • built-in redaction for common secrets and user-home paths
  • CLI helpers for agents and operators

Quickstart

git clone https://github.com/kyletusing34/agent-nerve.git
cd agent-nerve
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
export AGENT_NERVE_API_KEY="change-me"
agent-nerve serve --host 127.0.0.1 --port 8787

In another terminal:

export AGENT_NERVE_SERVER="http://127.0.0.1:8787"
export AGENT_NERVE_API_KEY="change-me"

agent-nerve task create \
  --namespace demo \
  --title "Build the launch page" \
  --owner claude-code \
  --summary "Initial task created"

agent-nerve event emit \
  --namespace demo \
  --agent claude-code \
  --kind progress \
  --summary "Read the repo and found the landing page entrypoint" \
  --details "Next: patch headline and CTA."

agent-nerve claim acquire \
  --namespace demo \
  --resource repo:landing-page \
  --agent claude-code \
  --ttl-seconds 1800 \
  --note "Editing homepage hero"

Inspect state:

agent-nerve task list --namespace demo
agent-nerve event tail --namespace demo --limit 20
agent-nerve claim list --namespace demo

Daily-ops log shorthand (0.2)

Matches the in_progress / failed / completed logging habit many fleets already use:

agent-nerve log \
  --namespace demo \
  --agent codex \
  --action "patch homepage CTA" \
  --result "CTA copy updated; awaiting deploy" \
  --status in_progress \
  --task-id 1

Offline-safe writes (0.2)

If the server is unreachable, event emit and log:

  1. append to the JSONL queue (AGENT_NERVE_QUEUE_FILE)
  2. mirror into a local SQLite file (AGENT_NERVE_LOCAL_DB)

Flush later:

agent-nerve queue flush

Core concepts

Namespace

A namespace is the shared scope for a project, team, or incident.

Examples:

  • client-acme-site
  • infra-maxxx
  • offer-launch-june

Task

A task is the current durable snapshot:

  • title
  • status (queued, open, in_progress, blocked, done, spawned)
  • owner
  • summary
  • next action

Event

An event is the historical timeline:

  • progress updates
  • blockers
  • handoffs
  • notes
  • completion

Claim

A claim is a temporary lease on a shared resource:

  • a file or repo section
  • a deploy slot
  • a migration
  • a queue item

Claims expire automatically based on lease_expires_at, so abandoned sessions do not lock the system forever.

Safe-by-default behavior

Before data is written, Agent Nerve redacts:

  • sk-... style API keys
  • GitHub tokens (ghp_, github_pat_)
  • Slack bot tokens and webhook URLs
  • Discord webhook URLs
  • bearer tokens
  • AWS access key ids
  • PEM private-key blocks
  • inline api_key= / token= / password= assignments
  • local home-directory paths

You should still keep high-risk secrets out of summaries when possible, but the server adds a defensive scrub instead of trusting every agent to behave.

More detail: docs/security.md

Suggested pattern for Claude Code / Codex / Hermes

  1. Create or claim the task.
  2. Emit short progress events at meaningful checkpoints.
  3. Write blockers as explicit events, not hidden in chat.
  4. Update next_action before handing off.
  5. Use claims before editing risky shared resources.
  6. Release claims when done.

CLI reference

Start server:

agent-nerve serve --host 0.0.0.0 --port 8787 --db ./data/agent_nerve.sqlite3

Create task:

agent-nerve task create --namespace ops --title "Review queue" --owner hermes

Update task:

agent-nerve task update \
  --task-id 3 \
  --status blocked \
  --summary "Waiting on Cloudflare token" \
  --next-action "Human restores token"

Emit event:

agent-nerve event emit \
  --namespace ops \
  --agent codex \
  --kind handoff \
  --summary "Patched source and need remote deploy" \
  --details "Source is ready locally; remote deploy still pending."

Flush queued/mirrored events:

agent-nerve queue flush

Acquire claim:

agent-nerve claim acquire \
  --namespace ops \
  --resource service:lead-intake \
  --agent hermes \
  --ttl-seconds 900

Release claim:

agent-nerve claim release --claim-id 4

API

Read endpoints:

  • GET /api/health
  • GET /api/state?namespace=<name>
  • GET /api/tasks?namespace=<name>
  • GET /api/events?namespace=<name>&limit=100
  • GET /api/claims?namespace=<name>

Write endpoints:

  • POST /api/tasks
  • PATCH /api/tasks/<id>
  • POST /api/events
  • POST /api/claims
  • DELETE /api/claims/<id>

Write calls require one of:

  • Authorization: Bearer <key>
  • X-Agent-Nerve-Key: <key>

Example integrations

See examples/claude-codex-hermes.md

What this is not

  • not a central planner
  • not a vector store
  • not a chat relay
  • not a secret store
  • not a replacement for repo-local docs or issue trackers

It is the smallest useful shared ops layer between agents.

Metadata

Release files for agent-nerve 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-nerve 0.2.0
File Size Uploaded Provenance Actions
agent_nerve-0.2.0.tar.gz 17.6 kB With provenance Details for agent_nerve-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-nerve 0.2.0
File Interpreter ABI Platform Actions
agent_nerve-0.2.0-py3-none-any.whl Python 3 none any Details for agent_nerve-0.2.0-py3-none-any.whl

Total release size: 34.0 kB

Release files / agent_nerve-0.2.0.tar.gz

Download URL agent_nerve-0.2.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
330aa6ed185ebc5c3696dd0808a16600a93ece3e7b3a3046da14249013683ca8
BLAKE2b-256 checksum
How to use checksums
2b6d123d3f23922d055bbe8d0fa3f51b8b05aae96415dd1a09112e89f1b167e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / agent_nerve-0.2.0-py3-none-any.whl

Download URL agent_nerve-0.2.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0515e582ee895a8985840132d585d61b71997c2d31e92894e8d8ef3be4df28ab
BLAKE2b-256 checksum
How to use checksums
07d8a579adf2ae38d8f7f832e4a4bdc141c351ed908976c8bcd7ff39f7708b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for agent-nerve 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_nerve-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page