elephant

by vishesh9131Verified

Local-first session continuity across AI coding harnesses

0
Stars
0
Forks
Python
Language
8/24/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/vishesh9131/elephant

Getting Started

Guides for using skills like elephant.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

Elephant, the coding agent that never forgets

Elephant

The model forgets. The elephant doesn't.

GitHub stars Latest release Build status Works with 20+ agents MIT license

Claude hits quota. Codex keeps going.
Automatic, local-first session continuity across AI coding harnesses.

Visit the Elephant website →


You know the ritual.

Claude has the entire problem in its head. It has read the repo, found the bug, changed six files, failed one test, and finally understood why.

Then:

You've hit your usage limit.

You open another agent. It cheerfully asks what you are working on.

Now you are the context window.

Elephant removes that part.

Without / with Elephant

Without Elephant:

Claude:  You've hit your usage limit.
Codex:   What would you like to work on?
You:     Okay, so first you need to understand this 47-message conversation...

With Elephant:

Claude:    You've hit your usage limit.

           [open the same repo in Codex]

Elephant:  Recovered the previous Claude Code session.
           Objective: fix refresh-token rotation.
           State: implementation complete; one integration test still fails.
           Changed: auth/session.py, tests/test_rotation.py

Codex:     I found the failing test. Continuing from there.

The dead model does not need to summarize anything. Elephant was already recording while it was alive.

How it works

Elephant is a plugin, not another command you babysit.

Every prompt, response, tool call, failure, and file change
                         │
                         ▼
             append-only local journal
                         │
              completed turn / compaction /
              interruption / quota failure
                         │
                         ▼
                recovery capsule
                         │
             open the repo in another agent
                         │
                         ▼
             objective + state + Git evidence

It remembers:

  • the current objective and last completed state;
  • the last prompt and model response;
  • modified files and live Git state;
  • recent tool/model failures;
  • the latest 20 session events;
  • a redacted transcript reference when the host exposes one.

Every capture-capable native shell writes the same versioned event format. They share ~/.elephant/elephant.db, so Claude's memory is visible to Codex, Hermes, Pi, OpenCode, Copilot, and every other Elephant adapter.

Three layers

┌──────────────────────────────────────────────────────────────┐
│ Native shells                                               │
│ Claude · Codex · Hermes · OpenCode · Pi · Copilot · Gemini │
├──────────────────────────────────────────────────────────────┤
│ Elephant kernel                                             │
│ redact · journal · checkpoint · inspect Git · build capsule │
├──────────────────────────────────────────────────────────────┤
│ Continuation                                                │
│ automatic startup injection · Elephant Resume              │
└──────────────────────────────────────────────────────────────┘

One memory format. Thin native adapters. No universal fake CLI pretending every agent exposes the same API.

Install

Install once in each harness you want to hand work between. Python 3.10+ must be available as python3 for the local kernel and lifecycle hooks.

Claude Code

Send these as two separate prompts inside Claude Code:

/plugin marketplace add vishesh9131/elephant
/plugin install elephant@elephant

Elephant adds lifecycle capture, local MCP recovery tools, automatic startup recovery, and namespaced commands such as /elephant:memorize, /elephant:resume, and /elephant:help.

Codex

codex plugin marketplace add vishesh9131/elephant

Open /plugins, choose the Elephant marketplace, and install Elephant. Review and trust its local lifecycle hooks when Codex asks, then start a new session.

GitHub Copilot CLI

copilot plugin marketplace add vishesh9131/elephant
copilot plugin install elephant@elephant

The same commands work interactively with a / prefix. Elephant captures all nine Copilot CLI plugin lifecycle events and provides the resume skill.

Gemini CLI

gemini extensions install https://github.com/vishesh9131/elephant --ref=v0.4.5

Gemini loads Elephant's project context and resume skill. The public repo is tagged for Gemini's extension gallery crawler.

Pi

pi install git:github.com/vishesh9131/elephant@v0.4.5

