Opencode-History-Search

    1

    Search and retrieve past OpenCode session history, commands, and file changes using keyword or fuzzy search.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Opencode-History-Search

    Example session with this skill installed

    Find the session where we configured the redis swap settings last week. Use fuzzy mode since I might be misspelling swap.

    • Read your context and instructions
    • Compiled the opencode-history-search

    I have searched the OpenCode history for "redis swap" using fuzzy matching for the last 7 days.

    Search Results

    Found 1 session matching your criteria.

    Session: Redis Memory Optimization

    • ID: oc_88291_x92
    • Project: backend-api-v2 (Hash: a1b2c3d)
    • Date: 2023-10-24 14:15:32
    • Match Type: Fuzzy (Score: 0.72)

    Excerpt:

    User: We need to handle the OOM errors. Let's configure the redis swap-file and maxmemory settings to prevent the crash we saw in staging.

    Assistant: I'll update the redis.conf. We should set maxmemory 2gb and maxmemory-policy allkeys-lru. For the swap usage, I will check the vm.swappiness level on the host as well.

    Next steps

    1. Review the redis.conf changes from session oc_88291_x92.
    2. Apply the maxmemory policy to the current production environment.
    3. Verify if vm.swappiness was actually adjusted on the host machine.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Context switching and memory loss kill developer velocity. You shouldn't have to manually hunt through old terminal logs or chat transcripts to remember how you solved a specific bug last month. This skill enables your agent to query the local OpenCode history database directly, retrieving past decisions, commands, and code changes with precision.

    What it does

    • Multi-mode search provides keyword, regex, and fuzzy matching to find sessions even with typos or partial recall.
    • File-trace auditing identifies every past session that created or modified a specific file path.
    • Contextual filtering narrows results by date ranges, specific roles (user vs. assistant), or project scope.
    • Cross-project retrieval searches across all local repositories and global buckets to find solutions from different environments.
    • Structured extraction returns session IDs, project metadata, and relevant message excerpts in agent-readable markdown.

    How it works

    1. The agent locates the OpenCode SQLite database in standard XDG, macOS, or Windows application data paths.
    2. It executes the provided Python script using specific flags like --query, --terms, or --file-path.
    3. The script performs a read-only query against the session_v2 and session_message tables.
    4. The agent parses the markdown results to answer questions about past logic or re-implement previous solutions.

    Frameworks & tools

    Built with Python 3.8 standard library. It interacts directly with SQLite databases and integrates with Git for repository-based session scoping.

    Why this beats prompting it yourself

    Standard agents have no native visibility into their own past session databases or local file history. This skill provides the specific SQL logic and path resolution needed to bridge that gap without requiring you to manually export logs or copy-paste old context.

    Use cases

    • Find the specific docker-compose configuration used in a project three months ago.
    • Identify which session introduced a breaking change to a specific YAML config file.
    • Recall the architectural decisions made during a multi-day refactoring task.
    • Retrieve a complex regex or shell one-liner that was successfully run in a previous session.

    Known limitations

    Requires an existing OpenCode SQLite database on the local machine. Fuzzy search is an approximation using difflib and may vary in accuracy compared to specialized search engines.

    Requires a local OpenCode history database. Fuzzy search uses difflib approximations. Python 3.8+ must be installed.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 19 days ago

    • Free with an Agensi account

    Requires

    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Listed19 days ago

    What's inside

    Frequently Asked Questions

    This skill enables your AI agent to query its own past session database, allowing it to instantly recall specific commands, code changes, and architectural decisions from weeks or months ago without manual log searching.

    It works by executing a Python-based query layer that accesses the local OpenCode SQLite database across standard directories on macOS, Linux, and Windows.

    Yes, the skill includes a file-trace auditing feature that allows you to search for every session where a specific file path was modified or created.

    The search operates entirely on your local machine using read-only SQL queries, ensuring your session data stays within your local environment and is never uploaded to external servers.

    You will receive the core Python integration script, the SQL query logic for session retrieval, and documentation on how to configure your agent to utilize these tools.

    New in Workflow Automation