npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@humanlayer/agentlayer-filesystem

v0.0.81

Published

Filesystem-backed implementations of `agentlayer-core`'s tool interfaces (read, write, edit, apply_patch, glob, grep, list, bash), plus the hooks and prompts needed to assemble a real coding agent that operates on a local directory. Where `agentlayer-core

Readme

@humanlayer/agentlayer-filesystem

Filesystem-backed implementations of agentlayer-core's tool interfaces (read, write, edit, apply_patch, glob, grep, list, bash), plus the hooks and prompts needed to assemble a real coding agent that operates on a local directory. Where agentlayer-core defines what a tool is (schema + description via ReadTool, EditTool, etc.), this package provides the executors that actually touch disk and spawn processes.

Install

bun add @humanlayer/agentlayer-filesystem

Usage

Build a full Claude- or Codex-style toolset for a working directory in one call:

import { createClaudeCodingAgentToolset, createAgentFilesystemHooks, createAgentSystemPrompt } from '@humanlayer/agentlayer-filesystem'

const tools = await createClaudeCodingAgentToolset({ cwd: '/repo' })
// { bash, read, write, edit, glob, grep, list, skill, web_fetch, ... }

const hooks = createAgentFilesystemHooks({ cwd: '/repo' })
// { preToolUse, postToolUse, preRequest } — wasted-read prevention,
// read-before-write enforcement, output truncation, file-state tracking

const system = await createAgentSystemPrompt({ cwd: '/repo', model: 'claude-sonnet-4-5' })

createCodexCodingAgentToolset builds the Codex-flavored equivalent (apply_patch instead of write/edit). Both are composed from createClaudeAgentFilesystemToolset / createCodexAgentFilesystemToolset (filesystem tools only) plus createCodingAgentAuxToolset (skill, agent/subagents, web_fetch, web_search).

Individual tool factories are also exported for manual composition, e.g. createReadTool({ cwd }), createBashTool({ cwd }), createGrepTool({ cwd }) — each returns a Tool built via <Interface>.define(executor, { description }) from @humanlayer/agentlayer-core/interfaces.

Subpath exports

  • . — everything below
  • ./tools — tool factories (createReadTool, createWriteTool, createEditTool, createApplyPatchTool, createGlobTool, createGrepTool, createListTool, createMultiEditTool, createReadMultimodalTool, createBashTool, createSkillToolFromDirs/createSkillToolFromRepoDirs, createWebSearchTool)
  • ./hookscreateAgentFilesystemHooks and the pieces it's built from
  • ./promptscreateAgentSystemPrompt, environmentPrompt, repoInstructionsPrompt
  • ./coding-agent — the toolset/hooks composers shown above

Key pieces

  • Tools (src/tools/): each wraps Node's fs/promises (or ripgrep/bash subprocesses) behind the matching core Tool interface. read/write/edit resolve paths via expandPath (~ and cwd-relative resolution). grep shells out to ripgrep, falling back to a JS-regex file walk (fsGrepFallback) if rg is unavailable. glob/grep cap results at 100 matches, most-recently-modified first.
  • Hooks (src/hooks/): createAgentFilesystemHooks({ cwd, outputTruncation? }) wires together:
    • createWastedReadHook / createReadBeforeWriteHook (pre-tool-use) — block re-reading unchanged file ranges and require a fresh read before write/edit/apply_patch, tracked via SHA-256 hashes in agent state.
    • createFileStateTrackingHook (post-tool-use) — records read/verification state after read/write/edit/apply_patch.
    • create{Bash,Glob,Grep,List}OutputTruncationHook — truncate large tool outputs and spill the full output to a temp file via saveFullOutput. createReadTruncationHook truncates large reads and hints to continue at a higher offset (no temp file).
  • Prompts (src/prompts/): createAgentSystemPrompt assembles [persona, repoInstructions?, environment?, ...additions] for a given model. repoInstructionsPrompt searches CLAUDE.md/AGENTS.md/CONTEXT.md (cwd, then git root) or layers multiple instruction sources via instruction-resolver. environmentPrompt reports cwd/platform/git-repo status.

Toolset assembly

flowchart LR
    subgraph "agentlayer-filesystem"
        FS["createClaudeAgentFilesystemToolset\n(read/write/edit/glob/grep/list/bash)"]
        AUX["createCodingAgentAuxToolset\n(skill/agent/web_fetch/web_search)"]
        HOOKS["createAgentFilesystemHooks"]
    end
    CORE["agentlayer-core\nTool interfaces + defineTool"] --> FS
    FS --> TOOLSET["createClaudeCodingAgentToolset"]
    AUX --> TOOLSET
    HOOKS --> AGENT["agent loop"]
    TOOLSET --> AGENT

Depends on

@humanlayer/agentlayer-core (tool interfaces, prompts, hooks primitives, utils) and the ripgrep npm package for grep.