Requires Node.js 22.19+. Pi loads the native JavaScript extension, /elephant <command>, /resume, and the Elephant skills.

Hermes Agent

hermes plugins install vishesh9131/elephant --enable

Restart Hermes after installing. Elephant registers native lifecycle hooks, the recovery tools, both Elephant skills, and /elephant <command>.

Why /elephant instead of /resume? Hermes already owns /resume. The elephant remembers names too.

OpenCode

From a checkout, point your opencode.json at Elephant's JavaScript plugin:

{
  "plugin": ["/absolute/path/to/elephant/.opencode/plugins/elephant.mjs"]
}

The plugin captures prompts, responses, tool calls, compaction, idle, errors, and session end. The npm package is prepared but not published yet.

The rest of the herd

Not every harness exposes lifecycle hooks. Elephant says exactly what each one can do instead of painting “98% quota used” on a guess.

HarnessSupportSurface
Claude Code, Codex, Hermes, OpenCode, PiNative continuityHooks/extensions capture automatically and inject recovery
GitHub Copilot CLINative recoveryMarketplace plugin, nine hooks, MCP, and skill
Gemini / Antigravity, Qoder, Devin, Grok BuildNative recoveryExtension/plugin manifest plus recovery skill
OpenClaw, SwivalNative recoveryPackaged skill collection
CursorPortable recovery.cursor/rules + Elephant MCP
WindsurfPortable recovery.windsurf/rules + Elephant MCP
ClinePortable recovery.clinerules + Elephant MCP
KiroPortable recovery.kiro/steering + Elephant MCP
CodeWhale, Amp, Jules, compatible hostsPortable recoveryAGENTS.md

See the full platform matrix for capability details and current conformance status.

What happens near quota?

Mostly, nothing special—and that is the point.

Most coding harnesses do not expose an exact subscription percentage. Elephant never invents one. Quota signals are stored as exact, estimated, or unknown.

Instead of gambling everything on a mythical “99% used” callback, Elephant:

  1. journals continuously;
  2. checkpoints after every completed model turn;
  3. checkpoints again before compaction and at session end;
  4. records native interruption and quota-failure events when the host provides them.

If the quota dies without warning, the memory is already on disk.

Manual handoff

Automatic journaling stays active, but you can force a handoff whenever you want. In Claude Code:

/elephant:memorize

Then open the same repository in Codex and invoke:

$elephant resume

Codex receives the freshest capsule, compares it with the live worktree, and continues the unfinished objective. Codex exposes installed skills through $ mentions; Claude plugin skills are namespaced as /elephant:<command>.

For a named chat handoff, use @Elephant exact auth-fix before switching harnesses, then @Elephant pull auth-fix in the new one. The prompt hook saves the label before model execution and refreshes it on quota failure. If Elephant was installed mid-session, it finds only the active chat for the exact current project and safely snapshots its newest 256 KiB instead of copying an unbounded or unrelated transcript. Pull feeds the redacted chat to the new harness, identifies the previous harness, and gives a short summary without starting work until you ask.

Codex exact uses the current bundled runtime before a possibly older Elephant MCP process. This preserves the active chat after a plugin refresh without requiring the user to reconstruct it.

CommandPurpose
memorizeForce a fresh checkpoint of the current session
exact <label>Save a redacted chat snapshot in SQLite under a durable label
pull <label>Feed a labeled chat to another harness and summarize the handoff
resume [memory-id]Recover the latest or a selected memory and continue
helpShow the complete command card
statusShow protection, freshness, and transcript coverage
history [limit]List recent project memories
peek [memory-id]Preview recovery without continuing
note <text>Preserve an exact high-priority user instruction
doctorCheck storage and adapter readiness
usageShow database, transcript, project, and global disk usage
clean [age] [--keep N] [--yes]Preview ancient sessions, then delete only with explicit confirmation
pin [memory-id]Protect a memory's entire source session from cleanup
unpin [memory-id]Remove cleanup protection from a source session
compactRepack SQLite and reclaim unused database pages without deleting memories
forget <target> --yesPermanently delete a capsule, session, or project memory

Hermes and Pi use /elephant <command>. Other skill-capable hosts use $elephant <command>, their native skill picker, or natural-language invocation.

Cleanup is deliberately two-step. This only previews sessions older than 30 days, always retains at least the newest 10 sessions, and skips anything pinned:

/elephant:clean

To apply that preview in Claude Code, explicitly confirm it:

/elephant:clean 30d --keep 10 --yes

Then /elephant:compact can reclaim unused database pages. In Codex, use the same arguments after $elephant; in Hermes and Pi, use /elephant.

Local means local

Elephant has no account, cloud, analytics, telemetry, ad network, or mysterious “improve the product” upload.

~/.elephant/
├── elephant.db       # events, recovery capsules, and cleanup pins
└── transcripts/      # optional compressed transcript copies

Sensitive keys and common credential formats are redacted before persistence. Redaction is defense-in-depth, not magic: protect the machine and do not share the database casually.

Set ELEPHANT_DATA_DIR to move the store. Read the privacy notice and security policy.

Resume explicitly

Automatic recovery happens when a native host starts a new session in a project that has an Elephant capsule from another session.

When you want to ask directly:

HostCommand / skill
Claude Code/elephant:resume
Codex$elephant resume
Pi/elephant resume or /resume
Hermes/elephant resume
Other skill-capable hostsinvoke the elephant skill with resume

Recovery compares the capsule's Git metadata with the live worktree. The files on disk win. Elephant remembers the past; it does not overwrite the present.

Tested, not merely listed

The conformance suite proves the same flow across adapters:

capture → checkpoint → switch harness → recover → verify Git state

The current release includes:

  • real plugin-load checks for Claude Code, OpenCode, Pi, Copilot, and Hermes when their binaries are installed, plus remote marketplace discovery in Codex;
  • live model-turn verification for Copilot CLI and Hermes;
  • cross-harness Claude → OpenCode → Pi → portable recovery contracts;
  • 11 Python/JavaScript tests for journaling, redaction, MCP, manifests, and continuation.

Run everything available on your machine:

PYTHONPATH=src python3 scripts/conformance.py
python3 -m unittest discover -s tests -v

The event protocol is documented in docs/protocol.md.

FAQ

Does Elephant ask the dying model to summarize the session?

No. A model at quota is about as useful as a fire alarm after the building is gone. Elephant records continuously and builds the handoff itself.

Does it copy my session to another company's server?

No. Harnesses still send prompts to their own configured model providers, but Elephant's journal stays on your machine.

Can it really know when I am at 98%?

Only if the harness exposes that number. Most do not. Elephant would rather be useful at an honest unknown than impressive at a fictional 98%.

What if the repo changed after the handoff?

The live worktree is authoritative. Elephant shows the old capsule as evidence, compares Git state, and continues from what actually exists.

Why “Elephant”?

Because “Cross-Harness Context Persistence Orchestration Kernel” remembered the architecture and forgot the joke.

Development

The core is dependency-free Python. Host-specific code stays thin: manifests, hook maps, skills, and small JavaScript/Python adapters around the shared event protocol.

To add another harness:

  1. declare what its API genuinely exposes;
  2. map native events into the Elephant protocol;
  3. package the host's native install surface;
  4. prove capture → checkpoint → recovery in conformance tests.

Contributions are welcome. Fake support badges are not.

License

MIT. Elephants travel better when the gate is open.

Frequently Asked Questions

What is elephant?

elephant is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by vishesh9131. Local-first session continuity across AI coding harnesses. It has 0 GitHub stars.

Is elephant safe to use?

Yes. elephant passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install elephant?

Clone the repository with "git clone https://github.com/vishesh9131/elephant" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is elephant written in?

elephant is primarily written in Python. It is open-source under vishesh9131 on GitHub, so you can review or fork the full source.

Are there alternatives to elephant?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh elephant against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details